INSERT NULL to SQL from 4GL

mfisher

New Member
Progress9.1b
SQL7.0

Hi all -

I am using an ADODB command object to replicate/INSERT records from Progress to SQL. I am looking for the correct syntax to convert the unknown value (?) in Progress to NULL in SQL. Here's a snip of what I'm attempting:

c-cmd:commandtext = "INSERT into item
values
('" + ITEM.ITEM + "',
'" + item.description + "',
IF item.logifld = ? THEN ' + NULL + ' ELSE " + string (item.logifld, "0/1") + " )".

I think it's a syntax issue, where I don't have a quote correct or something. I've experimented with a variety of single/double quotes and functions (like string) but with no success. Anyone out there had to tackle this already?
 
I think the symbol ? should probably be written like so: "?"

Are you trying to replace the fields market with ? in your database so they are just empty i.e " "

If so you can use the assign command as follows

find table1 where record1 = "?"
no-lock no-error.

if avail table1 then do:

Assign table1.record1 = " ".
 
Top