From: Roger Lawton on
I am trying to create a parameterized update statement where I inserting a
record into a table. For example:

....
cStmt += "INSERT ELDATA (ELEQID,ELREFDESID,ELCOMMENTS,ELDATE) VALUES (
?,?,?,?)"
aParms := {}

Aadd( aParms, SELF:RefDes_Source:Fieldget( #REFID ) )
Aadd( aParms, SELF:EQData_Source:Fieldget( #EQID ) )
Aadd( aParms, SELF:EQData_Source:Fieldget( #EQID ) )
AAdd( aParms, SELF:RefDes_Source:FIELDGET( #REFID ))

oCmd:CommandText := cStmt
oCmd:ActiveConnection := oConn
oCmd:Execute(@liRecs, aParms, adCmdText)
....

I need to send NULL as one of the parameters. For example the expanded
statement would read like:

INSERT ELDATA (ELEQID,ELREFDESID,ELCOMMENTS,ELDATE) VALUES (
'01','02',NULL,'03')


I am having trouble figuring out what to put into the array so that NULL
will be inserted in the parameter.

TIA

--
Roger Lawton
Product Manager
SOMAX, Inc.

From: Geoff Schaller on
Roger,

You have two ways out. First, try sending a parameter that is NIL by
value. The Vo2Ado OLE interface may just translate this correctly.
Secondly, it is dynamic SQL so what you could do is pass (?,?,NULL,?)
and then only send three parameters.

Geoff



"Roger Lawton" <nsproger(a)nspsomax.com> wrote in message
news:he6823$rm7$1(a)aioe.org:

> I am trying to create a parameterized update statement where I inserting a
> record into a table. For example:
>
> ...
> cStmt += "INSERT ELDATA (ELEQID,ELREFDESID,ELCOMMENTS,ELDATE) VALUES (
> ?,?,?,?)"
> aParms := {}
>
> Aadd( aParms, SELF:RefDes_Source:Fieldget( #REFID ) )
> Aadd( aParms, SELF:EQData_Source:Fieldget( #EQID ) )
> Aadd( aParms, SELF:EQData_Source:Fieldget( #EQID ) )
> AAdd( aParms, SELF:RefDes_Source:FIELDGET( #REFID ))
>
> oCmd:CommandText := cStmt
> oCmd:ActiveConnection := oConn
> oCmd:Execute(@liRecs, aParms, adCmdText)
> ...
>
> I need to send NULL as one of the parameters. For example the expanded
> statement would read like:
>
> INSERT ELDATA (ELEQID,ELREFDESID,ELCOMMENTS,ELDATE) VALUES (
> '01','02',NULL,'03')
>
>
> I am having trouble figuring out what to put into the array so that NULL
> will be inserted in the parameter.
>
> TIA
>
> --
> Roger Lawton
> Product Manager
> SOMAX, Inc.

 | 
Pages: 1
Prev: get last record of group
Next: E-bay Listings API