Result set into an array


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Result set into an array
# 1  
Old 09-14-2010
Result set into an array

Hi,

I have an issue with the result set. I wanted to run db2 query against db2 server in unix environment using perl script. I wanted to get the result set into an array.

$db=<<DB_Name>>

connect to $db
get connection state

this is my query = SELECT DISTINCT 'R' FROM SYSCAT.TABAUTH;

any help really appreciated..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Need to filter the result set within 2 time frame

my sample file is like this $cat onefile 05/21/18 13:10:07 ABRT US1CPDAY Status 1 05/21/18 21:18:54 ABRT DailyBackup_VFFPRDAPENTL01 Status 6 05/21/18 21:26:24 ABRT DailyBackup_VFFPRDAPENTL02 Status 6 05/21/18 21:57:36 ABRT DailyBackup_vm-ea1ffpreng01 Status 6... (7 Replies)
Discussion started by: gotamp
7 Replies

2. UNIX for Dummies Questions & Answers

Find commmand returning search path with the result set

OS Platform : Oracle Linux 6.5 We are creating a shell script to purge old log files . It uses find command with rm in it. The syntax is find <Path of Log Directory> -exec rm -fr {} \; Example: find /tmp/test3 -exec rm -fr {} \; For rm command , we use -r option to... (4 Replies)
Discussion started by: kraljic
4 Replies

3. Shell Programming and Scripting

ksh : Building an array based on condition result

I want to build an Errorlog. I would like to build an array as I move through the if statements and print the array once all error conditions have been defined. The results need to be comma delimited. tsver will be static "1.9.6(2)" other vars $prit $lt $rt can have the same or a different... (1 Reply)
Discussion started by: popeye
1 Replies

4. Shell Programming and Scripting

how to output the array result into a matrix

I have a file like this: ASSPASVFETQY,hTRBV12-4,hTRBJ2-5,2 ASSPASTGGDYGYT,hTRBV18,hTRBJ1-2,2 ASSPASGDGYT,hTRBV5-1,hTRBJ1-2,2 ASSPASFPEDTQY,hTRBV27,hTRBJ2-3,2 ASSPARVNYGYT,hTRBV5-1,hTRBJ1-2,2 ASSPARTSGGLNEQF,hTRBV6-4,hTRBJ2-1,2 ASSPARQSYNEQF,hTRBV11-1,hTRBJ2-1,2... (3 Replies)
Discussion started by: xshang
3 Replies

5. Shell Programming and Scripting

How do i access sybase using isql and how do i get result set in perl script?

Hi, How do i get result set in perl script using isql while connecting sybase server. I have a perl script which connected to sybase and get the result set. but i wanted to get the result set. How do i get the result set in perl script not unix shell script.. $server ="ServerName"; open... (1 Reply)
Discussion started by: solo123
1 Replies

6. Shell Programming and Scripting

If the grep command returns any result set

my intension is to use a grep command inside the shell script and if any row is returned or not.. depending on the resultset i have to code on further. how to check this i mean.. could anyone help me out with the if condition how to use it here !! (4 Replies)
Discussion started by: gotam
4 Replies

7. Shell Programming and Scripting

How to get and process mysql result set in shell script

Hi All, I am in a problem here is the description, Actually in my shell script i am firing a mysql query which returns multiple records and i have to process each record one by one. So could any one please suggest me how to solve my problem? Thanks in Advance Ashok Sharma (4 Replies)
Discussion started by: ashok1979
4 Replies

8. Programming

Send email for each row in a result set

I have SQL giving me output of disabled ids in the system every day. I can send on email for this disabled user list. But I want to send one email for every disabled user or for every row. thank you for your help. Kyle (2 Replies)
Discussion started by: s1a2m3
2 Replies

9. Shell Programming and Scripting

Prase a file and store and result to an array

Dear all, I have a file having the following formats: ThreadFail=Web1=1234 ThreadFail=Web2=2345 ThreadFail=Web3=12 ConnectionFail=DB1=11 ConnectionFail=DB2=22 The number of lines will be different from every time . How can I parse the file and store the result to an a array inside... (6 Replies)
Discussion started by: youareapkman
6 Replies

10. Shell Programming and Scripting

Prase a file and stored the result to an array

Dear all , I have a file whose content has the following format: jboss.web:type=ThreadPool,name=AAAA jboss.web:type=ThreadPool,name=BBBB How can I parse this file to get the value of the name of each line (AAAA , BBBB) and store the result to an array ? (array = AAAA , array = BBBB).... (4 Replies)
Discussion started by: youareapkman
4 Replies
Login or Register to Ask a Question
Net::Jabber::Dialback::Result(3pm)			User Contributed Perl Documentation			Net::Jabber::Dialback::Result(3pm)

NAME
Net::Jabber::Dialback::Result - Jabber Dialback Result Module SYNOPSIS
Net::Jabber::Dialback::Result is a companion to the Net::Jabber::Dialback module. It provides the user a simple interface to set and retrieve all parts of a Jabber Dialback Result. DESCRIPTION
To initialize the Result with a Jabber <db:*/> you must pass it the XML::Stream hash. For example: my $dialback = new Net::Jabber::Dialback::Result(%hash); There has been a change from the old way of handling the callbacks. You no longer have to do the above yourself, a NJ::Dialback::Result object is passed to the callback function for the message. Also, the first argument to the callback functions is the session ID from XML::Streams. There are some cases where you might want this information, like if you created a Client that connects to two servers at once, or for writing a mini server. use Net::Jabber qw(Server); sub dialbackResult { my ($sid,$Result) = @_; . . . } You now have access to all of the retrieval functions available. To create a new dialback to send to the server: use Net::Jabber qw(Server); $Result = new Net::Jabber::Dialback::Result(); Now you can call the creation functions below to populate the tag before sending it. For more information about the array format being passed to the CallBack please read the Net::Jabber::Client documentation. Retrieval functions $to = $Result->GetTo(); $from = $Result->GetFrom(); $type = $Result->GetType(); $data = $Result->GetData(); $str = $Result->GetXML(); @dialback = $Result->GetTree(); Creation functions $Result->SetResult(from=>"jabber.org", to=>"jabber.com", data=>key); $Result->SetTo("jabber.org"); $Result->SetFrom("jabber.com"); $Result->SetType("valid"); $Result->SetData(key); Test functions $test = $Result->DefinedTo(); $test = $Result->DefinedFrom(); $test = $Result->DefinedType(); METHODS
Retrieval functions GetTo() - returns a string with server that the <db:result/> is being sent to. GetFrom() - returns a string with server that the <db:result/> is being sent from. GetType() - returns a string with the type <db:result/> this is. GetData() - returns a string with the cdata of the <db:result/>. GetXML() - returns the XML string that represents the <db:result/>. This is used by the Send() function in Server.pm to send this object as a Jabber Dialback Result. GetTree() - returns an array that contains the <db:result/> tag in XML::Parser::Tree format. Creation functions SetResult(to=>string, - set multiple fields in the <db:result/> from=>string, at one time. This is a cumulative type=>string, and over writing action. If you set data=>string) the "from" attribute twice, the second setting is what is used. If you set the type, and then set the data then both will be in the <db:result/> tag. For valid settings read the specific Set functions below. SetTo(string) - sets the to attribute. SetFrom(string) - sets the from attribute. SetType(string) - sets the type attribute. Valid settings are: valid invalid SetData(string) - sets the cdata of the <db:result/>. Test functions DefinedTo() - returns 1 if the to attribute is defined in the <db:result/>, 0 otherwise. DefinedFrom() - returns 1 if the from attribute is defined in the <db:result/>, 0 otherwise. DefinedType() - returns 1 if the type attribute is defined in the <db:result/>, 0 otherwise. AUTHOR
By Ryan Eatmon in May of 2001 for http://jabber.org.. COPYRIGHT
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2004-08-17 Net::Jabber::Dialback::Result(3pm)