• Welcome, Guest. Please login.
 
August 15, 2020, 10:35:31 am

News:

Welcome to the SQLitening support forums!


Need Help with slBuildInsertOrUpdate

Started by lwe leo, April 21, 2011, 01:43:21 pm

Previous topic - Next topic

lwe leo

April 21, 2011, 01:43:21 pm Last Edit: April 21, 2011, 01:47:49 pm by lwe leo
   slOpen "C:\SQLitening\sample.db3"


    lFld = "MANUF,REDREF,PRODUCT,LANGUAGE,CPU_OS,MEDIA,TYPE,PGROUP,PRICE"

   gcRid = "00100283"
    wStr = "REDREF = " & gcRid
    st = "3 COMM" + $NUL +  "00100283" + $NUL + "Etherlink III Lan + Modem Cable (for 3COMM)" + $NUL + "Test 1" + $NUL + "WIN 7" + $NUL + "SPEAKER" + $NUL + "3 G" + $NUL + "HWARE" + $NUL + "88888.88"

    lsUpdates &= ";" & slBuildInsertOrUpdate("Parts", st, lFld, wStr)


'   ' Do the updates
    slExe lsUpdates & ";End"

Can anyone tell me what went wrong, I cannot add or update the record.  :-[

Thks !

Regards,
Alan

lwe leo

gcRid = "00100283"

if the database start with leading zero as "00100283", may I know what is the syntax to get this record... :(


Thks
Alan

Rolf Brandt

You cannot just use slBuildInserOrUpdate just by itself. You would have to use:

slExe slBuildInsertOrUpdate("Parts", st, lFld, wStr)

Quote from HelpFile:
Returns either an Insert or Update SQL statement which is ready to pass to slExe or slExeBind.
I like to cook with wine - sometimes I even add it to the food.
www.rbsoft.eu

lwe leo

Hi, Rolf.
Thks a lot. Problem solved

if the database start with leading zero as "00100283", may I know what is the syntax to get this record...  :'(

Thks !
Alan

Rolf Brandt

Sqlite treats numeric values with leading zeros as numbern, that mean the leading zeros would be cut. Put them into single quotes like "'00123456'".

That would be " ' 00123456 ' ", but leave the spaces out.
I like to cook with wine - sometimes I even add it to the food.
www.rbsoft.eu

lwe leo

Oh ! my god :'(

It's working........it's almost a month....... :D

Ha.....Ha....Thks for your help ! Rolf

Alan.....

Rolf Brandt

Great Alan,

once you got over the basic hurdles you will love soon it.
I like to cook with wine - sometimes I even add it to the food.
www.rbsoft.eu

lwe leo

Ha...Ha...It's really great, with you I can got it over more easily. ;D

Ya, I love it, it's really an great product, thank you for your assistance and our Mr. Fred as well.

Thank you very much oh! ;)