Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UPDATE a text datatype
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00518209
Message ID:
00521424
Views:
15
Thanks for a clear, direct answer. . . .that works!! I didn't know that VFP would allow parameters to pass to SQL as variables. I always thought that the SQLEXEC statement had to be literal. This makes SQL coding much easier.

Bill

>Hi!
>
>For VFP, do following:
>
>nHandle=SQLConnect(...)
>* or use SQLStringConnect("Driver=SQL Server;Serevr=MYSERVER;UID=sa;PWD+Password;Database=MyData;")
>cText="Some very very long text..."
>? SQLEXEC(nHandle,'UPDATE MyTable SET MyTable.TextField = ?cText')
>&& ? reads the VFP variable as a parameter, the parameter could be a text of length up to 2GB
>&& now if SQLEXEC returns -1, use aerror() function to see what error is returned from SQl Server
>
>HTH.
>
>>I have asked this another way in another thread but after doing some reading and testing I can refine my problem.
>>
>>I have a table with a text datatype field. The field presently contains all of the language for a stored procedure run by a VB client to generate a recordset for a report at runtime. I need to modify the language of this field. I cannot do it from the Query Analyzer because you cannot use ntext or text datatype in a Query Analyzer query. I try and run this from VFP with a SQLExec statement (where I retrieved the value of the field that was modified in the first place) and upon trying to update the field I retrieved, I get a -1 returned (meaning that it failed). I try and run it from Access 2000 using the SQLSpecific query screen and I get the same error as the Query Analyzer error. How do you get all of the text into the field programatically once you can get the field to a variable? FYI, the length of the field is 7263 characters, which is under the varchar(8000) limit, if that means anything.
>>
>>Thanks,
>>
>>Bill
CySolutions, Medical Information Technology
You're only as good as your last
success, so . . .If it works. . .don't fix it!
Previous
Reply
Map
View

Click here to load this message in the networking platform