Sponsored Content
Top Forums Shell Programming and Scripting Assigning multiple column's value from Oracle query to multiple variables in UNIX Post 302964260 by RudiC on Wednesday 13th of January 2016 03:35:03 AM
Old 01-13-2016
You need to make sure that the delimiter is NOT part of the data; I remember faintly ORACLE allows for that (set COLSEP ...). Then, you don't need a shell variable to hold the selection's interim result, try
Code:
IFS='X' read -r v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 <<EOF
$(sql ... )
EOF

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to execute multiple(batch) oracle script in unix mechine

Hi All, How to run multiple oracle script in unix at-a-time.I appriciate if any send the script for me. Regards, Ravi kumar.Gongati (2 Replies)
Discussion started by: ravi gongati
2 Replies

2. Shell Programming and Scripting

put value of multiple sql statements into unix variables

i want to use multple sql count statements and store these count values in unix variable but in one connection only i.e. in only 1 time database should be hit ,which is the main requirement. (1 Reply)
Discussion started by: sw@pnil
1 Replies

3. Shell Programming and Scripting

Oracle Query results to be stored in variables using unix

I want to store the sql query output into a variable #!/bin/ksh ORACLE_SID=DB01; export ORACLE_SID; export FILE_PATH=/home/asg/Tmp # Order Checking echo " removing old files " rm $FILE_PATH/Malformed_Order.txt echo " Enter the Malformed Order ....!" read orders echo "Regrade... (5 Replies)
Discussion started by: Nareshp
5 Replies

4. Shell Programming and Scripting

Filtering Multiple variables from a single column

Hi, I am currently filtering a file, "BUILD_TIMES", that has multiple column of information in it. An example of the data is as follows; Fri Nov 5 15:31:33 2010 00:28:17 R7_BCGNOFJ_70.68 Fri Nov 5 20:57:41 2010 00:07:21 R7_ADJCEL_80.6 Wed Nov 10 17:33:21 2010 00:01:13 R7_BCTTEST3_80.1X... (7 Replies)
Discussion started by: crunchie
7 Replies

5. Web Development

mysql query for multiple columns from multiple tables in a DB

Say I have two tables like below.. status HId sName dName StartTime EndTime 1 E E 9:10 10:10 2 E F 9:15 10:15 3 G H 9:17 10:00 logic Id devName capacity free Line 1 E 123 34 1 2 E 345 ... (3 Replies)
Discussion started by: ilan
3 Replies

6. Shell Programming and Scripting

Multiple Query Results to Variables

Hello, I am very new to shell scripting and I am not sure of how best to handle the following scenario. I need to query a list of values from a table. I need to store those results and use them to selectively delete values in yet another table in a separate database. I do know how to store the... (3 Replies)
Discussion started by: flowervz
3 Replies

7. Shell Programming and Scripting

Reading multiple values from multiple lines and columns and setting them to unique variables.

Hello, I would like to ask for help with csh script. An example of an input in .txt file is below, the number of lines varies from file to file and I have 2 or 3 columns with values. I would like to read all the values (probably one by one) and set them to independent unique variables that... (7 Replies)
Discussion started by: FMMOLA
7 Replies

8. Shell Programming and Scripting

Assigning multiple variables in ksh script

Is it possible to have a user input multiple words in one line and have the script assign each word a variable? I'm stuck please assist. Example using "BILL JOHN SARA JILL" as what the user could type: printf "Enter account names: " BILL JOHN SARA JILL read input (9 Replies)
Discussion started by: seekryts15
9 Replies

9. UNIX for Dummies Questions & Answers

UNIX multiple column sort

Hi, I have a text file that has data like this chr1 156106712 156106819 LMNA 8 + 1 147 chr1 156106712 156106819 LMNA 8 + 2 147 chr1 156106712 156106819 LMNA 8 + 3 148 chr1 ... (4 Replies)
Discussion started by: mitt
4 Replies

10. UNIX for Beginners Questions & Answers

Export Oracle multiple tables to multiple csv files using UNIX shell scripting

Hello All, just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table. Can you please suggest why? or any better idea? export FILE="/abc/autom/file/geo_JOB.csv" Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies
CUBRID_INSERT_ID(3)							 1						       CUBRID_INSERT_ID(3)

cubrid_insert_id - Return the ID generated for the last updated AUTO_INCREMENTcolumn

SYNOPSIS
string cubrid_insert_id ([resource $conn_identifier]) DESCRIPTION
The cubrid_insert_id(3) function retrieves the ID generated for the AUTO_INCREMENT column which is updated by the previous INSERT query. It returns 0 if the previous query does not generate new rows, or FALSE on failure. Note CUBRID supports AUTO_INCREMENT for more than one columns in a table. In most cases, there will be a single AUTO_INCREMENT column in a table. If there are multiple AUTO_INCREMENT columns, this function should not be used even if it will return a value. PARAMETERS
o $conn_identifier - The connection identifier previously obtained by a call to cubrid_connect(3). RETURN VALUES
A string representing the ID generated for an AUTO_INCREMENT column by the previous query, on success. 0, if the previous query does not generate new rows. FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 8.4.0 | | | | | | | Change the return value from an array to string; | | | Remove the first parameter class_name. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 cubrid_insert_id(3) example <?php $conn = cubrid_connect("localhost", 33000, "demodb"); @cubrid_execute($conn, "DROP TABLE cubrid_test"); cubrid_execute($conn, "CREATE TABLE cubrid_test (d int AUTO_INCREMENT(1, 2), t varchar)"); for ($i = 0; $i < 10; $i++) { cubrid_execute($conn, "INSERT INTO cubrid_test(t) VALUES('cubrid_test')"); } $id = cubrid_insert_id(); var_dump($id); cubrid_disconnect($conn); ?> The above example will output: string(2) "19" PHP Documentation Group CUBRID_INSERT_ID(3)
All times are GMT -4. The time now is 08:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy