Icon View Incident Report

Serious Serious
Reported By: David Cornelius
Reported On: 3/31/2008
For: Version 1.09 Build 1
# 2587 INSERT..SELECT Statements with Constant Value as First Select Column Not Working Properly

It appears that when I execute the following SQL statement to copy records with a new value, that if there are several records that match the WHERE clause, there will be several new records in the table (as expected) but only the first of those will have field1 set to the 'constant-value'.

Since the SELECT statement by itself with a 'constant-value' works fine, the work around is to put the SELECT clause into a CURSOR with a WHILE NOT EOF loop and select each field into a variable, then use the explicit form of the INSERT command inside the WHILE loop.

 INSERT INTO TableA (field1, field2, field3)
 SELECT 'constant-value', field2, field3 
   FROM TableB WHERE field3 = 'XYZ'



Comments Comments and Workarounds
Thanks to David for a viable workaround.


Resolution Resolution
Fixed Problem on 3/31/2008 in version 1.09 build 2


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image