How to extract the array of column data to target file ?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
A_SUSHMA
Participant
Posts: 43
Joined: Fri Apr 12, 2013 10:34 am

How to extract the array of column data to target file ?

Post by A_SUSHMA »

Hi All,

Db_Amount{3}

In a table i have a column called Db_Amount{3} array 3 .It have the value of {100, 200, 300)
I mean the aomunt may be in array{1}, {2} , {3} for the column Db_Amount.
I want to populate this column to target file with addition of the arry values. I mean I need the below output.
Input:Db_Amount{3} array 3 .It have the value of {100, 200, 300)
Out put: Db_Amount=600
This conversation is saved in the Conversations tab in Lync and in the Conversation History folder in Outlook.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It may be in an array? Or is? :?

Also curious what actual database this is and the internal data type. I would imagine that it (the actual database) provides functions for dealing with this 'array' but hard to say without the requested details.

Is "this conversation" actually part of your question / requirements? This is somehow related to the Microsoft Lync enterprise communications software... as in this is your source?

"This conversation is saved in the Conversations tab in Lync and in the Conversation History folder in Outlook."
-craig

"You can never have too many knives" -- Logan Nine Fingers
A_SUSHMA
Participant
Posts: 43
Joined: Fri Apr 12, 2013 10:34 am

Post by A_SUSHMA »

Hi CHullet,

Source is Oracle I need to drag single column(array) to target table...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well, one question answered.

What data type is this field in Oracle? A VARRAY? Post the actual column definition, please. If it is, you can't simply 'drag it to the target', you'll need to process it using PL/SQL via (one suggestion) a stored function so you can 'select' the summed value from the field.

(edited to add)
FYI - there are plenty of code examples out there in the wild showing how to work with the various collection methods you'll need that Oracle provides.
-craig

"You can never have too many knives" -- Logan Nine Fingers
A_SUSHMA
Participant
Posts: 43
Joined: Fri Apr 12, 2013 10:34 am

Post by A_SUSHMA »

Hi,

DBAmount Valcode
{100, 200, 300) 1
{200, 200, 500) 3
{100, 400, 300) 2

output

based on the valcode position I need to take the DBAmount.If value code is 1 then first postion in the array that is 100.DBAmount datatype is Number(7,2)

Output
100
500
400
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It cannot be a simple NUMBER. Is this actually a TABLE OF / INDEXED BY data type? Regardless, unless it's just numbers stored in a delimited string field you'll have to do the extraction of the components in the database.

And I have to ask - any particular reason you put a "{" on the left side and a ")" on the right? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply