[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Temp table missing
- Subject: Temp table missing
- From: Arjan Hoornstra <ahoor@YAHOO.COM>
- Date: Fri, 11 Feb 2000 03:43:29 -0800
Hello all,
Something weird happens... my temptable seems to be
missing. I've tried several things but I can't reach
it in the update. Here's some code example:
begin-setup
ask inputdate
ask test
use mydb
begin-sql
select c.ad
, c.adinsert
, i.publication
into ##tempadinsert
from complaint c, adinsert i
where c.ad = i.ad
and c.adinsert = i.adinsert
and c.credate <= '{inputdate}'
and c.processed = 0
and i.blocked = 0
and i.totalprice != 0
end-sql
end-setup
begin-program
do initialise
do start_log
do mod_temptable
do find_ad
do update_complaint
do end_log
end-program
begin-procedure find_ad
begin-select
tc.ad &ad
do find_data ! calls stored procedure
from ##tempadinsert tc
, pubschedule ps
where tc.publication = ps.publication
and tc.ad = ps.ad
end-select
end-procedure !find_ad
begin-procedure update_complaint
begin-sql -XP on-error = update_error('Update table
complaint failed')
update complaint
set processed = 1
from ##tempadinsert ta, complaint c
where c.adinsert = ta.adinsert
end-sql
end-procedure !update_complaint
The select goes well, but the update fails because
'table #tempadinsert does not exist'. I tried using a
variable
from [$temptable] ta, complaint c
but the same error. Also using a stored procedure
results in the same error. What happens here???
I'm using SQR 3.0.12 on Sybase 11.0.3.
Arjan
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com