Rolling back SQL transaction


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Rolling back SQL transaction
# 1  
Old 06-28-2012
Rolling back SQL transaction

Can some one help me related to .sql file issue.

I have a .sqlfile and tried to read the file thru unix. In the .sqlfile I have error rows as well and when error comes I dont want to proceed further and need to roll back all the transactions.

sample .sql file below


Code:
insert into
test values (9);
update test set id=9 where id=10;
updte test set id=3;
insert into
test values (1);
insert into test values (1);

I tried with "WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK" option also. Can some one help

Last edited by radoulov; 06-28-2012 at 06:37 PM..
# 2  
Old 06-28-2012
Quote:
Originally Posted by sri_aue
Can some one help me related to .sql file issue.
Perhaps, if you start your own thread instead of hijacking another's. It's basic netiquette not to do that.

Regards,
Alister
# 3  
Old 06-28-2012
Quote:
Originally Posted by alister
Perhaps, if you start your own thread instead of hijacking another's. It's basic netiquette not to do that.
New thread opened.
Thanks!
This User Gave Thanks to radoulov For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Difference between BEGIN TRANSACTION & START TRANSACTION?

What's the difference between BEGIN TRANSACTION vs START TRANSACTION? Also goes for COMMIT TRANSACTION vs COMMIT? (0 Replies)
Discussion started by: dan139
0 Replies

2. UNIX for Dummies Questions & Answers

Middled Rolling average

Dear Help, The input file is below --- 13 2238422.00000 101083.00000 0.89024 0.00416 0.00467 14 2238318.00000 101090.00000 0.89100 0.00416 0.00467 15 2238209.00000 101100.00000 0.90964 0.00424 0.00466 16 2238104.00000 101104.00000 0.97568 0.00463 0.00475 17 2237991.00000 101113.00000... (8 Replies)
Discussion started by: Indra2011
8 Replies

3. Shell Programming and Scripting

Need to pass Oracle SQL output to Linux and back... Help!

Hi all, Hopefully you can help. This is what I'm trying to achieve: Obtain a list of usernames out of an Oracle Database Based on this list, link each username with an Oracle Internet Directory (OID) GUID Using the username and GUID perform a database update for all users Here are the... (7 Replies)
Discussion started by: exm
7 Replies

4. Shell Programming and Scripting

Sql command inside shell script runs without giving anything back as outout

#!/bin/sh # This script returns the number of rows updated from a function echo "The execution is starting ....." sqlplus -silent $UP <<EOF set serveroutput on set echo off set pagesize 0 VAR no_rows_updated NUMBER; EXEC :no_rows_updated :=0; DECLARE CURSOR c_update is SELECT * FROM... (4 Replies)
Discussion started by: LoneRanger
4 Replies

5. Linux

Rolling Back an Update

I am writing a software product and hope that it will work on a variety of Linux distributions. At the moment, I am trying to create some kind of Linux version of patches/upgrades of installed software. Gathering information on available updates isn't hard, nor is installation of updates, but I... (27 Replies)
Discussion started by: Brandon9000
27 Replies

6. AIX

rolling back Technology Level

Hi, is it possible to roll back currently updated Technology level ? what are steps required? Regards, Manoj (2 Replies)
Discussion started by: manoj.solaris
2 Replies

7. Shell Programming and Scripting

Append transaction header lines to same transaction's detail lines

Hi guys, I was wondering if someone can give me a hand in helping me append transaction header line in a file at the end of the transaction detail lines. Basically, I have a file that looks like this: FHEAD File1 THEAD TRANS1-blah TDETL HI1 TDETL HI2 TDETL HI3 TTAIL TRANS1-blah THEAD... (3 Replies)
Discussion started by: rookie12
3 Replies

8. Shell Programming and Scripting

log rolling

Hi, I'm thinking of running a script via cron (every hour) to do the log rolling. The file is "file.txt" and there going to be 10 files rolling (file.txt.n). The file is being written constantly by an application. The script will do the following: 1. cat file.txt > file.txt.0 2. cat... (0 Replies)
Discussion started by: chaandana
0 Replies

9. UNIX for Dummies Questions & Answers

Rolling back time

Hi all, Have a small problem. Back in October the pervious sys-admin (of a client's company) made the necessary adjustments to the system clock for daylight savings (Sydney time - +11 GMT). As far as I can gather, they just amended the time - NO TIMEZONE !?! Is there an effective and safe... (5 Replies)
Discussion started by: Cameron
5 Replies
Login or Register to Ask a Question