>Hi,
>
>If I want to insert a general field (in SPT) to an image field in SQL Serve, I can issue:
>
>SQLEXEC(lnConnect, [Insert into mytable (ImageField) values (?MyCursor.GeneralField)])
>
>Question - what is the "?" doing exactly here? Is there a function equivelant of it if I wanted to concatenate the SQL String myself?
>
>TIA,
It's telling it's a parametric call pointing to MYcursor.GeneralField content.
I don't understand what exactly you mean by equivalant function. If you mean how you would send the binary content to SQL server you'd need to convert it to an hex representation (doubling the size). ie:
If your binary content had '{ABC}...' the string you'd pass to SQL server would be like :
0x7B4142437D...
You could also send content directly and use SQL server methods to write. ie:
lnResult=SQLExec(lnHandle,;
[EXEC sp_dboption 'databasename', 'select into/bulkcopy', 'true';]+;
[DECLARE @ptrval binary(16);]+;
[SELECT @ptrval = TEXTPTR(imagefield) ]+;
[FROM tablename ]+;
[WHERE pkfield = pkvalue;]+;
[WRITETEXT tablename.imagefield @ptrval ?lcContent ;]+;
[EXEC sp_dboption 'databasename', 'select into/bulkcopy', 'false'])
Cetin