Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inserting long string into ORACLE
Message
 
 
To
08/06/2001 03:54:49
Gunawan Santoso
Pt. Japfa Comfeed Indonesia
Surabaya, Indonesia
General information
Forum:
Oracle
Category:
Other
Miscellaneous
Thread ID:
00516757
Message ID:
00517105
Views:
18
>From previous discussion on profox list, I got the idea that SPT (via sqlexec()) won't work against very long SQL statement. So, I have to use remote views for that. Before using LONG, I've tried to use varchar2(4000), but it can save only max 2000 chars (+/-). Above 2000 chars, the VFP returns error ('Invalid precission', I think...)
>
>Then I turned into LONG. But from manual, I understand that CLOB should be the one I've to choose. I can append a long chars into the remote views without error, but in reality only part of strings (approx 70 chars or so) that can be saved into ORACLE. I have no idea why only small part of the string that is written into the ORACLE. I don't know which part of the system (VFP, ODBC, ORACLE) that makes the trouble. Any idea?
>
>Regards,

You can use very long SQL statements. There is a MS KB article that says you there is a problem with SQLExec but it doesn't quite describe the issue very well (IMO).

We generate long SQL statement all the time and execute them with SPT with no issues. The following is a simple example:
lnconn = sqlstringconnect('Driver=Oracle ODBC Driver;Server=MyServer.MyDomain;UID=UserID;PWD=password')
lcsql = [insert into test (field1,field2) values ('] + replicate('ABCDE',700)+[',99)]
? len(lcsql) && returns 3547
? sqlexec(lnconn,lcsql) && returns 1
The bug with SQLExec is with the actual command line itself. If you use the actual SQL statement without first assigning it to a variable, then the command itself can not exceed 256 characters. However, if you use a variable or property of an object variable, you can build an incredibly long string and it will work.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform