multi line Livecode field uploaded to MySQL

Ludovic THEBAULT ludovic.thebault at laposte.net
Sat Feb 16 04:17:05 EST 2019


> Le 16 févr. 2019 à 09:17, Tim Selander via use-livecode <use-livecode at lists.runrev.com> a écrit :
> 
> Thank you for your reply, but I haven't gotten it working yet.
> 
> The code in my first post was from my working stack. Here is what I have from my non-working stack after re-writing to follow your instructions:
> ------------
> # Construct SQL
> put "INSERT INTO contactInfo(key,organization,denomination,address,category,tel,fax,tEmail,access,founded,staff,servicetime,web,character)" & \
> " VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)" into tSQL
> # Execute SQL
> revExecuteSQL(gconnection,tSQL,vkey,vorg,vdenom,vadd,vcategory,vtel,vfax,vtEmail,vaccess,vfounded,vstaff,vtime,vweb,vcat) 
> put the result into tTmp
> ------------
> 
> The table name is "contactInfo" and the list of the table's fields is in the paranthesis.
> 
> The VALUES(:1,:2....  syntax is something I haven't seen before. I assume that you need as many numbers as you have fields?
> 
> You say to use variables, and I am assuming in the "revExecuteSQL" line. Is that correct? I tried the list of variables both with the quotes you used, and without just to see. I also tried replacing the revExecuteSQL comman with revdb_execute. Both result in this error: {execution error at line n/a (External handler execution error: revdberr,syntax error) near "revdberr,syntax error"}
> 
> I appreciate your taking the time to educate me.
> 
> Tim Selander
> 


Here an example :

put fld "name" into tName

put the label of btn "title" into tTitle
put fld "first_name" into fFirst_Name

put fld "address" into tAddress

put fld "citycode" into tCitycode

put fld "tCity" into tCity

put fld "tPhone" into tPhone

put fld "tEmail" into tEmail

put "INSERT INTO address ( tAddress, tCitycode, tEmail, tName, fFirst_Name, tPhone, tTitle, tCity) VALUES ( :1, :2, :3, :4, :5, :6, :7, :8 );" into tSQL
revExecuteSQL tDatabaseID, tSQL, "tAddress", "tCitycode", "tEmail", "tName", "fFirst_Name", "tPhone", "tTitle", "tCity"

//The quote are necessary in last line


More information about the Use-livecode mailing list