Yes, Bruce is correct.
I've done a little more monkeying around, and I believe this is the behavior
I've seen:
If you have multiple statements in your query, if the first statement returns a
rowset, you will get it and everything will work the way you want it to. I'm
not sure whether the later statements will actually run, as I haven't tested it.
If the first statement does not return a rowset, you get nothing back at all,
even if later statements should return rowsets.
Also, I couldn't get any rowsets that should have been returned by stored
procedures.
So the solution for me has been to send all the statements separately. I didn't
do this before because 1. most stuff today can deal with multiple statements
and multiple rowsets; and 2. I did not expect that each time I sql() to the
database, I'm in the same environment. So that if I create a temporary table
in my first statement, it is still there for any subsequent statements. So I'm
getting the results I need, but there's more back-and-forth between my client
and the database than I expected there to be.
And while I'm here, I really want to thank all the people who have contributed
to Unicon and Icon. I've been using Unicon or Icon for 25 years now, and the
structures really make it easy to do complex things without a lot of work on my
part.
-Keith Handley
-- Original Message --
From: Bruce & Breeanna Rennie
To: unicon-group@lists.sourceforge.net
Subject: Re: [Unicon-group] Getting multiple rowsets from SQL in Windows Unicon?
Date: Fri, 30 Oct 2015 15:05:41 +1100
Good afternoon Don,
I think Keith is saying that he sends down a series/sequence of SQL
statements in one transaction/hit/go and gets back the results from all
statements in one transaction but is needing to access the second and
following result sets. So the connection would have multiple results on it.
regards
Bruce Rennie
On 30/10/15 10:58, Don Ward wrote:
> First off; I’m not an expert in SQL and Unicon at all. But doesn’t
> section "6.5.2 Use multiple connections to nest queries� of the Unicon book
> give you a hint? You didn't say your queries were nested, but you did say
> they were “together�. I’m wondering if you have to use the workaround
> given in 6.5.2 of one query per connection to achieve what you want.
>
> Apologies if I have misunderstood the question.
>
> Regards
>
> Don Ward
>
>> On 29 Oct 2015, at 05:01, kehand...@netzero.net wrote:
>>
>> Hello. First (since it may help somebody else), I discovered that if you
>> want to send multiple SQL statements at once to your server over ODBC, you
>> must set a flag on your ODBC connector (in Windows Control Panel Data
>> Sources) to "Allow multiple statements". That solved the biggest problem I
>> was having.
>>
>> But that made me wonder whether Unicon can deal with multiple result sets.
>> If I do a couple of select statements together, I get the first result set,
>> but I couldn't find anything in the Unicon book or in searching the mailing
>> list archives.
>>
>> So this isn't cramping my style at the time, but it would be great if there
>> were a command to go to the next result set. I'm hoping I just haven't found
>> it.
>>
>> Thanks
>>
>> -Keith Handley
>>
>>
>> What's your flood risk?
>> Knowing your flood risk and being prepared can help keep your family safe
>> and reduce potential damages.
>> http://thirdpartyoffers.netzero.net/TGL3241/5631a882b0bca28826746st03duc
>> --
>> ___
>> Unicon-group mailing list
>> Unicon-group@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/unicon-group
>
> --
> ___
> Unicon-group mailing list
> Unicon-group@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/unicon-group
--
___
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group
All Signs Point to Fun
Adventure awaits. Get going with $20 off.
http://thirdpartyoffers.netzero.net/TGL3241/56331d637d24a1d637688st01duc
--
___
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group