17

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.

3
  • 2
    Do your run this in sqlplus? Is the errorcode you catched ORA-17041? Could you provide signature for both procedures? Are there triggers on table? Commented Nov 18, 2009 at 8:02
  • The format of the error message suggests you are using SQL Developer to run this script. Is this the case? If so, what version of the tool? Also, what version of the database? Commented Nov 18, 2009 at 13:39
  • @APC: SQL Developer 1.5.5, Oracle Express 10.2.0.1.0. @Christian: No; there's no ORA error code at all; I could but the error is definitely occurring on the UPDATE statement; no. Commented Nov 18, 2009 at 16:56

7 Answers 7

24

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.

Sign up to request clarification or add additional context in comments.

Comments

6

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.

1 Comment

It's not an issue with SQL Developer. The variable L_kSite number; is a specific SQL plus construct.
1

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.

Comments

1

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

Comments

1

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)

Comments

1

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.

Comments

-1

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!

1 Comment

I'd be interested in knowing if there's a solution for this while keeping the Nordic letters.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.