07-29-2016
Is that oracle? Or what? Why shouldn't
set echo off work?
Quote:
... If echo is set to off, SQL statements that are run will not be displayed while setting echo to on will display them. ...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear frnds
My requirement is as follows
-rw-r----- 1 f02 dd 109428250 May 18 14:02 Extracts_20070518104730.zip
-rw-r----- 1 f02 dd 109493187 May 21 13:30 Extracts_20070521091700.zip
-rw-r----- 1 f02 dd 109993058 May 23 14:14 Extracts_20070523085955.zip
-rw-r----- 1... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
2. Shell Programming and Scripting
hi,
can anyone help me by saying how can i spool a unix file.. do we need to specify the pathname as such to spool the file ..
right now, i tried giving like spool filename in the sql prompt.. but its not giving me the required output even if i can see that the command is being executed..
... (2 Replies)
Discussion started by: kripssmart
2 Replies
3. Shell Programming and Scripting
Hi,
I am trying to do this
For i in *.txt
do
sed 'some pattern checking' $i
done
>file
These text files are spool files.And when i find error in these spool files I want to append the text file contents to error.log file.
Or is there any option that I do this sed for only files that... (12 Replies)
Discussion started by: ran16
12 Replies
4. UNIX for Dummies Questions & Answers
HI
Have some problem with spooling out some relatively large number of records (~2-3 mil)
Small table - OK though.
Getting error: SP2 0308: cannot close spool file.
Any thoughts?
sqlplus -s user/pwd << EOF
set term off
set head off
set trims on
set pages 0
set... (1 Reply)
Discussion started by: Leo_NN
1 Replies
5. AIX
Dear Gurus,
Tried searching for some clues in this forum but dont seem to be able to find my answer. :confused:
Anyway i have a quick question:
Today I have produced a messages generated from a application and placed them on the print queue. Before this I had stopped the printer queue, so... (2 Replies)
Discussion started by: lweegp
2 Replies
6. Shell Programming and Scripting
Hi,
Iam a newbie. When I give the below query at SQL prompt.
SQL> select col1||'`ß`'||col2 from tablename where rownum<2;
1-J7WGX`ß`1-7OKC-23
Iam getting ß within appostropies...... If I remove appostropies and give the query it is throwing an error.
If I give the same query in spool as... (1 Reply)
Discussion started by: kknayak
1 Replies
7. Shell Programming and Scripting
hi all,
am trying to write a ksh script which will take a username, password, db instance as input arguments and login to the database using sqlplus and select some data via sql and spool to a file.
problem is that i am using "sqlplus -s" in order to hide the username/password and it doesnt... (8 Replies)
Discussion started by: cesarNZ
8 Replies
8. Shell Programming and Scripting
Hi All,
I have one Question, that is it possible to check the spool output?
What i mean to say is "spool the file only if data exists"
I am trying to fetch data from a sql query, and want to generate a file, on a condition that the file should be generated, only if the output of the sql... (5 Replies)
Discussion started by: spiabhi
5 Replies
9. Shell Programming and Scripting
Hello,
I am trying to spool data from database into a file on solaris through ksh.
Data is getting fetched but the problem is record is getting split in to multiple lines.
excerpt from sql is
whenever sqlerror exit 1;
set define on
set echo off
set feed off
set head off
set... (1 Reply)
Discussion started by: abhi1988sri
1 Replies
10. Shell Programming and Scripting
Hi,
There is a requirement, needs to split the text file based on RC code present in text file.
For this, needs to write a unix shell programing script for the above requirement.
For example in text file, if there are distinct RC codes, then we needs to split into multiple text files. In... (1 Reply)
Discussion started by: Chandra2678
1 Replies
LEARN ABOUT PHP
oci_parse
OCI_PARSE(3) OCI_PARSE(3)
oci_parse - Prepares an Oracle statement for execution
SYNOPSIS
resource oci_parse (resource $connection, string $sql_text)
DESCRIPTION
Prepares $sql_text using $connection and returns the statement identifier, which can be used with oci_bind_by_name(3), oci_execute(3) and
other functions.
Statement identifiers can be freed with oci_free_statement(3) or by setting the variable to NULL.
PARAMETERS
o $connection
- An Oracle connection identifier, returned by oci_connect(3), oci_pconnect(3), or oci_new_connect(3).
o $sql_text
- The SQL or PL/SQL statement. SQL statements should not end with a semi-colon (";"). PL/SQL statements should end with a semi-
colon (";").
RETURN VALUES
Returns a statement handle on success, or FALSE on error.
EXAMPLES
Example #1
oci_parse(3) example for SQL statements
<?php
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
// Parse the statement. Note there is no final semi-colon in the SQL statement
$stid = oci_parse($conn, 'SELECT * FROM employees');
oci_execute($stid);
echo "<table border='1'>
";
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
echo "<tr>
";
foreach ($row as $item) {
echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : " ") . "</td>
";
}
echo "</tr>
";
}
echo "</table>
";
?>
Example #2
oci_parse(3) example for PL/SQL statements
<?php
/*
Before running the PHP program, create a stored procedure in
SQL*Plus or SQL Developer:
CREATE OR REPLACE PROCEDURE myproc(p1 IN NUMBER, p2 OUT NUMBER) AS
BEGIN
p2 := p1 * 2;
END;
*/
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
$p1 = 8;
// When parsing PL/SQL programs, there should be a final semi-colon in the string
$stid = oci_parse($conn, 'begin myproc(:p1, :p2); end;');
oci_bind_by_name($stid, ':p1', $p1);
oci_bind_by_name($stid, ':p2', $p2, 40);
oci_execute($stid);
print "$p2
"; // prints 16
oci_free_statement($stid);
oci_close($conn);
?>
NOTES
Note
This function does not validate $sql_text. The only way to find out if $sql_text is a valid SQL or PL/SQL statement is to execute
it.
SEE ALSO
oci_execute(3), oci_free_statement(3).
PHP Documentation Group OCI_PARSE(3)