Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXEC()
Message
From
14/12/1998 21:55:49
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00167141
Message ID:
00167510
Views:
18
Here's a way to get past it I just found out today
The spacing before the ] and after the [ is critical.

CommandVariable=[SELECT tablename1.field1, tablename1.field2,tablename2.field3 ]
+[FROM tablename JOIN ON tablename.field1=tablename2.field3 ]
+[WHERE tablename.field1 > 12300]

SQLEXEC(gnconnect,CommandVariable,'cursorname')

You have to be careful where you break and the spacing but I got over 256 characters


>Not quite, I haven't really started on my last thought, but here is what I am anticipating.
>
>Create a bogus database container ex: SQLPT.DBC (Sql Pass-through).
>Then I would have a function that accepted as a parameter a SQL string to try and SQLPREPARE() and SQLEXEC(). If the length of the sql-string is longer than the 255, then I would create a bogus remote view to the back-end and then issue a direct USE SQLPT!newview which will in-effect execute the longer view on the back-end... There are some other properties you may have to set for the remote view such as data source, ID, password, etc... Again, I haven't really started on this approach yet, but if the view can be extremely long and complex within the VFP remote view designer, just build it on the fly and use it.
>
>
>>So the only option is to do multiple SQLEXEC() to cursors then
>>combine the cursor in an SQLEXEC() statement.
>>I tried using this type of construct but it errored out as a syntax error.
>>
>>lcSQLCmd=[SELECT ....] total of 256 characters
>>
>>SQLEXEC(lnconnect,lcSQLCmd,'wips')
>>
>>I never got to the SQLEXEC()
>>the lcSQLCmd=[SELECT ] caused the syntax error when over 255 characters
>>
>>
>>>Yes, the pass-through method only allows upto 255 chars...
>>>I have been working on a possible solution but have been coming up blank. My latest solution is to try doing a create view as ... in a local VFP .dbc if the limit is over the 255 length. Then use the view... Apparently that will allow for longer view and VFP will handle it in some other fashion which I am not quite sure of yet...
>>>
>>>
>>>>Is there a limit to the character string that can be used in SQLEXEC()?
>>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform