\SQL_InsertOrUpdate

SQL_InsertOrUpdate

SQLヘルパの INSERT ON DUPLICATE KEY UPDATE メソッド群です。
メソッドの外で,条件対象のテーブルが選択されている必要があります

Summary

Methods
Properties
Constants
addInsert()
setInsert()
setTable()
get()
__construct()
isClass()
newSeq()
optimizeSeq()
nextval()
currval()
setval()
newField()
newFunction()
newGeometry()
newOpr()
newOprIn()
newOprNotIn()
newOprExists()
newOprNotExists()
newOprBw()
newCase()
newWhere()
newSelect()
newInsert()
newReplace()
newUpdate()
newInsertOrUpdate()
newDelete()
delete()
addUpdate()
setUpdate()
$_insert
$_table
$_update
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$_insert

$_insert : 

Type

$_table

$_table : 

Type

$_update

$_update : 

Type

Methods

addInsert()

addInsert(string  $fd, string|integer  $val) : boolean

指定されたfieldにINSERT句を生成する。<br> $SQL->addInsert('entry_code', 'abc');<br> INSERT INTO acms_entry (entry_code) VALUES ('abc')

Parameters

string $fd
string|integer $val

Returns

boolean

setInsert()

setInsert(  $fd = null,   $val = null) 

Parameters

$fd
$val

setTable()

setTable(  $tb) 

Parameters

$tb

get()

get(  $dsn = null) 

Parameters

$dsn

__construct()

__construct(  $SQL = null) 

Parameters

$SQL

isClass()

isClass(  $obj,   $className) 

Parameters

$obj
$className

newSeq()

newSeq(  $seq,   $method = 'nextval',   $val = null) 

Parameters

$seq
$method
$val

optimizeSeq()

optimizeSeq(string  $seq, null  $dsn = null, boolean  $plugin = false) : integer

指定されたsequence fieldのシーケンス番号を最適化する<br> SQL::optimizeSeq('entry_id', dsn())<br> UPDATE acms_sequence SET sequence_entry_id = ( LAST_INSERT_ID(sequence_entry_id + 1) )

Parameters

string $seq
null $dsn
boolean $plugin

Returns

integer

nextval()

nextval(string  $seq, null  $dsn = null,   $plugin = false) : integer

指定されたsequence fieldのシーケンス番号を1進めてその値を返す<br> SQL::nextval('entry_id', dsn())<br> UPDATE acms_sequence SET sequence_entry_id = ( LAST_INSERT_ID(sequence_entry_id + 1) )

Parameters

string $seq
null $dsn
$plugin

Returns

integer

currval()

currval(string  $seq, null  $dsn = null,   $plugin = false) : integer

指定されたsequence fieldの現在のシーケンス番号を返す<br> SQL::currval('entry_id', dsn())<br> SELECT sequence_entry_id FROM acms_sequence

Parameters

string $seq
null $dsn
$plugin

Returns

integer

setval()

setval(string  $seq,   $val, null  $dsn = null,   $plugin = false) : integer

指定されたsequence fieldを指定された値にセットする<br> SQL::setval('entry_id', 10, dsn())<br> UPDATE acms_sequence SET sequence_entry_id = 10

Parameters

string $seq
$val
null $dsn
$plugin

Returns

integer

newField()

newField(  $fd,   $scp = null) 

Parameters

$fd
$scp

newFunction()

newFunction(  $fd,   $func = null,   $scp = null) 

Parameters

$fd
$func
$scp

newGeometry()

newGeometry(  $lat,   $lng,   $scp = null) 

Parameters

$lat
$lng
$scp

newOpr()

newOpr(  $fd,   $val = null,   $opr = '=',   $scp = null,   $func = null) 

Parameters

$fd
$val
$opr
$scp
$func

newOprIn()

newOprIn(  $fd,   $val,   $scp = null,   $func = null) 

Parameters

$fd
$val
$scp
$func

newOprNotIn()

newOprNotIn(  $fd,   $val,   $scp = null,   $func = null) 

Parameters

$fd
$val
$scp
$func

newOprExists()

newOprExists(  $val,   $scp = null) 

Parameters

$val
$scp

newOprNotExists()

newOprNotExists(  $val,   $scp = null) 

Parameters

$val
$scp

newOprBw()

newOprBw(  $fd,   $a,   $b,   $scp = null,   $func = null) 

Parameters

$fd
$a
$b
$scp
$func

newCase()

newCase(  $simple = null) 

Parameters

$simple

newWhere()

newWhere() 

newSelect()

newSelect(string|null  $tb = null, string|null  $als = null,   $straight_join = false) : \SQL_Select

TABLEを指定してSELECT句を生成する為のSQL_Selectを返す

Parameters

string|null $tb
string|null $als
$straight_join

Returns

\SQL_Select

newInsert()

newInsert(string|null  $tb = null) : \SQL_Insert

TABLEを指定してINSERT句を生成する為のSQL_Insertを返す

Parameters

string|null $tb

Returns

\SQL_Insert

newReplace()

newReplace(string|null  $tb = null) : \SQL_Replace

TABLEを指定してREPLACE句を生成する為のSQL_Replaceを返す

Parameters

string|null $tb

Returns

\SQL_Replace

newUpdate()

newUpdate(string|null  $tb = null) : \SQL_Update

TABLEを指定してUPDATE句を生成する為のSQL_Updateを返す

Parameters

string|null $tb

Returns

\SQL_Update

newInsertOrUpdate()

newInsertOrUpdate(string|null  $tb = null, string|null  $als = null) : \SQL_Select

TABLEを指定してINSERT ON DUPLICATE KEY UPDATE句を生成する為のSQL_InsertOrUpdateを返す

Parameters

string|null $tb
string|null $als

Returns

\SQL_Select

newDelete()

newDelete(string|null  $tb = null) : \SQL_Delete

TABLEを指定してDELETE句を生成する為のSQL_Deleteを返す

Parameters

string|null $tb

Returns

\SQL_Delete

delete()

delete(  $tb,   $w = null,   $dsn = null) 

Parameters

$tb
$w
$dsn

addUpdate()

addUpdate(string  $fd, string|integer  $val) : boolean

指定されたfieldにON DUPLICATE KEY UPDATE句を生成する。<br> $SQL->addUpdate('entry_code', 'abc');<br>

... ON DUPLICATE KEY UPDATE entry_code = 'abc'

Parameters

string $fd
string|integer $val

Returns

boolean

setUpdate()

setUpdate(  $fd = null,   $val = null) 

Parameters

$fd
$val