Hi,
I have a UNIX script which calls SQL Select statement:
Now i want to use the output of that select statement within my UNIX script so as to call different shell script depending upon the output of the select statement.
Can anyone help me in this regard.
TIA
Akhil Goel (4 Replies)
Hi there
I have a database on a remote box and i have been using shell script to insert data into it for example, i could have a script that did this
SN=123456
n=server1
m=x4140
sql="UPDATE main SET hostname='$n',model='$m' WHERE serial='$SN';"
echo $sql |/usr/sfw/bin/mysql -h... (4 Replies)
I am trying to assign an select statement into a variable. Can someone hel me with this.
example :
a='select * from dual'
echo $a should give me select * from dual
But this is not working. I trying with \ before * and quotes too. (1 Reply)
hi
every resource i see regarding DBI refers to retrieving data from a database into and array or a hash, but i havent seen anything on how to pull out a single value to a scalar
in my database i have a field called "forcewrite" with a value of "6". I am trying to connect to the database,... (2 Replies)
i want to select a variable created and use it in a if statement, but not getting the desired results
LINE='device for 0101a01: lpd://172.25.41.111:515'
prt=`echo $LINE | awk '{print $3 }' | cut -c 1-7`
echo $prt
My if statement to select just what i want..
IFS=$":"
while read prt... (11 Replies)
Hello All,
I am new to shell scripting. I am working on Solaris O/S, bash script and sybase programming.
I want to loop through multiple values in an array and for each value, I
want to select a row from the database.
following is the code written for it.
output="loop.csv" ... (8 Replies)
Hi
I have run out of ideas as to why this select doesn't work in a script I am writing.
The script sources a file of common functions and I am trying to use a select statement within one of the functions -
PS3="Try? "
select X in CONT EXIT; do
if ]
... (4 Replies)
Hi Forum.
Need your expertise on the following question.
I have the following file which I would like to parse, find first block of SELECT statment and concatenate all input fields as 1 field (~ delimited):
Old File:
SELECT /*+ USE_HASH(CCOMM ICAR IMAP IAS IP IMAS IMPS IAP SPCA) */
... (5 Replies)
Hi all,
I'm using below code
processId=`sqlplus -s ${sysuser}/${syspwd} <<CHK_PROCESS
whenever sqlerror exit sql.sqlcode;
set head off feedback off echo off pages 0
SELECT PROCESS_ID FROM LSHADMIN.DATA_DOMAIN WHERE DOMAIN_NAME = '${tabname}'
... (8 Replies)
Hi,
i want to do the following:
Grep the following kind of strings for the 15digit ID which is stored in filename1:
"14:06:51.396 INFO BMCREMEDYSD INPUT-ACTION Failed to retrieve Remedy Incident Modification record: 000000000039047 org.apache.axis2.AxisFault: Read timed out - complete... (9 Replies)
Discussion started by: Khushbu
9 Replies
LEARN ABOUT PHP
oci_error
OCI_ERROR(3)OCI_ERROR(3)oci_error - Returns the last error foundSYNOPSIS
array oci_error ([resource $resource])
DESCRIPTION
Returns the last error found.
The function should be called immediately after an error occurs. Errors are cleared by a successful statement.
PARAMETERS
o $resource
- For most errors, $resource is the resource handle that was passed to the failing function call. For connection errors with
oci_connect(3), oci_new_connect(3) or oci_pconnect(3) do not pass $resource.
RETURN VALUES
If no error is found, oci_error(3) returns FALSE. Otherwise, oci_error(3) returns the error information as an associative array.
oci_error(3) Array Description
+----------+--------------------------------------+---+
|Array key | | |
| | | |
| | Type | |
| | | |
| | Description | |
| | | |
+----------+--------------------------------------+---+
| | | |
| code | | |
| | | |
| | | |
| | integer | |
| | | |
| | The Oracle error number. | |
| | | |
| | | |
| message | | |
| | | |
| | | |
| | string | |
| | | |
| | The Oracle error text. | |
| | | |
| | | |
| offset | | |
| | | |
| | | |
| | integer | |
| | | |
| | The byte position of an error in | |
| | the SQL statement. If there was no | |
| | statement, this is 0 | |
| | | |
| | | |
| sqltext | | |
| | | |
| | | |
| | string | |
| | | |
| | The SQL statement text. If there | |
| | was no statement, this is an empty | |
| | string. | |
| | | |
+----------+--------------------------------------+---+
EXAMPLES
Example #1
Displaying the Oracle error message after a connection error
<?php
$conn = oci_connect("hr", "welcome", "localhost/XE");
if (!$conn) {
$e = oci_error(); // For oci_connect errors do not pass a handle
trigger_error(htmlentities($e['message']), E_USER_ERROR);
}
?>
Example #2
Displaying the Oracle error message after a parsing error
<?php
$stid = oci_parse($conn, "select ' from dual"); // note mismatched quote
if (!$stid) {
$e = oci_error($conn); // For oci_parse errors pass the connection handle
trigger_error(htmlentities($e['message']), E_USER_ERROR);
}
?>
Example #3
Displaying the Oracle error message, the problematic statement, and the position of the problem of an execution error
<?php
$stid = oci_parse($conn, "select does_not_exist from dual");
$r = oci_execute($stid);
if (!$r) {
$e = oci_error($stid); // For oci_execute errors pass the statement handle
print htmlentities($e['message']);
print "
<pre>
";
print htmlentities($e['sqltext']);
printf("
%".($e['offset']+1)."s", "^");
print "
</pre>
";
}
?>
PHP Documentation Group OCI_ERROR(3)