01-25-2012
shell script for saving oracle database records in variable
i want to retrieve value in each column of each row in sql plus
and save them into array variable and echo the value in array variable
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
shell script (4 Replies)
Discussion started by: frns5
4 Replies
2. Shell Programming and Scripting
Hi all,
I am satyakiran , i am new to the forum. i never done shell scripts for connecting to the data base (oracle) and fetching the data from the database( thru sql select statements ) i want to know
1. how to connect to the data base(oracle) using shell script
2. how to retrieve data... (8 Replies)
Discussion started by: satyakiran
8 Replies
3. Shell Programming and Scripting
Hello everyone,
I am new to shell scripting/ loading data into a database.
I want to load data into Oracle database using SQL loader. Can some one please explain why do we need unix shell script to load the data into the database? Also can someone please explain what has to be in that script?... (5 Replies)
Discussion started by: new_prog
5 Replies
4. UNIX and Linux Applications
Hello ,
I am new in this forum and need your help as I am totally confused :confused:
I read a lot of threads and tried to search a lot but did not get the exact answer to my question.
I just want a simple (content wise may be long) shell script to create oracle database.
In detail:... (5 Replies)
Discussion started by: rahoolm
5 Replies
5. Shell Programming and Scripting
Hi Unix Gurus,
I have a requirement to write a script, Oracle DB gets referesh every 6hrs, hence we need write a script to connect to the database , if it connects it should generate a file to proceed the next job application or when an error when connectiong to DB it should not generate any... (8 Replies)
Discussion started by: bshivali
8 Replies
6. Shell Programming and Scripting
Hi All,
I am newbie to unix shell scripting. I want to connect to oracle database using shell script. I know how to connect DB using user name and password but my question is if my password is having '@' sign then how to connect.
I have tried like below,
cnt=`sqlplus -s /nolog << EOFSQL
... (3 Replies)
Discussion started by: pmotewar
3 Replies
7. Shell Programming and Scripting
I have a table in an Informix DB into which I want to insert multiple records at a time. Data for one of the column should be unique & other column data may be the same for all the records I insert
Typical Insert Statement I use to insert one row :
insert into employee(empid, country, state)... (5 Replies)
Discussion started by: nisav
5 Replies
8. UNIX and Linux Applications
Good evening
I nned your help pls, In an unix server i want to connect to a remote oracle databse server by sqlplus.
I tried to find out the user/passwd and service name by env variable and all Ive got is this:
ORACLE_SID_REPCOL=SCL_REPCOL
ORACLE_SID=xmeta
ORACLE_SID_TOL=SCL_PROTOLCOL... (2 Replies)
Discussion started by: alexcol
2 Replies
9. UNIX for Dummies Questions & Answers
I have a question regarding how to connect to Oracle Database through shell script.
1. If I want call a stored procedure on Linux server as this, it works.
$sqlplus /nolog
SQL*Plus: Release 12.1.0.2.0 Production on Fri Jun 12 14:49:49 2015
Copyright (c) 1982, 2014, Oracle. All rights... (2 Replies)
Discussion started by: duke0001
2 Replies
LEARN ABOUT PHP
db2_result
DB2_RESULT(3) 1 DB2_RESULT(3)
db2_result - Returns a single column from a row in the result set
SYNOPSIS
mixed db2_result (resource $stmt, mixed $column)
DESCRIPTION
Use db2_result(3) to return the value of a specified column in the current row of a result set. You must call db2_fetch_row(3) before
calling db2_result(3) to set the location of the result set pointer.
PARAMETERS
o $stmt
- A valid stmt resource.
o $column
- Either an integer mapping to the 0-indexed field in the result set, or a string matching the name of the column.
RETURN VALUES
Returns the value of the requested field if the field exists in the result set. Returns NULL if the field does not exist, and issues a
warning.
EXAMPLES
Example #1
A db2_result(3) example
The following example demonstrates how to iterate through a result set with db2_fetch_row(3) and retrieve columns from the result
set with db2_result(3).
<?php
$sql = 'SELECT name, breed FROM animals WHERE weight < ?';
$stmt = db2_prepare($conn, $sql);
db2_execute($stmt, array(10));
while (db2_fetch_row($stmt)) {
$name = db2_result($stmt, 0);
$breed = db2_result($stmt, 'BREED');
print "$name $breed";
}
?>
The above example will output:
cat Pook
gold fish Bubbles
budgerigar Gizmo
goat Rickety Ride
SEE ALSO
db2_fetch_array(3), db2_fetch_assoc(3), db2_fetch_both(3), db2_fetch_object(3), db2_fetch_row(3).
PHP Documentation Group DB2_RESULT(3)