Rollback - SQL (1 Viewer)

pr2-eugin

Super Moderator
Local time
Today, 10:42
Joined
Nov 30, 2011
Messages
8,494
Hello,

I am trying to apologize to a friend of mine, (who is an SQL admin). We had quiet an argument exchange because of a hag between us :banghead:, abuse were hurled over (mainly from my end). So I sent him a sorry message, for which he ended up shouting at me. So I tried to explain, we are not really talking, but for the moment all is well.

I was thinking something witty using some SQL statements to apologize. I vaguely remember how to use PL/SQL. Now that I have divulged into Access, I can hardly recollect them anymore. So if someone could help me construct this statement?

This is how I want it to happen. Before arguments (create a transaction maybe) - Insert abuse, name callings - Rollback to the transaction - Insert apology - Commit transaction.

I know this is not the paramount of issues the Forum has, but a fun way (I think) to apologize. Lol. So my choice of using the Watercooler section.

PS: If you are coming to the AWF Meeting, and have answered this question, the first beer is on me ! :D
 

vbaInet

AWF VIP
Local time
Today, 10:42
Joined
Jan 22, 2010
Messages
26,374
I was thinking something witty using some SQL statements to apologize. I vaguely remember how to use PL/SQL. Now that I have divulged into Access, I can hardly recollect them anymore. So if someone could help me construct this statement?

This is how I want it to happen. Before arguments (create a transaction maybe) - Insert abuse, name callings - Rollback to the transaction - Insert apology - Commit transaction.
We're in the same boat. I don't remember the proper construct of PL/SQL because I've not used for some time so I can't really help. My PL/SQL books are buried in a place I can't even reach. :)

I think the final commit would be too forceful. Perhaps, give him the choice to commit the transaction? Also I think the first Inserts of abuse should be poorly constructed (meaning it wasn't intentional) so that a commit fails. Maybe you could create a recordset which will reminisce on the good times you've had ;)

Ask Mailman (i.e. namliaM) he uses Oracle on a daily basis.
 

pr2-eugin

Super Moderator
Local time
Today, 10:42
Joined
Nov 30, 2011
Messages
8,494
I think the final commit would be too forceful. Perhaps, give him the choice to commit the transaction? Also I think the first Inserts of abuse should be poorly constructed (meaning it wasn't intentional) so that a commit fails. Maybe you could create a recordset which will reminisce on the good times you've had ;)
This I LOVE ! Just need it coded lol. Somebody please help me !
Ask Mailman (i.e. namliaM) he uses Oracle on a daily basis.
namliaM has not been online for quiet some time. As creepy as it sounds, I do miss him. LOL.
 

vbaInet

AWF VIP
Local time
Today, 10:42
Joined
Jan 22, 2010
Messages
26,374
Ask Mailman (i.e. namliaM) he uses Oracle on a daily basis.
* MarkK (formerly lagbolt)
* TheDocMan
* Galaxiom
* gemma-the-husky

One of those guys might have used or are still using Oracle.
 

vbaInet

AWF VIP
Local time
Today, 10:42
Joined
Jan 22, 2010
Messages
26,374
Let's not forget to add Paul (aka pbaldy) too :p
 

vbaInet

AWF VIP
Local time
Today, 10:42
Joined
Jan 22, 2010
Messages
26,374
I know for sure the Mark and Galaxiom like a bit of a challenge so reach out to them. TheDocMan is just very busy protecting federal data and gemma-the-husky pops in once in while and as for Paul, well who knows ;)
 

pr2-eugin

Super Moderator
Local time
Today, 10:42
Joined
Nov 30, 2011
Messages
8,494
I have just sent a PM to Paul. Waiting for his attention. I might drop a line to Mark & Galaxiom. ;)
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:42
Joined
Aug 30, 2003
Messages
36,124
I'm afraid I won't be much help, as I've never used Oracle. :(
 

jdraw

Super Moderator
Staff member
Local time
Today, 05:42
Joined
Jan 23, 2006
Messages
15,379
Paul,

Just a thought, but have you tried putting some plain English terms/phrases to paper.
I'm sure there are creative minds in the list that could take some of those a concoct
"a sort of" SQL message from same.

As I said --just a thought.
 

vbaInet

AWF VIP
Local time
Today, 10:42
Joined
Jan 22, 2010
Messages
26,374
Well you know what Network Admins are like, they are very serious about syntax, especially those Oracle db Admins. So this would be a nice light-hearted way to say sorry if constructed properly :)
 

pr2-eugin

Super Moderator
Local time
Today, 10:42
Joined
Nov 30, 2011
Messages
8,494
I'm afraid I won't be much help, as I've never used Oracle. :(
You let me down there. LOL. Just joking. It's alright Paul.
have you tried putting some plain English terms/phrases to paper.
JD, I really would like something like,
Before arguments (create a transaction maybe) - Insert abuse, name callings - Rollback to the transaction - Insert apology - Commit transaction.
I also liked vbaInet's idea of doing something like this too.
I think the final commit would be too forceful. Perhaps, give him the choice to commit the transaction? Also I think the first Inserts of abuse should be poorly constructed (meaning it wasn't intentional) so that a commit fails. Maybe you could create a recordset which will reminisce on the good times you've had ;)
I thought this was plain enough LOL. I will try to write a little bit more in descriptive manner. I have created the final question.
Code:
SELECT nitin.AcceptApology, nitin.StayTheSameWithPaul 
FROM nitin
WHERE nitin.PaulAplogized = True AND nitin.PaulsIntention = False ;
Nitin is my friend's name lol.
 

jdraw

Super Moderator
Staff member
Local time
Today, 05:42
Joined
Jan 23, 2006
Messages
15,379
Hmm
Code:
SELECT nitin.AcceptApology, nitin.StayTheSameWithPaul 
FROM nitin
WHERE nitin.PaulAplogized = True AND 
nitin.PaulsIntention = (Select Max(Intention) from WellIntentioned)
And Exists(.....more here)
;
 

MarkK

bit cruncher
Local time
Today, 02:42
Joined
Mar 17, 2004
Messages
8,180
No, I don't know any Oracle. But wouldn't you rather use code? Like, is he a programmer?

With SQL you create a command to return records, but you can't really communicate the results. With code you can have IF ElseIF blocks, Select Case statements, you can evaluate expressions, assign constants, and create a much richer set of sequential communications. IMO.
 

vbaInet

AWF VIP
Local time
Today, 10:42
Joined
Jan 22, 2010
Messages
26,374
He's friend is an Oracle Database Admin Mark.

In PL/SQL you can communicate in code too - Loops, If..End If, Select..Case statements, Recordsets, Transactions, variable assignments the lot. I just don't remember the proper syntax.
 

vbaInet

AWF VIP
Local time
Today, 10:42
Joined
Jan 22, 2010
Messages
26,374
Probably a start:
Code:
DECLARE

     paul    VARCHAR2(4) = "idiot"
     nitin   VARCHAR2(5) = "innocent";

BEGIN

     INSERT INTO tbl_Nitin
     	    (friend1, friend2, friend3, ... , friendN)
     SELECT apology1, apology2, apology3, ... , apologyN 
     FROM   tbl_Paul
     WHERE  ImSorry = True

EXCEPTION

     WHEN TOO_MANY_ROWS AND NITIN_STILL_ANGRY THEN	
          WHILE (nitin = "angry") = True
               reminisce_on_good_times = True;
	       dbms_output.put_line('let me buy you lunch');
          LOOP;
     ;

END;
/
Note, I'm not calling you names but he'll appreciate the variable value ;)
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 19:42
Joined
Jan 20, 2009
Messages
12,851
Sorry I am Access with a bit of SQL Server. No Oracle.
 

jdraw

Super Moderator
Staff member
Local time
Today, 05:42
Joined
Jan 23, 2006
Messages
15,379
@vbaInet

Looks good to me.
 

vbaInet

AWF VIP
Local time
Today, 10:42
Joined
Jan 22, 2010
Messages
26,374
@jdraw: It was all I could come up within the time frame.
 

Users who are viewing this thread

Top Bottom