FAQ
Hi all,

I'm trying to get the results of the printed text displayed by a
stored procedure in SQL Server using the "PRINT" function. The stored
procedure do not have any OUT parameters... If I use a ProcedureQuery
like this :

ProcedureQuery query = new ProcedureQuery("StoreProc");
QueryResponse result = context.performGenericQuery(query);

the QueryResponse is empty. Is there a way to get the output with
Cayenne (3.0) ?

Thanks.

Laurent Marchal.

Search Discussions

  • Andrus Adamchik at Jan 31, 2010 at 2:54 pm
    Unfortunately no idea. SQLServer docs are somewhat cryptic about the
    PRINT function (does it actually print something to the console, or
    does it return a value to the user?). Maybe something to ask on a
    SQLServer forum, formulating it as a JDBC question (how do I get a
    value of PRINT function via JDBC)...

    Andrus
    On Jan 30, 2010, at 12:55 AM, Laurent Marchal wrote:

    Hi all,

    I'm trying to get the results of the printed text displayed by a
    stored procedure in SQL Server using the "PRINT" function. The
    stored procedure do not have any OUT parameters... If I use a
    ProcedureQuery like this :

    ProcedureQuery query = new ProcedureQuery("StoreProc");
    QueryResponse result = context.performGenericQuery(query);

    the QueryResponse is empty. Is there a way to get the output with
    Cayenne (3.0) ?

    Thanks.

    Laurent Marchal.
  • Laurent Marchal at Feb 1, 2010 at 2:54 pm
    Hi,

    Yeah it print something in the visual SQL managment studio and I'm
    pretty sure you can get this output using other programming languages.
    I'll try to find answers regarding the JDBC side, and post what I found
    here.

    Thank you.
    Laurent.

    Le 31/01/2010 08:53, Andrus Adamchik a écrit :
    Unfortunately no idea. SQLServer docs are somewhat cryptic about the
    PRINT function (does it actually print something to the console, or
    does it return a value to the user?). Maybe something to ask on a
    SQLServer forum, formulating it as a JDBC question (how do I get a
    value of PRINT function via JDBC)...

    Andrus
    On Jan 30, 2010, at 12:55 AM, Laurent Marchal wrote:

    Hi all,

    I'm trying to get the results of the printed text displayed by a
    stored procedure in SQL Server using the "PRINT" function. The stored
    procedure do not have any OUT parameters... If I use a ProcedureQuery
    like this :

    ProcedureQuery query = new ProcedureQuery("StoreProc");
    QueryResponse result = context.performGenericQuery(query);

    the QueryResponse is empty. Is there a way to get the output with
    Cayenne (3.0) ?

    Thanks.

    Laurent Marchal.
  • Laurent Marchal at Feb 4, 2010 at 5:14 pm
    Unfortunately I did not find any ways to get PRINTed output from SQL
    server with JDBC.
    The only way seem to return the text as OUT variable.

    Cheers.
    Laurent.

    Le 31/01/2010 08:53, Andrus Adamchik a écrit :
    Unfortunately no idea. SQLServer docs are somewhat cryptic about the
    PRINT function (does it actually print something to the console, or
    does it return a value to the user?). Maybe something to ask on a
    SQLServer forum, formulating it as a JDBC question (how do I get a
    value of PRINT function via JDBC)...

    Andrus
    On Jan 30, 2010, at 12:55 AM, Laurent Marchal wrote:

    Hi all,

    I'm trying to get the results of the printed text displayed by a
    stored procedure in SQL Server using the "PRINT" function. The stored
    procedure do not have any OUT parameters... If I use a ProcedureQuery
    like this :

    ProcedureQuery query = new ProcedureQuery("StoreProc");
    QueryResponse result = context.performGenericQuery(query);

    the QueryResponse is empty. Is there a way to get the output with
    Cayenne (3.0) ?

    Thanks.

    Laurent Marchal.
  • Evgeny Ryabitskiy at Feb 4, 2010 at 8:27 pm
    You could replace PRINT with SELECT, so it will be in ResultSet and
    will be returned in DataRow.
    It could be little bit easy then create output parameter, declare
    variable before exec and do select after in case you are using simple
    RowQuery.
    But it will work only for first SELECT. If you put multiple selects in
    Stored Procedure, Cayenne took first one and drop others....

    Evgeny.


    2010/2/4 Laurent Marchal <lmarchal@smausa.com>:
    Unfortunately I did not find any ways to get PRINTed output from SQL server
    with JDBC.
    The only way seem to return the text as OUT variable.

    Cheers.
    Laurent.

    Le 31/01/2010 08:53, Andrus Adamchik a écrit :
    Unfortunately no idea. SQLServer docs are somewhat cryptic about the PRINT
    function (does it actually print something to the console, or does it return
    a value to the user?). Maybe something to ask on a SQLServer forum,
    formulating it as a JDBC question (how do I get a value of PRINT function
    via JDBC)...

    Andrus
    On Jan 30, 2010, at 12:55 AM, Laurent Marchal wrote:

    Hi all,

    I'm trying to get the results of the printed text displayed by a stored
    procedure in SQL Server using the "PRINT" function. The stored procedure do
    not have any OUT parameters... If I use a ProcedureQuery like this :

    ProcedureQuery query = new ProcedureQuery("StoreProc");
    QueryResponse result = context.performGenericQuery(query);

    the QueryResponse is empty. Is there a way to get the output with Cayenne
    (3.0) ?

    Thanks.

    Laurent Marchal.
  • Laurent Marchal at Feb 4, 2010 at 8:30 pm
    Yeah that's a good idea ! I'll note that :)
    Thanks

    Laurent.

    Le 04/02/2010 14:27, Evgeny Ryabitskiy a écrit :
    You could replace PRINT with SELECT, so it will be in ResultSet and
    will be returned in DataRow.
    It could be little bit easy then create output parameter, declare
    variable before exec and do select after in case you are using simple
    RowQuery.
    But it will work only for first SELECT. If you put multiple selects in
    Stored Procedure, Cayenne took first one and drop others....

    Evgeny.


    2010/2/4 Laurent Marchal<lmarchal@smausa.com>:
    Unfortunately I did not find any ways to get PRINTed output from SQL server
    with JDBC.
    The only way seem to return the text as OUT variable.

    Cheers.
    Laurent.

    Le 31/01/2010 08:53, Andrus Adamchik a écrit :
    Unfortunately no idea. SQLServer docs are somewhat cryptic about the PRINT
    function (does it actually print something to the console, or does it return
    a value to the user?). Maybe something to ask on a SQLServer forum,
    formulating it as a JDBC question (how do I get a value of PRINT function
    via JDBC)...

    Andrus

    On Jan 30, 2010, at 12:55 AM, Laurent Marchal wrote:

    Hi all,

    I'm trying to get the results of the printed text displayed by a stored
    procedure in SQL Server using the "PRINT" function. The stored procedure do
    not have any OUT parameters... If I use a ProcedureQuery like this :

    ProcedureQuery query = new ProcedureQuery("StoreProc");
    QueryResponse result = context.performGenericQuery(query);

    the QueryResponse is empty. Is there a way to get the output with Cayenne
    (3.0) ?

    Thanks.

    Laurent Marchal.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedJan 29, '10 at 10:56p
activeFeb 4, '10 at 8:30p
posts6
users3
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase