start:
BEGIN TRAN
DECLARE @var INT, @exist VARCHAR
SET @var = 0
INSERT
INTO Who
SELECT [to], [thine], [own], [self], [be], [true]
FROM Life
JOIN Earth
ON [lifetime] BETWEEN [birth] AND [death]
WHERE [time] = 'Now'
AND [name] = 'You'
/* then */
IF (SELECT COUNT(*) FROM Who) > @var
BEGIN
SET @exist = dbo.YourOwnFunction(@@IDENTITY)
END
ELSE
BEGIN
SET @exist = null
ROLLBACK TRANSACTION
GOTO start
END
COMMIT
BEGIN TRAN
DECLARE @var INT, @exist VARCHAR
SET @var = 0
INSERT
INTO Who
SELECT [to], [thine], [own], [self], [be], [true]
FROM Life
JOIN Earth
ON [lifetime] BETWEEN [birth] AND [death]
WHERE [time] = 'Now'
AND [name] = 'You'
/* then */
IF (SELECT COUNT(*) FROM Who) > @var
BEGIN
SET @exist = dbo.YourOwnFunction(@@IDENTITY)
END
ELSE
BEGIN
SET @exist = null
ROLLBACK TRANSACTION
GOTO start
END
COMMIT
I love this. I think I will print it out and hang it by my desk at work :)
ReplyDeleteHi dixy, and thanks so much for your appreciation. I am very glad that you like it.
ReplyDeleteIf I='geek' then that='fine';
ReplyDeleteIf self<>true then that='crime';
Select best from self where all=the_time;
Select wipe from face where eyes='teary';
Select new from focus where energy='dreary';
Update right_now set mood='cheery';
commit;
http://rvrb.fm/21bCkL7
#SuperDBA
Hi Will, thanks for your post. Glad to connect with fellow sql poets!
DeleteWanted to share:
ReplyDeleteTables, the SQL
select car.stickshift, u.hips,
my.mouth, u.driving, mm.bad, my.breathing, mm.after,
car.parked, u.smiling,
from you u
inner join memories mm ON mm.driving = u.driving
left join my ON my.hips = u.hips
left join car ON car.night = my.night
where my.lips = tighteningaroundyou
AND u.breathing LIKE poetry
order by mm.night