Insert into mytable (ColA, ColB, ColC)
Select 'NewConstant', ColB, ColC
from mytable
where ColA='OldValue'
Have fun!
Richard
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Thursday, April 19, 2012 10:17 AM
To: midrange-l@xxxxxxxxxxxx
Subject: copying multiple rows
I have multiple rows where Column A is the same. I want to copy those
while changing the value of column A to some constant. For example
Insert into mytable (ColA, ColB, ColC)
Values(
Select 'NewConstant', ColB, ColC
from mytable
where ColA='OldValue')
But I am getting:
SQL State: 42703
Vendor Code: -206
Message: [SQL0206] Column or global variable "ANORDER@xxxxxxxxxxxxx" not
found. Cause . . . . . : "ANORDER@xxxxxxxxxxxxx" was not found as a
column of table *N in *N and was not found as a global variable in *N. If
the table is *N, "ANORDER@xxxxxxxxxxxxx" is not a column of any table or
view that can be referenced. Recovery . . . : Do one of the following
and try the request again: -- Ensure that the column and table names are
specified correctly in the statement. -- If this is a SELECT statement,
ensure that all the required tables were named in the FROM clause. -- If
the column was intended to be a correlated reference, qualify the column
with the correct table designator. -- If the column was intended to be a
global variable, qualify the name with the schema where the global
variable exists or ensure the schema is in the path.
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.