Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01400: cannot insert NULL into

user5070624Jan 20 2017 — edited Jan 24 2017

I am running a process and it failed on ORA-01400: cannot insert NULL into (...table.field)

When I run the same sql in SQL plus or TOAD, I don't have an issue. On top of that, the sql returns no rows.

I have tried many different ways to solve with no success.

Did anyone encounter an issue like this ?

Please help.

Thanks!

Message was edited by: user5070624 Here is the sql: insert into table_1 SELECT A.BUSINESS_UNIT, A.VOUCHER_ID, 0, A.INVOICE_ID, NVL(LTRIM(regexp_replace(A.INVOICE_ID , '[^0-9]' , '') ,0),' ') , A.INVOICE_DT, A.VENDOR_ID, A.ORIGIN, A.ENDORSER_PARTY,   A.ECQUEUEINSTANCE, A.ECTRANSID, A.ENTERED_DT,   A.VNDR_LOC,   A.GROSS_AMT,   A.POLICY_NUM, A.PACKSLIP_NO , NVL(( SELECT C.PRODUCT FROM PS_VENDOR B,tab_cLASS C WHERE B.SETID = 'SHARE' AND B.VENDOR_ID = A.VENDOR_ID AND B.VENDOR_CLASS = C.VENDOR_CLASS ),' '), ( SELECT B.VENDOR_CLASS FROM PS_VENDOR B WHERE B.SETID = 'SHARE' and B.VENDOR_ID = A.VENDOR_ID ) ,  A.ACCOUNTING_DT FROM PS_VOUCHER A WHERE A.BUSINESS_UNIT= 'abced' AND A.ENTRY_STATUS='P' AND TO_DATE(A.ACCOUNTING_DT,'YYYY-MM-DD') >=TO_DATE('2016-02-02','YYYY-MM-DD') AND A.VOUCHER_ID NOT IN ( SELECT VOUCHER_ID FROM bc_xls_VCHR )  AND A. ECTRANSID NOT IN ('ghi') AND VENDOR_ID NOT IN ('0000000001' ,'00000000002' ,'0000000003')

This sql returns no row The error is SQL Error: ORA-01400: cannot insert NULL into ("PSSYFNU"." table_1"."VENDOR_CLASS")

Message was edited by: user5070624

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 21 2017
Added on Jan 20 2017
41 comments
6,485 views