05-12-2008
Hi,
You Can Use Following shell Script instead for database connection and pulling all the details into flat file.
echo "set time off;" > cpled_wkrep.sql
echo "set timing off;" >> cpled_wkrep.sql
echo "set pagesize 0;" >> cpled_wkrep.sql
echo "set linesize 1300;" >> cpled_wkrep.sql
echo "set trimspool on;" >> cpled_wkrep.sql
echo "set heading off;" >> cpled_wkrep.sql
echo "set echo off;" >> cpled_wkrep.sql
echo "set verify off;" >> cpled_wkrep.sql
echo "set termout off;" >> cpled_wkrep.sql
echo "set feedback off;" >> cpled_wkrep.sql
echo "" >> cpled_wkrep.sql
echo "spool VVMFNAMES;" >> cpled_wkrep.sql
echo "" >> cpled_wkrep.sql
echo "select V_VMF_CODE||'|'||V_VMF_NAME||'|'||V_VMF_BUS_STAT||'|' from V_VMF_CLASS where V_VM
F_BUS_STAT = 'SUPPORTED' order by V_VMF_CODE;" >> cpled_wkrep.sql
echo "" >> cpled_wkrep.sql
echo "" >> cpled_wkrep.sql
echo "spool off;" >> cpled_wkrep.sql
echo "exit;" >> cpled_wkrep.sql
sqlplus username/password@instance @cpled_wkrep.sql
rm -rf cpled_wkrep.sql
OutPut Will be in the file VVMFNAMES.lst
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Guys, how do I connect to a Oracle Database from my machines running on Solaris 5 and 9. Do I need a Oracle client installed or is there any other way to connect to the Oracle Db without using the oracle client?
Any inputs will be highly appreciated. (2 Replies)
Discussion started by: darmat0712
2 Replies
2. Shell Programming and Scripting
if;
sql="select username from dba_users where username = '$FromUser';"
check_FromUser=`ExecSql "$sql"`
I want to connect to Oracle database & check the users in the database, store the value in check_FromUser.
First how to connect to Oracle database from the shell script ?
Appreciate your... (4 Replies)
Discussion started by: dreams5617
4 Replies
3. Shell Programming and Scripting
Hi :),
I have installed CA Autosys in my Unix system. It contains 3 ( .pm ) files namely AutoSys.pm, Job.pm, Status.pm ....... in a directory CA.
Am trying to work with autosys for first time. Please guide in how do i connect autosys to oracle DB in my system. My oracle db name is XE..
Thank... (0 Replies)
Discussion started by: bhuvaneshlal
0 Replies
4. Shell Programming and Scripting
Hi :),
Am new to work with Autosys. I have Oracle installed in my computer. Please guide me how to configure and connect autosys with oracle database.
thank you..!:) (0 Replies)
Discussion started by: bhuvaneshlal
0 Replies
5. Shell Programming and Scripting
Hi,
I am trying to connect to oracle database (9.2.0.7.0) through Sun solaris.
But I am unable to do so.
The content of my script is as follows:
Shell Sript:
RESULT=`$ORACLE_HOME/bin/sqlplus schema/'pwd'@db << EOF
set echo on;
set feedback on;
@/home/count/qry.sql`
echo... (10 Replies)
Discussion started by: fidelis
10 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I am very new to shell scripting and trying to write a simple shell script in which i am trying to achieve the following:
1. Connect to oracle database hosted on a different server
2. fire a query on the oracle db
3. store the output in a variable
4. use this variable for further logic... (1 Reply)
Discussion started by: shrutihardas
1 Replies
7. Shell Programming and Scripting
Hai
i want to connect to oracle database from user input and create a view.
${ECHO} "Debut Creating View"
${ECHO} "Please Enter the User Name:"
read user_name
${ECHO} "Please Enter the Connection String:"
read con_string
${ECHO} "Please Enter the Password:"
read pwd... (3 Replies)
Discussion started by: shenthil76
3 Replies
8. Shell Programming and Scripting
Experts,
I am using the following Linux version:
Linux localhost.localdomain 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686 i686 i386 GNU/Linux
and creating a ksh script with below code in it.
clear
sqlplus RIB/RIB321@RIB_LOCAL
#whenever sqlerror exit failure
#set... (2 Replies)
Discussion started by: Oracle_User
2 Replies
9. Shell Programming and Scripting
#!/bin/bash
var1=0
x=1
while
do
echo "Welcome $x times"
var1=$(prstat -Lc 1 1 | nawk ' /^Total/ {print substr($8,1,length($8)-1)}')
echo "$var1"
if
then
break
fi
sleep 6
x=$(( $x + 1 ))
done
giving output:
bash-3.00$ ./ch1.sh
Welcome 1 times
5.90 (9 Replies)
Discussion started by: vivek1489
9 Replies
10. Solaris
Hi guys, long time no typing :D
I have problems when I try to connect to Oracle database from SQL Developer which is located on my Windows box.
Server is running Solaris 11/11 and Oracle 11 enterprise. I can log in locally with sys account to database, start it up and shut it down but when I... (2 Replies)
Discussion started by: solaris_user
2 Replies
LEARN ABOUT PHP
oci_result
OCI_RESULT(3) OCI_RESULT(3)
oci_result - Returns field's value from the fetched row
SYNOPSIS
mixed oci_result (resource $statement, mixed $field)
DESCRIPTION
Returns the data from $field in the current row, fetched by oci_fetch(3).
For details on the data type mapping performed by the OCI8 extension, see the datatypes supported by the driver
PARAMETERS
o $statement
-
o $field
- Can be either use the column number (1-based) or the column name. The case of the column name must be the case that Oracle meta
data describes the column as, which is uppercase for columns created case insensitively.
RETURN VALUES
Returns everything as strings except for abstract types (ROWIDs, LOBs and FILEs). Returns FALSE on error.
EXAMPLES
Example #1
oci_fetch(3) with oci_result(3)
<?php
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
$sql = 'SELECT location_id, city FROM locations WHERE location_id < 1200';
$stid = oci_parse($conn, $sql);
oci_execute($stid);
while (oci_fetch($stid)) {
echo oci_result($stid, 'LOCATION_ID') . " is ";
echo oci_result($stid, 'CITY') . "<br>
";
}
// Displays:
// 1000 is Roma
// 1100 is Venice
oci_free_statement($stid);
oci_close($conn);
?>
NOTES
Note
In PHP versions before 5.0.0 you must use ociresult(3) instead. This name still can be used, it was left as alias of oci_result(3)
for downwards compatability. This, however, is deprecated and not recommended.
SEE ALSO
oci_fetch_array(3), oci_fetch_assoc(3), oci_fetch_object(3), oci_fetch_row(3), oci_fetch_all(3).
PHP Documentation Group OCI_RESULT(3)