the below script contains sql query and after executed it sends the output of the query (output.txt) to an email body with conditional subject line based on the output of all_counts_match.txt.
i want to make this script generic so that it can accept the sql file as parameter and can be reuse for any other sql query and generates the output in a same way as it does..the problem is there are two sql queries so how to achive this?
I like to call a shell script from pl/sql proceduere and i have to use the shell script return value in that procedure. i am using oracle 9i and cygwin.
can any one suggest me how can i do this (0 Replies)
I would like to call the shell script from pl/sql and i need to uses the value returned by the shell script in pl/sql procedure.
can any one suggest me how can i do that? (3 Replies)
Hello,
I am doing a shell script which contain a pl/sql loop to search for 3 values, i would like to call another shell script inside this sql loop each time it find the values. so how can i call shell script from pl/sql using its variables, any idea?
Here is idea about the code:
my... (1 Reply)
Hi Experts,
I want to call script_name.ksh as many time as id in customer table and also pass it as a parameter to script.
someting Like below.
for i in select id from customer
do
./script_name.ksh $i &
done
I have figured out how to have ID from customer but now how to call... (3 Replies)
Hi Experts:
I have a shell script that's kicked off by cron. Inside this shell script, I need to kick off two or more oracle sql scripts to process different groups of tables. And when both sql scripts are done, I will continue in the shell script to do other things like checking processing... (3 Replies)
Hi i am not able to connect sqlplus
my script is as follows
$ORACLE_HOME/bin/sqlplus << ! > /tmp/extract/DM.txt
and output is
SQL*Plus: Release 11.1.0.7.0 - Production on Wed Jan 18 02:53:54 2012
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Enter user-name: t175481... (1 Reply)
Hi Guys,
I need to write a simple shell script which will generate a .csv file/report by calling .sql file inside a shell script.
Can somebody help me on this.
Thanks in advance!
Regards,
LK (7 Replies)
Hi,
I need help in writing a shell script which can read data from a text file (Cancel_ID.txt) and then calls sqlplus session (Cancel.sql) with the first line parameter of the text file ("0322600453") till all rows are not completed.
... (4 Replies)
I know this question is out there in many forums, but I tried all the combinations in vain.
I'm basically trying to call a sql script from a shell script.
Below is my sql script (plsql.sql)
DELCARE
v_empno NUMBER := '&empno';
BEGIN
select ename,sal from emp where empno = v_empno;... (3 Replies)
HI Experts,
I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into
the table.
Also i... (1 Reply)
Discussion started by: sam1234
1 Replies
LEARN ABOUT PHP
pdo.query
PDO.QUERY(3) 1 PDO.QUERY(3)PDO ::query - Executes an SQL statement, returning a result set as a PDOStatement object
SYNOPSIS
public PDOStatement PDO::query (string $statement)
DESCRIPTION
PDOStatement PDO::query (string $statement, int $PDO::FETCH_COLUMN, int $colno) PDOStatement PDO::query (string $statement, int
$PDO::FETCH_CLASS, string $classname, array $ctorargs) PDOStatement PDO::query (string $statement, int $PDO::FETCH_INTO, object
$object)
PDO.query(3) executes an SQL statement in a single function call, returning the result set (if any) returned by the statement as a
PDOStatement object.
For a query that you need to issue multiple times, you will realize better performance if you prepare a PDOStatement object using PDO.pre-
pare(3) and issue the statement with multiple calls to PDOStatement.execute(3).
If you do not fetch all of the data in a result set before issuing your next call to PDO.query(3), your call may fail. Call PDOState-
ment.closeCursor(3) to release the database resources associated with the PDOStatement object before issuing your next call to
PDO.query(3).
Note
Although this function is only documented as having a single parameter, you may pass additional arguments to this function. They
will be treated as though you called PDOStatement.setFetchMode(3) on the resultant statement object.
PARAMETERS
o $statement
- The SQL statement to prepare and execute. Data inside the query should be properly escaped.
RETURN VALUES PDO.query(3) returns a PDOStatement object, or FALSE on failure.
EXAMPLES
Example #1
Demonstrate PDO::query
A nice feature of PDO.query(3) is that it enables you to iterate over the rowset returned by a successfully executed SELECT state-
ment.
<?php
function getFruit($conn) {
$sql = 'SELECT name, color, calories FROM fruit ORDER BY name';
foreach ($conn->query($sql) as $row) {
print $row['name'] . " ";
print $row['color'] . " ";
print $row['calories'] . "
";
}
}
?>
The above example will output:
apple red 150
banana yellow 250
kiwi brown 75
lemon yellow 25
orange orange 300
pear green 150
watermelon pink 90
SEE ALSO PDO.exec(3), PDO.prepare(3), PDOStatement.execute(3).
PHP Documentation Group PDO.QUERY(3)