Oracle "SQL Error: Missing IN or OUT Parameter at Index :: 1"

I have an Oracle script that looks like this:

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; 

Presumably the last statement is a valid use of the binding variable, but when I try to run the script, I get this in the last line:

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

I am not sure how to proceed further, as I am not particularly good at Oracle.

+4
source share
5 answers

Based on the comments above, I ran this under sqlplus instead of SQL Developer, and the UPDATE statement worked fine, leaving me to believe this was a problem in SQL Developer, especially if the number of ORA errors was not returned. Thank you for leading me in the right direction.

+4
source

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

According to this website (second accessory), it offers you to fulfill a request with a missing parameter.

For instance:

 exec SomeStoredProcedureThatReturnsASite( :L_kSite ); 

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

Perhaps in SQLPlus it does not have the same requirements, so it would be lucky that he worked there.

+9
source

I think this is due to jdbc.

I have a similar problem (missing parameter) when I have a condition like this:

 a = :namedparameter and b = :namedparameter 

This is normal when I like it:

 a = :namedparameter and b = :namedparameter2 (the two param has the same value) 

So this is a problem with named parameters. I think there is an error in handling named parameters, it seems that if only the first parameter gets the correct value, the second is not set by the driver classes. Perhaps this is not an error, only I don’t know something, but in any case, I assume that the reason for the difference between SQL-dev and sqlplus works for you, because, as far as I know, the SQL developer uses the jdbc driver.

+1
source

I had this error due to some typo in the alias of the column containing the question mark (e.g. contract.reference as contract? Ref)

+1
source

I got the same error and found the reason for the wrong or missing foreign key . (Using JDBC)

0
source

All Articles