question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ORA-900 Invalid SQL statement

See original GitHub issue

System information:

  • Windows 10
  • DBeaver version 22.1.0
  • Additional extensions: git integration

Connection specification:

  • Database name and version: oracle 12 19c
  • Driver name: oracle.jdbc.OracleDriver
  • Do you use tunnels or proxies: VPN

Describe the problem you’re observing:

Running a script with a procedure definition, it fails with ORA-900 (invalid SQL statement) for a cursor declaration. The same script runs without problem in SQL Developer.

It is not the same as #8421, as the error is thrown with or without the backslash at the end.

This is my SQL processing configuration (though changing the delimiters settings did not help):

image

Steps to reproduce, if exist:

CREATE OR REPLACE procedure ra_dltm(in_month_year varchar2) as

foo varchar2(3) := 'bar';

cursor foo_loop is select 1 baz from dual;

begin

	for foo in foo_loop
	loop
		insert into ra_dltm_01(id) values (1);
	end loop;
	
    commit;

end;
/

Include any warning/errors/backtraces from the logs

eclipse.buildId=unknown
java.version=11.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Command-line arguments:  -os win32 -ws win32 -arch x86_64

org.jkiss.dbeaver.model
Error
Fri Jun 17 10:05:57 BST 2022
Error : 900, Position : 0, Sql = cursor foo_loop is select 1 baz from dual, OriginalSql = cursor foo_loop is select 1 baz from dual, Error Msg = ORA-00900: invalid SQL statement


Error : 900, Position : 0, Sql = cursor foo_loop is select 1 baz from dual, OriginalSql = cursor foo_loop is select 1 baz from dual, Error Msg = ORA-00900: invalid SQL statement

	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)
	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:213)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:37)
	at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:896)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1119)
	at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1737)
	at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1692)
	at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:300)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:329)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.lambda$0(JDBCStatementImpl.java:131)
	at org.jkiss.dbeaver.utils.SecurityManagerUtils.wrapDriverActions(SecurityManagerUtils.java:94)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:131)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:575)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$1(SQLQueryJob.java:484)
	at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:172)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:491)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.run(SQLQueryJob.java:231)
	at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)


Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rafael-alcantaracommented, Jun 17, 2022

Thanks, Elisabeth, that was quick 😃

Yes, the workaround does work for me. I will remember it.

0reactions
E1izabethcommented, Nov 7, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

ORA-00900: invalid SQL statement tips - Burleson Consulting
Cause: The statement is not recognized as a valid SQL statement. This error can occur if the Procedural Option is not installed and...
Read more >
ORA-00900: invalid SQL statement - TekStream Solutions
Error ORA-00900 occurs when the user tries to execute a statement that is not a valid SQL statement. This error occurs if the...
Read more >
Oracle / PLSQL: ORA-00900 Error Message - TechOnTheNet
Learn the cause and how to resolve the ORA-00900 error message in Oracle. The statement that you've tried to execute is not a...
Read more >
invalid SQL statement- when run a procedure in oracle 10g
I am using Oracle 10g database and trying to run a procedure using SQL commands. create or replace procedure "exam" is begin DBMS_OUTPUT....
Read more >
ORA-900 invalid sql statement error while calling ...
Hi Experts, I am on Oracle 11.2.0.3 on Linux and have Oracle Text installed in my database.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found