Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle "SQL Error: Missing IN or OUT parameter at index:: 1"

I have an Oracle script that looks like the following:

variable L_kSite number;
variable L_kPage number;
exec SomeStoredProcedureThatReturnsASite( :L_kSite );
exec SomeStoredProcedureThatAddsAPageToTheSite( :L_kSite, :L_kPage );
update SiteToPageLinkingTable 
set HomePage = 1 
where kSite = :L_kSite and kPage = :L_kPage;

Supposedly the last statement is a valid use of a bind variable but when I try to run the script I get this on the last line:

SQL Error: Missing IN or OUT parameter at index:: 1

I'm not sure how to proceed here as I'm not especially proficient in Oracle.

like image 754
Otis Avatar asked Nov 17 '09 23:11

Otis


4 Answers

I had a similar error on my side when I was using JDBC in Java code.

According to this website (the second awnser) it suggest that you are trying to execute the query with a missing parameter.

For instance :

exec SomeStoredProcedureThatReturnsASite( :L_kSite );

You are trying to execute the query without the last parameter.

Maybe in SQLPlus it doesn't have the same requirements, so it might have been a luck that it worked there.

like image 141
ForceMagic Avatar answered Nov 06 '22 14:11

ForceMagic


I got the same error and found the cause to be a wrong or missing foreign key. (Using JDBC)

like image 43
Tomek Avatar answered Nov 06 '22 12:11

Tomek


I had this error because of some typo in an alias of a column that contained a questionmark (e.g. contract.reference as contract?ref)

like image 26
user7095343 Avatar answered Nov 06 '22 12:11

user7095343


Based on the comments left above I ran this under sqlplus instead of SQL Developer and the UPDATE statement ran perfectly, leaving me to believe this is an issue in SQL Developer particularly as there was no ORA error number being returned. Thank you for leading me in the right direction.

like image 26
Otis Avatar answered Nov 06 '22 14:11

Otis