• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Problem while setting multiple Oracle Arrays as input to a proc

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am using oracle.sql.ARRAY in call to a database procedure.
I am providing the code snippet below.

First I have created an object of ArrayDescriptor 'desc'.

ArrayDescriptor desc = ArrayDescriptor.createDescriptor("HOST_ARRAY", conn);

Further I am using the same descriptor to create three Oracle arrays..

ARRAY inArrayCustIps = new ARRAY(desc, conn, changeSipsRequest.getCustIps());
ARRAY inArrayTotalHostIps = new ARRAY(desc, conn, changeSipsRequest.getTotalHostIps());
ARRAY inArraySelectedHostIps = new ARRAY(desc, conn, changeSipsRequest.getHostIps());

Further i have set the Arrays as input to proc according to correct index as

ocs.setARRAY(8, inArrayCustIps);
ocs.setARRAY(9, inArrayTotalHostIps);
ocs.setARRAY(10, inArraySelectedHostIps);

But the problem i am facing is that values are not being passed to proc.
Can anybody suggest, what is the problem and how can i resolve it.

Thanks in advance.

Regards,
Vijay
 
Vijay Bhore
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will follow the same thread,

It's working after i made two changes

1) Created three different descriptors for three different oracle arrays as

ArrayDescriptor descOne = ArrayDescriptor.createDescriptor("HOST_ARRAY", conn);
ArrayDescriptor descTwo = ArrayDescriptor.createDescriptor("SUBNET_ARRAY", conn);
ArrayDescriptor descThree = ArrayDescriptor.createDescriptor("NEW_HOST_ARRAY", conn);

2) I had initialized String arrays of size 20 whereas arrays can contain only 1-10 values.
Now i have initialized arrays dynamically according to number of actual number of elements in array.
Hence the chances of the oracle array containing null values got minimized.

Regards,

Vijay Bhore
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic