Page 1 of 1

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

Posted: Wed Mar 05, 2014 4:39 am
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.

Posted: Wed Mar 05, 2014 8:16 am
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."

Posted: Wed Mar 05, 2014 8:25 am
by A_SUSHMA
Hi CHullet,

Source is Oracle I need to drag single column(array) to target table...

Posted: Wed Mar 05, 2014 8:42 am
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.

Posted: Thu Mar 06, 2014 12:47 am
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

Posted: Thu Mar 06, 2014 9:11 am
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? :?