sagarswathi / h2database

Automatically exported from code.google.com/p/h2database
0 stars 1 forks source link

Creating an alias for something like an Oracle Package procedure fails #366

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. CREATE SCHEMA TEST_SCHEMA;
2.  CREATE ALIAS TEST_SCHEMA.PACKAGE_NAME.PROCEDURE_IN_PACKAGE for 
"System.out.println"

What is the expected output? What do you see instead?
I'd expect this to work and be able to call my procedure with a string, and 
have it do a System.out.println;

What version of the product are you using? On what operating system, file
system, and virtual machine?
Version 1.3.162, Windows XP

Do you know a workaround?
Not yet, experimenting with the parser.

What is your use case, meaning why do you need this feature?
Trying to emulate Oracle calls

How important/urgent is the problem for you?
VERY - blocking our work.

Please provide any additional information below.
Tried setting quotes around the "PACKAGE_BODY.PROCEDURE".  This allows the 
alias to be created, but then calls to it fail complaining about "Database 
TEST_SCHEMA not found" 

Original issue reported on code.google.com by mcinto...@gmail.com on 14 Dec 2011 at 10:01

GoogleCodeExporter commented 8 years ago
SO one simple start to the fix is on 2767 on Parser.java in the 
readIdentifierWithSchema method is to allow chaining "." in alias names:

        if (equalsToken(".", currentToken)) {
            read(".");
            if (currentTokenType != IDENTIFIER) {
                throw DbException.getSyntaxError(sqlCommand, parseIndex, "identifier");
            }
            s += "." + currentToken;
            read();
        }

Now working on the calls to the alias.

Original comment by mcinto...@gmail.com on 14 Dec 2011 at 10:36

GoogleCodeExporter commented 8 years ago
Such a support for Oracle packages would be fine for us too.

Original comment by SvRe...@gmail.com on 17 Jan 2012 at 8:12

GoogleCodeExporter commented 8 years ago
How does the actual Oracle procedure call look like (the real example)?

Original comment by thomas.t...@gmail.com on 17 Feb 2012 at 1:40

GoogleCodeExporter commented 8 years ago
Has this been implemented?

Original comment by wolfey...@gmail.com on 11 Feb 2013 at 12:02

GoogleCodeExporter commented 8 years ago
I imagine the procedure call would look something like this:

call TEST_SCHEMA.PACKAGE_NAME.PROCEDURE_IN_PACKAGE(?)

Original comment by wolfey...@gmail.com on 11 Feb 2013 at 12:08

GoogleCodeExporter commented 8 years ago
> Has this been implemented?

I suggest to try yourself if it works for you.

Original comment by thomas.t...@gmail.com on 12 Feb 2013 at 5:50