Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to execute statement with duplicate parameters?

610683May 7 2013 — edited Oct 15 2014
Hello.

Is it possible to execute PL\SQL with contains two or more duplicate name parameters?

Example: begin select *:v* ,*:v* into :v1, :v2 from dual; end;

I tried to execute it using follow code:

String plsql = "begin select :v ,:v into :v1, :v2 from dual; end;";
OracleCallableStatement callableStatement = (OracleCallableStatement) connection_.prepareCall(plsql);
callableStatement.setInt(1, 1);
callableStatement.setInt(2, 2);
callableStatement.registerOutParameter(3, Types.INTEGER);
callableStatement.registerOutParameter(4, Types.INTEGER);
callableStatement.execute();

result of executing it, is error: java.sql.SQLException: ORA-01036: illegal variable name/number

If I register parameters by name:

String plsql = "begin select :v ,:v into :v1, :v2 from dual; end;";
OracleCallableStatement callableStatement = (OracleCallableStatement) connection_.prepareCall(plsql);
callableStatement.setIntAtName("v1", 0);
callableStatement.setIntAtName("v", 1);
callableStatement.setIntAtName("v2", 0);
callableStatement.execute();

, i have same error: java.sql.SQLException: ORA-01036: illegal variable name/number

I'm porting Delphi application to Java, and can not change PL\SQL code. In Delphi this pl\sql execute successfully.
This post has been answered by jschellSomeoneStoleMyAlias on May 8 2013
Jump to Answer

Comments

Philip Stoyanov-Oracle

Glosary editor can export in CSV (text) or XLS(Excel) format. And it can import text format(CSV/TXT that for ERwin) , Data Modeler format (if you want to import another glossary - probably edited) and Excel format. Tested with export/import of Excel format and it works for me. In excel format you only can modify existing fields, cannot add new terms into glossary.

Philip

jnicholas330

I do not see the XLS option. However, if DM is unable to read in new entries, it would not serve my needs.

pastedImage_0.png

Philip Stoyanov-Oracle

Sorry, I was looking DM 4.2

Philip

DM 4.1.5 is out and now export to CSV is bound to content in DM glossary (all elements of word definition are exported) and you can change it or add new elements and import it later.

In DM 4.2 that can be done also with Excel format (you need to have some existing entries in the excel file )

Philip

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 5 2013
Added on May 7 2013
8 comments
1,004 views