Hi all,
I am having problem with a shell script. I have a couple of csv files. The shell script will do some operation on them, create a sql file which will then be called by sqlplus. The problem is to gracefully exit sqlplus at the end of every operation as I do not want to hang on to the... (4 Replies)
Hi All,
this small script is written to recognize user input character.. it is in small case .. upeer case or is a number... but when i input first capital letter say A.. it always gives small character.... what is the problem.
#!/bin/bash
echo "Enter the character"
read a
case $a in
)... (2 Replies)
Hello Gurus,
I've been tasked with solving a problem at my new job and I'm stumped. We've got a script that dynamically builds an oracle export parameter files and then runs export from the shell. it runs fine when using the shell, but will NOT run (fails in one spot everytime) when entered... (1 Reply)
Hi All,
I need to select one column from a table based upon the passed in parameter.
I tried this:
sqlplus -silent $MISP_USER << EOF
set feedback off;
set verify off;
set sqlprompt ""
SELECT mail_flag
FROM dailyjobs
WHERE job_name = '$1';
exit 0
EOF
exit... (1 Reply)
If I recall, when I used informix I could do a sql statement like:
SELECT Value from Table WHERE ID in (100,200,300);
How do I do this in Oracle? I believe I am using Oracle 10 if that matters.
Thanks. (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Create a phonebook program.
It should use functions to perform the required tasks. It should be menu-based,... (1 Reply)
hi Guys,
i have a problem with oracle query in my unix script..
I'm getting the following error while executing..
./logtab.sh: sqlplus -s "pmutv/pmutv1" << EOFSQL^Jset head off^Jinsert into... (2 Replies)
Hello,
I have a script to get the information from database, however, it's look like the loop is not work, can someone help? :confused:
echo Input file list to check:
read filelist
for file in 'cat $filelist.txt'
do
echo "select FILENAME from FILE_TABLE where filename like '${file}'%;" >>... (9 Replies)
Hello Frens,
I am a newbie to shell scripting. I need a help on creating a for loop script (shell script) for removing files. I have a table called a_table with column name fil_name which contains all the files that need to be removed.
Thank you in advance (6 Replies)
Hi All,
I am writing an if statement to check multiple conditions, but when I try to execute the script it is breaking at the point of if statement by showing the issue below.
Code I am using is given below.
if -a ]
then
....
else
...
fi
I am not understanding... (3 Replies)
Discussion started by: ginrkf
3 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)