Board index » delphi » Problem Running An Insert Query With Sub-Select Statement

Problem Running An Insert Query With Sub-Select Statement

Hello All !

I am using Oracle 8 and T.O.A.D. to test a query.
When I attempt to run the query, I am getting an
ORA-00936 error message which states "expression missing".  Can someone take
a look at the following query
and tell me if you see anything that would prevent this query from running?

Thanks,
Everett

INSERT INTO DISBURSE_DUP_PARCEL_RPT@LINK1
(JOB_ID_KEY, JOB_CREATION_DATETIME, ORGANIZATION_NUMBER, LENDER_NUMBER,
LENDER_PAYEE_CODE,PAYEE_PARCEL_NUMBER,
LOAN_NUMBER, ERROR_MESSAGE, PAYEE_CODE,LSS_TAX_TYPE,SEQUENCE_NUMBER)

VALUES(:JOBIDKEY, :JOBDATETIME, (SELECT ORGANIZATION_NUMBER, LENDER_NUMBER,
LENDER_PAYEE_CODE,PAYEE_PARCEL_NUMBER, LOAN_NUMBER, ERROR_MESSAGE,
PAYEE_CODE,LSS_TAX_TYPE,SEQUENCE_NUMBER
FROM DISBURSE_DUP_PARCEL_WORK@LINK2
WHERE ORGANIZATION_NUMBER = :ORGANIZATIONUMBER))

 

Re:Problem Running An Insert Query With Sub-Select Statement


You can uses values with values_list or subquery, but not both
Insert into X [(field_list)] values ( value_list )
or
Insert into X [(field_list)] select_statement
Try this

INSERT INTO DISBURSE_DUP_PARCEL_RPT@LINK1
(JOB_ID_KEY, JOB_CREATION_DATETIME, ORGANIZATION_NUMBER,
LENDER_NUMBER,
LENDER_PAYEE_CODE,PAYEE_PARCEL_NUMBER,
LOAN_NUMBER, ERROR_MESSAGE, PAYEE_CODE,LSS_TAX_TYPE,SEQUENCE_NUMBER)

Select :JOBIDKEY, :JOBDATETIME, ORGANIZATION_NUMBER, LENDER_NUMBER,
LENDER_PAYEE_CODE,PAYEE_PARCEL_NUMBER, LOAN_NUMBER, ERROR_MESSAGE,
PAYEE_CODE,LSS_TAX_TYPE,SEQUENCE_NUMBER
FROM DISBURSE_DUP_PARCEL_WORK@LINK2
WHERE ORGANIZATION_NUMBER = :ORGANIZATIONUMBER

--
Vents Lauva
vents.la...@ventspils.gov.lv

"Everett" <Everett.Crock...@zcsterling.com_no_spam_please> wrote in
message news:85lg3r$7lj18@bornews.borland.com...

Quote
> Hello All !

> I am using Oracle 8 and T.O.A.D. to test a query.
> When I attempt to run the query, I am getting an
> ORA-00936 error message which states "expression missing".  Can
someone take
> a look at the following query
> and tell me if you see anything that would prevent this query from
running?

> Thanks,
> Everett

> INSERT INTO DISBURSE_DUP_PARCEL_RPT@LINK1
> (JOB_ID_KEY, JOB_CREATION_DATETIME, ORGANIZATION_NUMBER,
LENDER_NUMBER,
> LENDER_PAYEE_CODE,PAYEE_PARCEL_NUMBER,
> LOAN_NUMBER, ERROR_MESSAGE, PAYEE_CODE,LSS_TAX_TYPE,SEQUENCE_NUMBER)

> VALUES(:JOBIDKEY, :JOBDATETIME, (SELECT ORGANIZATION_NUMBER,
LENDER_NUMBER,
> LENDER_PAYEE_CODE,PAYEE_PARCEL_NUMBER, LOAN_NUMBER, ERROR_MESSAGE,
> PAYEE_CODE,LSS_TAX_TYPE,SEQUENCE_NUMBER
> FROM DISBURSE_DUP_PARCEL_WORK@LINK2
> WHERE ORGANIZATION_NUMBER = :ORGANIZATIONUMBER))

Re:Problem Running An Insert Query With Sub-Select Statement


WHERE ORGANIZATION_NUMBER = :ORGANIZATIONUMBER))
You don't supply a value for this parameter.  If you mean  blahblah
@link1.organizationumber say so.

John

Other Threads