开发者

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 开发者_JAVA百科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.


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.


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.


I think its related with jdbc.

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

a = :namedparameter and b = :namedparameter

It's ok, When I have like this:

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

So it's a problem with named parameters. I think there is a bug around named parameter handling, it looks like if only the first parameter get the right value, the second is not set by driver classes. Maybe its not a bug, only I don't know something, but anyway I guess that's the reason for the difference between the SQL dev and the sqlplus running for you, because as far as I know SQL developer uses jdbc driver.


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


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)


I had issue in SQL Developer because I was using binds incorrectly. Was using this, copied from log:

variable = ?

should be

variable = :variable

Now SQL Developer prompts me for values.


I got the same error sporadically appearing on some user setup, while others were content with the same report. I had my parameters written in altered case and with nordic letters, for example: Henkilö. I changed them to HENKILO, using only upper case and no nordics, and it did the trick.

The driver is some unknown or varying JDBC version to Oracle.

My error desc was originated from some 3rd party bin: Excel Plugin Error: Failed executing statement (Missing IN or OUT parameter at index:: 4) SQL Statement failed. Please verify and correct it!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜