RE: Not sure how to write this in sql

  • From: "Reidy, Ron" <Ron.Reidy@xxxxxxxxxxxxxxxxxx>
  • To: <cstephens16@xxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 12 Jan 2005 15:04:35 -0700

Chris,

Can you do it in PL/SQL using dbms_utilty.comma_to_table and =
dbms_utility.table_to_comma to get/insert data in your table?  Or maybe =
do some bulk processing in PL/SQL?

--
Ron Reidy
Lead DBA
Array BioPharma, Inc.


-----Original Message-----
From:   oracle-l-bounce@xxxxxxxxxxxxx on behalf of Chris Stephens
Sent:   Wed 1/12/2005 2:51 PM
To:     oracle-l@xxxxxxxxxxxxx
Cc:=09
Subject:        Not sure how to write this in sql
We have a function  that loops through a table and grabs all rows
associated with a particular id and builds a string consisting of a
comma delimited, concatenate string of 1-3 rows of a column associated
with that id.

the function returns the string and that string is used to populate a
column in another table.

i believe this is possible in a single update statement but i can't
figure out how to right it. (as it is, it takes over an hour)

so:

table a
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
id  col2
1    a
1    b
1    c

should populate table b like

table b
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
id  col2
1   1,2,3

table a can have 0,1,2, or 3 rows associated with each id.

help?

ps.  I have lex's book on order so hopefully my sql skills will
continue to grow.

tia
chris
--
//www.freelists.org/webpage/oracle-l




This electronic message transmission is a PRIVATE communication which =
contains
information which may be confidential or privileged. The information is =
intended=20
to be for the use of the individual or entity named above. If you are =
not the=20
intended recipient, please be aware that any disclosure, copying, =
distribution=20
or use of the contents of this information is prohibited. Please notify =
the
sender  of the delivery error by replying to this message, or notify us =
by
telephone (877-633-2436, ext. 0), and then delete it from your system.

--
//www.freelists.org/webpage/oracle-l

Other related posts: