Re: Running a procedural query ?

Brian Sorg <[email protected]> Fri, 8 Mar 2013 13:22:47 -0500
Newsgroups gmane.lisp.clsql.general
Message-ID <CAC29X8fF3y5LxZFYaS0tKeYk5T_D+aXy+OGETP75OE1==9ok7A@mail.gmail.com>
Ryan -

Thank you!! The adding the "SET NOCOUNT ON" to the top of the script
worked. Once that was added the rest of the script ran and clsql returned
the query result as hoped.

I did some experimenting and it looks as if the query can contain any
number of statements, they all appear to run as expected, it is just that
the query function only returns the results of the first statement that
returns an answer.

Once the nocount on was added the update and insert statements were silent
and only the final select statement was returned.

Thanks again.



On Thu, Mar 7, 2013 at 11:42 AM, Ryan Davis <[email protected]> wrote:

>  Other ideas:
>
> Try "SET NOCOUNT ON" at the top of your script, sometimes that results in
> funky stuff in the ODBC protocol, where SQL returns the rowcounts of your
> inserts/updates as many recordsets. (ie "1 rows affected")
>
> Try using "SET" instead of "SELECT" to set variables in your t-sql (ie
> "SET @result = -1" instead of "SELECT @result = -1")
>
> On 03/06/2013 02:47 PM, Russ Tyndall wrote:
>
> The issue is that CLSQL currently only supports getting the first result
> set (of the first statement).  I'm not sure whether this is an issue with
> the ODBC layer or all the layers (probably all of them though).  While
> problematic, this can usually be worked around by declaring and calling a
> stored procedure instead.
>
> On first glance it seems like you're only intending to return one result,
> so you should be able to get around the "one resultset" limitation.
>
> HTH,
> Ryan
>



-- 
Brian Sorg
Director and Founder Liberating Insight LLC
[email protected]
Office: 260.918.0490
Mobile: 260.602.1086
www.liberatinginsight.com

_______________________________________________
CLSQL mailing list
[email protected]
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql