Copy link to clipboard
Copied
Hi when i tried to run this query i am getting error as
[Macromedia][SQLServer JDBC Driver][SQLServer]The multi-part identifier "l.cpt_dpt_cd" could not be bound.
here is the code
please help me to solve this thanks,
<cfquery name="Update" datasource="#db#">
UPDATE dbo.di_audit_corp_upc_tbl
SET
cpt_dpt_cd = l.cpt_dpt_cd
, cpt_com_cd = l.cpt_com_cd
, sub_com_cd = l.sub_com_cd
, cas_upc_no = '0000000000000'
, con_upc_tx = l.pid_lng_dsc_tx
, pid_lng_dsc_tx = l.pid_lng_dsc_tx
, pid_sht_dsc_tx = l.pid_sht_dsc_tx
, rev_by = l.rev_by
, rev_dt = l.rev_dt
</cfquery>
<cfquery name="Select" datasource="#db#">
SELECT *
FROM [dbo].[di_audit_corp_upc_ldr_tbl] l
INNER JOIN dbo.di_audit_corp_upc_tbl u ON l.con_upc_no = u.con_upc_no
</cfquery>
Copy link to clipboard
Copied
There is a problem with your query that field doesn't exist check the
names in your db
Sincerely,
Michael
Copy link to clipboard
Copied
What you are doing in the update query?
<cfquery name="Update" datasource="#db#">
UPDATE dbo.di_audit_corp_upc_tbl SET cpt_dpt_cd = l.cpt_dpt_cd
What you u have in l?Whether l is a structure. Try to dump the l .
If datatype of "l.cpt_dpt_cd" is string, then try to use like this
UPDATE dbo.di_audit_corp_upc_tbl SET cpt_dpt_cd = "#l.cpt_dpt_cd#"
Note: Always try to use CFQUERYPARAM in ur queries. It will help u to prevent sql injection attacks