Re: qualified procedure name required?
Posted by: Mark Matthews
Date: June 29, 2005 04:02PM

Kevin Williams wrote:
> I am calling a no-argument procedure via
> connector/j and get an error
> (java.sql.SQLException: PROCEDURE GETALLCOMPANIES
> does not exist) if I do not qualify the procedure
> name with the schema as in "test.GETALLCOMPANIES".
> The examles I have seen do not use the qualified
> name and I would prefer this since it makes my
> procedure definitions more portable.
>
> Here is how I want to call the proc:
>
> "{call GETALLCOMPANIES()}"
>
> This is what I use to get it to work:
>
> "{call test.GETALLCOMPANIES()}"
>
> Also, for a no argument procedure, I think that I
> should be able to use this:
>
> "{call GETALLCOMPANIES}"
>
> At least, it works with DB2.
>
>
>
>
> Here is the script MySQL query browser built for
> me:
>
> DELIMITER $$
>
> DROP PROCEDURE IF EXISTS
> `dastest`.`GETALLCOMPANIES`\\
> CREATE PROCEDURE `dastest`.`GETALLCOMPANIES` ()
> BEGIN
> SELECT * FROM COMPANY
> END$$
>
> DELIMITER ;
>
> This query I actually executed from the query
> browser to create the procedure:
>
> CREATE PROCEDURE `dastest`.`GETALLCOMPANIES` ()
> SELECT * FROM COMPANY


What is the current database when you try and call the procedure? You can only get away with not specifying the database if the procedure exists in the current one.

As far as supporting no parens for an empty parameter list, it's not standard SQL, so we don't support it (from the SQL standard, notice that the argument list is required, and parens are required, irregardless if zero parameters are present):

<routine invocation> ::= <routine name> <SQL argument list>

<routine name> ::= [ <schema name> <period> ] <qualified identifier>

<SQL argument list> ::=
<left paren> [ <SQL argument> [ { <comma> <SQL argument> }... ] ] <right paren>

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject
Written By
Posted
Re: qualified procedure name required?
June 29, 2005 04:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.