Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass-through character limits?
Message
From
07/12/1998 13:38:27
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00164772
Message ID:
00164865
Views:
19
Don ----

Hmmmm.....I think that the 255 char limit probably also applies to an SQLEXEC with a CREATE PROCEDURE command. I think that what you are going to want to do is create (from SQL Server) some flexible sp's with lots of parameters and call then from VFP with those parameters.


>
>I know if you pre-write a stored procedure, you can call it with SQLEXEC(), but I am talking about creating a stored procedure from the front-end program that may require some dynamic changes in what the final SQL statement may have. Ex: different data sort, going against different sub-queries, etc.
>
>Lets assume I have a select statement that has 15 fields from table A and another 10 fields from table B, and the resulting SQL statement would be to
>large to send as a normal SQL-SELECT call...
>
>select a.field1, a.field2,..., a.field15, b.field1, b.field2, ..., b.field10
> from mytable1 a, mytable2 b
> where a.keyid1 = b.keyid1
> order by 1, 5, 12
>
>Since this would exceed the 255 limit, how could I create the back-end procedure
>
>CREATE PROCEDUR BOGUS1 AS
> (select statment...)
>
>
>Then I could use the SQLEXEC( lnHandle, 'BOGUS1', mycursor )
>
>Then delete the stored procedure when I am done.
>
>
>
>
>>Hi Don ---
>>
>>>If the limit is 255, would it then be possible to create a stored procedure on the back-end via odbc and pass a series of strings to build the procedure and then execute it for the proper results?
>>
>>Yes. You can then run the stored procedure with SQLEXEC() and return a result cursor from the same: Here's an example:
>>
>>cState="FL"
>>=SQLEXEC(nConnectionHandle,'sp_getstates "'+cState+'"',mycursor)
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform