How do I create a K Shell which would silently (without user input) logon to Oracle and
run an SQL script?
Any help will be greatly appreciated.
Steve (1 Reply)
Hi,
In my shell script when I am using mv command using shell variables it is giving me error of syntax. Following is the shell script:
file_edifice="*.txt"
fquote="'"
fdquote=\"
for file in $file_edifice
do
file_name=$fquote$file$fquote
tofile_name=`date... (5 Replies)
Hi all,
I need a shell script which runs a sql script but I couldn't find how to finish it. This is the code that I have:
#! /usr/bin/ksh
export SHELL=/bin/ksh
export ORACLE_SID=database
export ORACLE_HOME=/opt/oracle/product/9.2.0.8
sqlplus user <<EOF @/path/path/path/scriptname.sql... (3 Replies)
Hi,
My script is running with no erros but not giving any output can anyonehelp.
#!/bin/ksh
. /home/application/bin/application.env
OUTFILE=Result.txt
PROD_PASSWORD=`${GET_PWD} -f ${PWD_FILE_PATH} -s ${PROD_SERVER} -u ${PROD_USER}`
echo "1)To get the book last loaded details "
read... (7 Replies)
HI,
I have a strange problem. A shell script that runs fine on solaris. when i ported to linux, it started hanging.
here is the core of the script
CFG_FILE=tab25.cfg
sort -t "!" -k 2 ${CFG_FILE} | egrep -v "^#|^$" | while IFS="!" read a b c
do
#echo "jobs output"
#jobs
#echo "jobs... (13 Replies)
Hi All,
Is there any way to monitor a command inside shell script ? I have a script inside which I have a tar command which zips around 200GB data.
tar zcvf $Bckp_Dir/$Box-BaseBackup-$Day.tar.gz * --exclude 'dbserver_logs/*' --exclude postmaster.pid --exclude 'pg_xlog/*'
I want to... (3 Replies)
Hi, I'm new to these forums, and I'm hoping that someone can solve this problem...
To make things short:
I have DD-wrt set up on a router.
I'm trying to run a script in CRON that fetches the daily password from my database using SSH.
CRON is set like so(in web interface):
* * * *... (4 Replies)
OS version : AIX 6.1
Shell : Korn
When you 'postfix' a command with ampersand (&) , it is supposed to run in the background and give you back the control.
I tested this with ping command (by default it pings every 1 second )
After I ran the below ping command with ampersand, I pressed... (3 Replies)
hii,,
I am trying to automate jira. during my scripting using bash script, in the terminal i got the terminal message like this:
"Configure which ports JIRA will use.
JIRA requires two TCP ports that are not being used by any other
applications on this machine. The HTTP port is where you... (1 Reply)
Hi,
i have a source file and have 3 columns and separated by "|" .i want to split this 3 columns in different variable.When i am executing this values indivisually giving correct result but when the same execute inside a for loop,it's giving issues.
Src file(jjj.txt)
-------... (8 Replies)
Discussion started by: raju2016
8 Replies
LEARN ABOUT PHP
db2_rollback
DB2_ROLLBACK(3) 1 DB2_ROLLBACK(3)db2_rollback - Rolls back a transactionSYNOPSIS
bool db2_rollback (resource $connection)
DESCRIPTION
Rolls back an in-progress transaction on the specified connection resource and begins a new transaction. PHP applications normally default
to AUTOCOMMIT mode, so db2_rollback(3) normally has no effect unless AUTOCOMMIT has been turned off for the connection resource.
PARAMETERS
o $connection
- A valid database connection resource variable as returned from db2_connect(3) or db2_pconnect(3).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Rolling back a DELETE statement
In the following example, we count the number of rows in a table, turn off AUTOCOMMIT mode on a database connection, delete all of
the rows in the table and return the count of 0 to prove that the rows have been removed. We then issue db2_rollback(3) and return
the updated count of rows in the table to show that the number is the same as before we issued the DELETE statement. The return to
the original state of the table demonstrates that the roll back of the transaction succeeded.
<?php
$conn = db2_connect($database, $user, $password);
if ($conn) {
$stmt = db2_exec($conn, "SELECT count(*) FROM animals");
$res = db2_fetch_array( $stmt );
echo $res[0] . "
";
// Turn AUTOCOMMIT off
db2_autocommit($conn, DB2_AUTOCOMMIT_OFF);
// Delete all rows from ANIMALS
db2_exec($conn, "DELETE FROM animals");
$stmt = db2_exec($conn, "SELECT count(*) FROM animals");
$res = db2_fetch_array( $stmt );
echo $res[0] . "
";
// Roll back the DELETE statement
db2_rollback( $conn );
$stmt = db2_exec( $conn, "SELECT count(*) FROM animals" );
$res = db2_fetch_array( $stmt );
echo $res[0] . "
";
db2_close($conn);
}
?>
The above example will output:
7
0
7
SEE ALSO db2_autocommit(3), db2_commit(3).
PHP Documentation Group DB2_ROLLBACK(3)