Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equivelant of ? in general field insert
Message
From
26/12/2002 13:48:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/12/2002 11:46:09
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00735861
Message ID:
00735904
Views:
15
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform