SQLCreateUpdateStatement |
home |
Syntax:
=sqlxl.xla!SQLCreateDeleteStatment(TableName, ColumnNames,
ColumnValues, PKColumns,
PKValues [, DatabaseType] )
TableName (Datatype String): Name of the
table
ColumnNames (Datatype Range): Address of the cells that contain the
column names
ColumnValues (Datatype Range): Address of the cells that contain the column values.
PKColumns (Datatype Range): Address of
the cells that contain the primary key column names.
PKValues (Datatype Range): Address of
the cells that contain the primary key data.
DatabaseType (Datatype String):
Optional ; Database type so the SQL insert statement can use specific database
syntax. Possible values: Oracle, SQL Server, MySQL, ODBC, Access
Description:
The SQLCreateUpdateStatement function creates a SQL delete statement based on
the supplied parameters. The syntax for an insert statement is: update
TableName set col1=val1,
col2=val2 where pk1=value1 and pk2=value2 .
Example:
update emp set sal=100, ename='JONES' where empno =
123;
SQL*XL can take your database type into account. E.g. for a MySQL database a date literal will be typed as e.g. '2006-01-23 11:23:01' whereas an Oracle date will be typed as: to_date('23-01-2006 11:23:01','dd-mm-yyyy hh24:nn:ss')
Please ensure that the values in the Excel cell are properly formatted. A number formatted in Excel as a Text will be taken as a string value. E.g. the number 1 formatted as text will be created in the statement as '1'.
Examples:
A1: =
sqlxl.xla!SQLCreateUpdateStatement( "emp", A1, A2,
B1, B2 )
A1: =sqlxl.xla!SQLCreateDeleteStatement( D12, A1:B1, A2:B2, C1:E1, C2:E2, "sql server")
A1: =sqlxl.xla!SQLCreateDeleteStatement( "mytable", A1:D1, A2:D2, C1, C2, "odbc")
See also: