Home > Archive > SQL Server JDBC > July 2005 > sproc calling syntax not orthogonal









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author sproc calling syntax not orthogonal
news.microsoft.com

2005-07-20, 1:23 pm

If I'm using the PreparedStatement API, I can execute a sproc ala:

{CALL MySproc (?, ?, ?)}

However, this syntax does not work with a standard Statement. i.e. this
won't work:

{CALL MySproc (1, 2, 3)}

--
Jordan Zimmerman
Senior Software Architect
SHOP.COM
http://www.shop.com


Joe Weinstein

2005-07-20, 1:23 pm



news.microsoft.com wrote:

> If I'm using the PreparedStatement API, I can execute a sproc ala:
>
> {CALL MySproc (?, ?, ?)}
>
> However, this syntax does not work with a standard Statement. i.e. this
> won't work:
>
> {CALL MySproc (1, 2, 3)}
>


Correct. For a plain statement, the SQL is what the DBMS wants, eg:

stmt.execute("exec myproc 1, 2, 3, 'mystringargument'");

news.microsoft.com

2005-07-21, 3:23 am

"Joe Weinstein" <joeNOSPAM@bea.com> wrote in message
news:42DE925E.3090300@bea.com...
>
>
> Correct. For a plain statement, the SQL is what the DBMS wants, eg:
>
> stmt.execute("exec myproc 1, 2, 3, 'mystringargument'");
>


But, both forms work in SQL Query Analyzer. Also, both forms work with
inet's Opta.


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com