How can i export entries from table into a variable and parse them?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How can i export entries from table into a variable and parse them?
Prev   Next
# 1  
Old 12-13-2016
How can i export entries from table into a variable and parse them?

Hi,
I need to export some entries from a table, from a specific column and then redirect them into a file.
I used sql plus, in order to fetch the entries and i put them in one variable.
When i am running the script it stuck at a point and does not move further.

I did something like:
Code:
$OUTPUT=`sqlplus -s $USER/$PASS@$INST << END
SELECT col1
FROM table
WHERE col2='A';
EXIT;
END`

for element in $OUTPUT
do
        echo $OUTPUT
done

variables $USER/$PASS@$INST, contain correctly the db details, as per what i see after doing echo

Could someone advice?
Thank you
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Export HTML table

HI , I have a HTML tables as below. It has 2 tables ,I want to extract the second table . Please help me in doing it. <html> <body> <b><br>Running Date: </b>11-JAN-2019 03:07</br> <h2> Schema mapping and info </h2> <BR><TABLE width="100%" class="x1h" cellpadding="1"... (3 Replies)
Discussion started by: deepti01
3 Replies

2. Linux

Parsing - export html table data as .csv file?

Hi all, Is there any out there have a brilliant idea on how to export html table data as .csv or write to txt file with separated comma and also get the filename of link from every table and put one line per rows each table. Please see the attached html and PNG of what it looks like. ... (7 Replies)
Discussion started by: lxdorney
7 Replies

3. Shell Programming and Scripting

Export table and restart from last table

Hello all, Thank you in advance for reading my post and helping me.. Scenario: I have 50 tables whose names are in a file export.sql, i use the below command to export all these tables one by one cat export.sql|while read tn do echo "export to $tn.del of del select from... (7 Replies)
Discussion started by: family_guy
7 Replies

4. Shell Programming and Scripting

Export table of 50 columns

Dear all, I have a big table of 50 columns and more then 100, 000 rows in mysql. Could you please help me that how I can export it as .csv or . txt that I can open it in MS excel????? OR how can I export the specific columns of the table??? Thanks AAWT (5 Replies)
Discussion started by: AAWT
5 Replies

5. Shell Programming and Scripting

Shell script to export data from Oracle table .

Hi, I want to write a shell script which will export data from oracle table . I don't want to save that data . I want the queries . Right now i am right clicking on the table and clicking on export as to my desktop . Please let me know if any one have any idea . (2 Replies)
Discussion started by: honey26
2 Replies

6. Shell Programming and Scripting

How to export table data to xml file?

Hi , I would like to get some suggestion from the experts. My requirement is to export oracle table data as an xml file. Any unix/linux tools, scripts available? Regards, (2 Replies)
Discussion started by: LinuxLearner
2 Replies

7. Shell Programming and Scripting

Problem in scheduling an Export of a table

Hi, I am facing a problem while scheduling an export of a table using cron job. I have written a simple export command inside a shell script test.sh like echo started exp schemaname/temp1234 file= /test/d.dmp tables=per_st log= /test/d.log echo ended I tried scheduling it through... (6 Replies)
Discussion started by: beautifulmind
6 Replies

8. Shell Programming and Scripting

Export a HTML table to Xcel

Hello All, I have a perl script that prints a HMTL table. I want to convert this data into a report and this want to export this information into Excel. How can I do this? Regards, garric (3 Replies)
Discussion started by: garric
3 Replies

9. Shell Programming and Scripting

help for writing shell script to export table data

Hi All, I need to write a shell script(ksh) to take the tables backup in oracle(exporting tables data). The tables list is not static, and those are selecting through dynamic sql query. Can any body help how to write this shell script. Thanks, (3 Replies)
Discussion started by: sankarg
3 Replies

10. Shell Programming and Scripting

export table from oracle database

i would like to export a particular table in my oracle database installed in a hpux box. i would like to determine the filesize of the output before performing these action so i can assess if my harddisk can still handle it. thanks as usuall :rolleyes: (1 Reply)
Discussion started by: inquirer
1 Replies
Login or Register to Ask a Question
mlib_ImageLookUp_Inp(3MLIB)				    mediaLib Library Functions				       mlib_ImageLookUp_Inp(3MLIB)

NAME
mlib_ImageLookUp_Inp - table lookup, in place SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageLookUp_Inp(mlib_image *srcdst, const void **table); DESCRIPTION
The mlib_ImageLookUp_Inp() function maps the source image to the destination image, in place, by using the user-specified lookup table. The following equation is used: srcdst[x][y][i] = table[i][srcdst[x][y][i]] PARAMETERS
The function takes the following arguments: srcdst Pointer to first source and destination image. table Pointer to lookup table. The data type of the lookup table is the same as the destination image. The number of entries in the lookup table is determined by the type of the input image. The format of the lookup table is: table[channel][index] The MLIB_BYTE type entries are indexed from 0 to 255. The MLIB_SHORT type entries are indexed from -32768 to -1, then from 0 to 32767. The MLIB_USHORT type entries are indexed from 0 to 65535. The MLIB_INT type entries are indexed from -2147483648 to -1, and then from 0 to 2147483647. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_ImageLookUp(3MLIB), mlib_ImageLookUp2(3MLIB), mlib_ImageLookUpMask(3MLIB), attributes(5) SunOS 5.11 2 Mar 2007 mlib_ImageLookUp_Inp(3MLIB)