How can I figure out ORA-00900 invalid SQL statement in datagrip

712 views Asked by At

Normally, using show errors can solve this problem in SQL*PLUS.

However executing show errors in datagrip will show Nothing to run, and executing a procedure which has invalid SQL statement only shows error invalid SQL statement.

So I can't figure out what's wrong with my procedure.

BTW I'm using macOS so configuring Oracle environment in Windows is a little troublesome.

Thanks for helping.

1

There are 1 answers

0
APC On BEST ANSWER

show errors is a SQL*Plus command, not a SQL statement. Even IDEs dedicated to Oracle (e.g. PLSQL Developer) don't recognise it in their SQL Worksheets, so it's not surprising that a generic database IDE hurls. Maybe DataGrip has the option to associate a command line executable for running scripts?

show errors is just a wrapper for a query on the data_dictionary. You can execute this for yourself in any SQL environment:

 select e.line, e.position, e.text 
 from user_errors e
 where e.name = 'YOUR_PROCEDURE'
 order by e.sequence;

The data dictionary view has other attributes you may want to use. Find out more.