<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>fits</author_name>
  <author_url>https://blog.hatena.ne.jp/fits/</author_url>
  <blog_title>なんとなくな Developer のメモ</blog_title>
  <blog_url>https://fits.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>SQL</anon>
  </categories>
  <description>sqlparse を使って SQL の UPDATE 文から更新対象のカラムを抽出してみます。 ソースコードは こちら はじめに 更新対象のカラムを抽出するにはパース結果のトークンの中から該当部分を探して値を取得します。 例えば、以下のような UPDATE 文をパースすると 1.sql UPDATE ITEMS SET price = 1000 WHERE id = '1' 次のようなトークン構成となり、更新するカラムの部分は Comparison となります。 1.sql のパース結果 [&lt;DML 'UPDATE' at 0x200357A3280&gt;, &lt;Whitespace ' ' at …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffits.hatenablog.com%2Fentry%2F2022%2F04%2F17%2F222122&quot; title=&quot; sqlparse で SQL から更新対象のカラムを抽出 - なんとなくな Developer のメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-04-17 22:21:22</published>
  <title> sqlparse で SQL から更新対象のカラムを抽出</title>
  <type>rich</type>
  <url>https://fits.hatenablog.com/entry/2022/04/17/222122</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
