dbTalk Databases Forums  

Looping thru Insert from SELECT, ASA 10.0.1.3415

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Looping thru Insert from SELECT, ASA 10.0.1.3415 in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
P Merritt
 
Posts: n/a

Default Looping thru Insert from SELECT, ASA 10.0.1.3415 - 09-02-2009 , 04:34 PM






We've code to create copies of a set of records that periodically fails..
not always, of course, just periodically.. with the error message: Column
'ha_diam_id' not found.

Each record has 59 fields, 2 are keys. The loop is coded in Cold Fusion and
I'm using JDBC. I first thought the problem was with coding the Insert in
Cold Fusion so changed it to use a stored procedure instead.. passing key
values into the stored procedure. but the problem occurred again

PROCEDURE "tr"."sp_copy_rx_imp"( IN @new_rc_id INT, IN @old_rc_id INT, IN
@tooth INT

BEGIN


INSERT INTO rx_imp(rc_id,tooth.....)SELECT @new_rc_id,tooth,...FROM rx_imp
WHERE rc_id = @old_rc_id AND tooth = @tooth
END

I've double checked to field lists to be sure they are identical.. it always
fails on ha_diam_id.. the 14th item. There are a fair number of Foreign Keys
defined on fields in the record. Any ideas on a work around?

Reply With Quote
  #2  
Old   
Nick Elson [Sybase iAnywhere]
 
Posts: n/a

Default Re: Looping thru Insert from SELECT, ASA 10.0.1.3415 - 09-11-2009 , 02:23 PM






You might want to check out some of the more recent fixes
to see if the pattern changes with those.

One fix that comes to mind is the one for Engineering change#
454319 which applies to problems with procedures and is a
little bit random [which was checked into 10.0.1#3470] but I
don't see the conditions around your variable or target alias
shows this might be the case. Do make sure all your
proc. parameters are used exactly the same way they are
declares (case of the characters included).

There may be some others that may fix.

If that does not help prevent this problem, then submitting
some sort of way to reproduce this in a support case
may give engineering a way to drill into this more deeply.

"P Merritt" <pmerritt (AT) transcendonline (DOT) com> wrote

Quote:
We've code to create copies of a set of records that periodically fails..
not always, of course, just periodically.. with the error message: Column
'ha_diam_id' not found.

Each record has 59 fields, 2 are keys. The loop is coded in Cold Fusion
and
I'm using JDBC. I first thought the problem was with coding the Insert in
Cold Fusion so changed it to use a stored procedure instead.. passing key
values into the stored procedure. but the problem occurred again

PROCEDURE "tr"."sp_copy_rx_imp"( IN @new_rc_id INT, IN @old_rc_id INT, IN
@tooth INT

BEGIN


INSERT INTO rx_imp(rc_id,tooth.....)SELECT @new_rc_id,tooth,...FROM rx_imp
WHERE rc_id = @old_rc_id AND tooth = @tooth
END

I've double checked to field lists to be sure they are identical.. it
always
fails on ha_diam_id.. the 14th item. There are a fair number of Foreign
Keys
defined on fields in the record. Any ideas on a work around?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.