Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

data type TABLE of Oracle

 
   Database Forums (Home) -> Oracle RSS
Next:  Syntax XQuery  
Author Message
andyho99

External


Since: Jun 09, 2005
Posts: 2



(Msg. 1) Posted: Wed May 03, 2006 2:05 pm
Post subject: data type TABLE of Oracle
Archived from groups: comp>databases>oracle>misc (more info?)

Hi,

I'm writing a PL/SQL program to send emails. I copied a email packages
from the web and it works fine. However, I have problem if I put the
email ids as variable instead of hardcoded in the calling program.

The package header is as follows:

create or replace package PGCPS_MAIL_PKG
as
type array is table of varchar2(255);

procedure send( p_sender_email in varchar2,
p_from in varchar2 default null,
p_to in array default array(),
p_cc in array default array(),
p_bcc in array default array(),
p_subject in varchar2 default null,
p_body in long default null );
end PGCPS_MAIL_PKG;
/

In my calling program:

set serveroutput on size 1000000
declare

l_quote VARCHAR2(1) := '''';
v_to varchar2(100) := l_quote||'abc@abc.org'||l_quote||', '||
l_quote||'abc@abc.com'||l_quote;
-- v_to varchar2(100) := 'abc@abc.org' ||', abc DeleteThis @abc.com';

v_to_test PGCPS_MAIL_PKG.array;

begin
v_to_test := PGCPS_MAIL_PKG.array('abc@abc.org', 'abc@abc.com'); --
WORKS
-- v_to_test := PGCPS_MAIL_PKG.array(v_to); -- DOES NOT WORK
dbms_output.put_line(v_to);
PGCPS_MAIL_PKG.send
(
p_sender_email => 'abc@abc.org',
p_to => v_to_test,
p_subject => 'This is a subject',
p_body => 'Hello Andy, this is the mail you need!!!'
);
end;
/

Is it possible using variable to build a TABLE?

Thanks, Andew

 >> Stay informed about: data type TABLE of Oracle 
Back to top
Login to vote
andyho99

External


Since: Jun 09, 2005
Posts: 2



(Msg. 2) Posted: Wed May 03, 2006 2:47 pm
Post subject: Re: data type TABLE of Oracle [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I found that I need to use a constructor, such as v_to_test :=
PGCPS_MAIL_PKG.array(1,2,3,4,5,6,7,8,9,10); before I assign a value to
element. It seems I have to give it some numbers. If I use v_to_test :=
PGCPS_MAIL_PKG.array(), it still fails.

Andrew

 >> Stay informed about: data type TABLE of Oracle 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Newbie: Generate XML for data from Oracle Table Rows - Hi, I am very new to Oracle. My customer has a requirement, where in I need to generate the XML scripts for the data that we are appending with in the table. eg: for the table col1 col2 col3..

What is the most widely used RAID type for Oracle databases? - Maybe too broad a question. Is RAID 10 pretty much now the rule of thumb? Hope things are going well, Bill

Number Data Type - Hi All, I am using Oracle 10g database. I have a table with field name "Amount" and its datatype is Number(7,2). If I enter the amount value as 10.23, it is stored beautifully in the database. But, if I enter the amount value as 10.00, it is g...

user defined data type: does they exist ? - I'm migrating an application from sql server to oracle. We have tables with column that use user defined data type, for example CREATE TABLE AA ( Column1 CODE ) Where CODE is defined as varchar(50) Is there a way to create an equivalent CODE in....

selecting from oracle nested table - The task I have is to output some messages from a procedure in a package. The package is run in a shell script from plsql by piping the output from the proc to a file. There is a need to have 4 different types of messages in the report with some sorting...
   Database Forums (Home) -> Oracle All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]