dbTalk Databases Forums  

Collections

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Collections in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: Collections - 02-03-2010 , 03:25 PM






The Magnet (art (AT) unsu (DOT) com) wrote:

: Hi,

: Can you call a procedure from SQLPLUS that takes a collection as
: input?

: INSERT_PORTFOLIO_ARR (
: p_customer_id NUMBER,
: p_price IN_ARR,
: p_shares IN_ARR,
: p_date IN_ARR,
: p_product VARCHAR2 DEFAULT NULL)

: IN_ARR is defined as:

: CREATE OR REPLACE TYPE "IN_ARR"
: AS VARRAY (100) OF VARCHAR2(100)

: Not sure how to do that. I'm looking around for some examples, but
: has anyone ever attempted this?

Presumably you could use a declare/begin/end block, something like

declare
the_in_arr IN_ARR;
begin
the_in_arr := IN_ARR('first line goes here');
INSERT_PORTFOLIO_ARR( ... the_in_arr ... );
end;

Of course in my example I am assuming there is an IN_ARR() constructor
that accepts that single string parameter, you would use whatever is
appropriate. The EXEC sqlplus command is really just a short cut for
begin/end, and I asusme you could use exec something like this.

EXEC INSERT_PORTFOLIO_ARR(... IN_ARR('first line goes here') ...)

Reply With Quote
  #2  
Old   
The Magnet
 
Posts: n/a

Default Collections - 02-03-2010 , 03:26 PM






Hi,

Can you call a procedure from SQLPLUS that takes a collection as
input?

INSERT_PORTFOLIO_ARR (
p_customer_id NUMBER,
p_price IN_ARR,
p_shares IN_ARR,
p_date IN_ARR,
p_product VARCHAR2 DEFAULT NULL)

IN_ARR is defined as:

CREATE OR REPLACE TYPE "IN_ARR"
AS VARRAY (100) OF VARCHAR2(100)

Not sure how to do that. I'm looking around for some examples, but
has anyone ever attempted this?

Many thanks!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.