This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

conn.prepareCall

 
Swosti Dipan Pal
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

CallableStatement stproc_stmt = conn.prepareCall
("{call procname(?,?,?)}");

In the above statment the question mark corresponds to each column name in the table.

Is it necessary that only three columns should be present in that table ?
If we add another new column to this table, then the above statement will not be valid.

Cheers,
-Biswa
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NO. The question marks correspond to the parameters to a stored procedure named "procname". You only need to change the call if you change the parameters to the procedure.

It's not in any way related to tables.
 
Swosti Dipan Pal
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much !!!

Suppose a table has 4 columns. We are passing those four columns in the procname. We have added another column. Is there any way to access this 5th (new column) inside the procname without updating the pocname definition ?

I mean if a table has (n) columns , is it manadatory to pass (n) parameters in the procname to access these (n) columns. Is it possible to pass (n-1) parameters in the procname and access the n columns inside the procedure.

Cheers,
-Biswa
[ April 15, 2006: Message edited by: Biswamohan Routray ]
 
Maximilian Xavier Stocker
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure why not. Your question is wrong so it really doesn't matter what answer we give so I'll say yes.

Parameter bindings are for column values not field names but you seem to feel differently. Could you post the code for this procedure so it can be better understood what you are attempting to do here?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic