You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Miller, Grant" <Gr...@COGNOS.com> on 2002/02/20 16:45:47 UTC

Calling MS SQL stored procedure

Hi,
I'm having a problem calling an ms sql server stored procedure with the sql
transformer (using cocoon 2.0.1 and tomcat 4).
The code is:

<sql:execute-query>
   <sql:query isstoredprocedure="true" name="testformike">
      begin dbo.testformike('hi');
      end;
   </sql:query>
</sql:execute-query>

The error message is:

Invalid call syntax: begin dbo.testformike('hi'); end;

I always get this with isstoredprocedure="true". 
Also, I'm not sure what the qualifier before the function name should be
(dbo is the owner in this example).
Another thing we have tried is:

This query:
	<sql:execute-query>
         	<sql:query>
         	  exec DBO.TESTFORMIKE 'hi'
         	</sql:query>
        </sql:execute-query>

but this gives:

A server cursor is not allowed on a remote stored procedure or stored
procedure with more than one SELECT statement. Use a default result set or
client cursor

We are completely stuck and do not want to use esql.
Thanks for any help,

Grant Miller


This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Calling MS SQL stored procedure

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 20.Feb.2002 -- 10:45 AM, Miller, Grant wrote:
> Hi,
> I'm having a problem calling an ms sql server stored procedure with the sql
> transformer (using cocoon 2.0.1 and tomcat 4).
> The code is:
> 
> <sql:execute-query>
>    <sql:query isstoredprocedure="true" name="testformike">
>       begin dbo.testformike('hi');
>       end;
>    </sql:query>
> </sql:execute-query>
> 
> The error message is:
> 
> Invalid call syntax: begin dbo.testformike('hi'); end;

Never used any of the above, but you might want to consider the JDBC
escape syntax

   {?= call <procedure-name>[<arg1>,<arg2>, ...]}
   {call <procedure-name>[<arg1>,<arg2>, ...]}

Maybe that'll make your driver happier....

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>