Strict Standards: Non-static method Protector::getInstance() should not be called statically in /home/suehirogari/suehirogari.com/xoops_trust_path/modules/protector/include/precheck_functions.php on line 12

Strict Standards: Non-static method XCube_Root::getSingleton() should not be called statically in /home/suehirogari/suehirogari.com/public_html/include/common.php on line 18

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/legacy/preload/Primary/SystemModuleInstall.class.php on line 117

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/legacy/preload/Primary/SystemModuleInstall.class.php on line 168

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/legacy/preload/Primary/SystemModuleInstall.class.php on line 186

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/legacy/preload/Primary/SiteClose.class.php on line 54

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/user/preload/Primary/Primary.class.php on line 65

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/user/preload/Primary/Primary.class.php on line 73

Deprecated: Non-static method XCube_Root::getSingleton() should not be called statically, assuming $this from incompatible context in /home/suehirogari/suehirogari.com/public_html/modules/user/preload/Primary/Primary.class.php on line 13
phpMyAdminでエクスポートする際のキーワードまとめ | 社内SEのウェブ制作

2014.01.21xoopsズープス

phpMyAdminでエクスポートする際のキーワードまとめ

phpMyAdminを利用し、SQL文としてエクスポートする場合の設定解釈(勝手な解釈かも知れない)

■ヘッダーへカスタムコメントを追加する
ダウンロードするファイルの頭に特別なコメントを挿入する場合ここに記述します。

■トランザクションでエクスポートを囲む
トラブル発生時にはその処理を破棄してくれる。つまり作業途中であれば、それまでの処理はなかったことにしてくれるってことで解釈。

■外部キーの検査を無効にする
あるテーブルの主キーが別テーブルでも主キーとして参照されている場合の検査をしないということで解釈。


■構造
・「DROP TABLE」を追加する
インポート時テーブルを作る前に一旦前のテーブルを削除する。つまり入れ替えるということで解釈。

・「IF NOT EXISTS」を追加する
インポート時、もしデータベースに存在しないデーブルがあれば、そのテーブルを削除する。

・「AUTO_INCREMENT」値を追加する
自動的に番号を追加する機能を追加する。

・逆クオートでテーブル名やフィールド名を囲む
SQL文のフィールド名、テーブル名を''文字で囲みます。

・CREATE PROCEDURE / FUNCTIONを追加する
テーブルを作成する際の一連の手順をまとめたプログラムを利用すると解釈。

■データ
・完全な INSERT 文を作成する
SQL文1つに対して1つのデータ(レコード)を作成する。下記の「長い INSERT 文を作成する」のいずれかを選択します。

・長い INSERT 文を作成する
SQL文1つに対して長い複数のデータ(レコード)を作成する。上記の「完全な INSERT 文を作成する」のいずれかを選択します。

・遅延インサートを使用する
インポート時すぐに処理されなくてもその処理を遅らせて次々と行うので結果的には処理速度が速くなると解釈。

・「INSERT IGNORE」を使用する
多くのレコードの INSERT でキーワード IGNORE が指定されていると、テーブルの既存の PRIMARY または UNIQUE キーと重複するレコードはすべて無視され、挿入されません。IGNORE が指定されていない場合に既存のキー値を重複して持つレコードがあると、挿入処理が中断されます。

・バイナリフィールドは 16 進数を使用する
バイナリ(2進数)で表記するより16進数したほうがデータが少なくて済むと解釈。

■エクスポート形式
INSERT:既存のテーブルに新しいレコードを挿入する。
UPDATE:既存のテーブルレコードを新しい値に更新する。
REPLACE:既存のテーブルを置き換える。


このカテゴリの人気記事



  • コメント (0)
  • トラックバック (0)
  • 閲覧 (18925)

トラックバック

トラックバックpingアドレス http://www.suehirogari.com/modules/blog/tb.php/855

コメントの投稿

コメント投稿に関するルール : コメントは全て承認が必要

キーワードでサイト内を検索
人気のエントリ