SQL in proc not working

Im trying to run a procedure but when I try to compile it gives me an error. Here is the SQL statement it seems to have a problem with. I am doing alot more than just this statement but it highlights this one on compile. It also creates the procedure? When I try to compile it has a red line through it and it says
" ORA-00900: invalid SQL statement
(48: 0): INNER
Error at line 1
ORA-00900: invalid SQL statement

are you using an old version of Oracle? like 8i or lower? Older versions don't support ANSI join syntax.

Your syntax looks valid to me provided all of the variables are valid and columns and tables names are correct. You might want to consider prefixing all of the column references with the table aliases to make sure your references are correct.

This may not be the problem, but you have to be careful with "select ...into" syntax in PL\SQL. Implicit cursors like this may be easy to write and understand, but your join criteria then need to be tight enough (and your data needs to be clean enough!) to insure that you get exactly one row returned. Otherwise, this may compile fine, but give a run-time error of either: "no data found" or "too_many_rows".

F9 seems to run just fine for both scenarios sd? I realize this is hard for you to helpo. Would you like the entire proc. Its very l;arge. It calls 40 procs and queries but if youd llike to see it let me know..

there are no syntax errors in the code
the procedure compiles fine by itself in toad
it runs fine by itself in toad
it compiles fine in sql (I assume you mean sql*plus)
it runs fine in sql

Is that correct?

If so, then what are you doing differently in Toad when you get the error?
There are multiple ways to execute code or pieces of code within the Toad editor.

Are you using a different key or set of keys? Are you clicking buttons within the gui?
Do you have other text within the editor? If so, what is that text?
Are you highlighting anything (even just one character?)
Where do you have the cursor when you attempt to execute or compile?

Featured Post

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.