• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Expert Advice

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this code below, I have to call it many times:
like: SHOW_PEG("Hiton", "5454", "14574");
is it possible to send a table of inputs
SHOW_PEG(Hotel[], dataId[],, recordId[]);
Because, for now I use the code below and I have to call it many times. I want to be able to send a result table and process all the queries within my oracle program.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this sample by Oracle, Bobby.

Regards
Beksy
 
bobby, morkos
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you help me in modifying my code above. I can then use it as a reference. I hope you can help, to get my example working.

Originally posted by Beksy Kurian:
Try this sample by Oracle, Bobby.

Regards
Beksy

 
bobby, morkos
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Originally posted by bobby, morkos:
[QB]Can you help me in modifying my code above. I can then use it as a reference. I hope you can help, to get my example working.

So, let me get it right, your saying that it is possible to send an array into a procedure and go through the array in that same procedure. What I have is I want to retrieve many record set and return it to my java program without going back and forth. Your code that you showed me is hard to understand. What I have is the following:
In my java program:
// Calling the Oracle procedure
String query = "begin :1 := SHOW_PEGASUS('"+ ownerId + "', '"+ propertyCode
+ "', '"+ chainCode + "'); end;";
CallableStatement cs = _con.prepareCall(query);
cs.registerOutParameter(1,OracleTypes.CURSOR);
cs.execute();
_rs=(ResultSet)cs.getObject(1);
And ownerId, property Code and chain code is a collection (An array that I loop through it).
Now, my procedure is as the following:

I hope you understand what I'm trying to do. And if you could show me how to modify my code in order to function, it would really help me. I just need this as a reference. I hope you can help me and I really appreciate any help. Thanks.
 
bobby, morkos
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your a life savier. I just want my code to work so that I can use it as a reference. Thanks for taking the time to help.

Originally posted by Beksy Kurian:
let me test the code and I will get back to you soon.
Beksy

 
Beksy Kurian
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Bobby! I did not get enough time to test at work. I can give you some pointers though. This code may have errors!!!Try it out!
oracle.sql.STRUCT is the most basic method of calling objects.

Beksy
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic