Insert query with parameters in oracle db

Hi Team,

I am unable to insert record in oracle db

“insert Into APPS.XXMCL_AP_INV_INT_I00 (I00_ID,TP_ID,SET_ID,RECORD_ID,CONTROL_NUMBER,TEST_INDICATOR,CREATION_DATE,CREATED_BY,LAST_UPDATE_DATE,LAST_UPDATED_BY,SOURCE) values(XXMAP.XXMCL_AP_INV_INT_I00_S.NEXTVAL,‘EDI Manual’,‘810’,‘00’,@Control,NULL,SYSDATE,-1,SYSDATE,-1,‘SOURCE’)”

Hi @anusha2 ,

Try with the below :

“insert Into APPS.XXMCL_AP_INV_INT_I00 (I00_ID,TP_ID,SET_ID,RECORD_ID,CONTROL_NUMBER,TEST_INDICATOR,CREATION_DATE,CREATED_BY,LAST_UPDATE_DATE,LAST_UPDATED_BY,SOURCE) values(XXMAP.XXMCL_AP_INV_INT_I00_S.NEXTVAL,‘EDI Manual’,‘810’,‘00’,”
+Control+
“,NULL,SYSDATE,-1,SYSDATE,-1,‘SOURCE’)”

Hi @anusha2

May be this could be the reason of this error, can you check out the below points

  1. Could be that you are trying to insert NULL values in a column that has a NOT NULL constraint or a primary key constraint. You need to provide a valid value for such columns or use a sequence or trigger to generate them automatically.

Check out this link

  1. Could be that you are using an incorrect syntax for SYSDATE function. SYSDATE returns the current date and time as a DATE value, so you cannot subtract another DATE value from it and multiply it by numbers. You need to use proper date arithmetic functions such as TO_DATE, ADD_MONTHS, INTERVAL etc. to manipulate dates.

Check out this link

  1. Can you check column name or table name in your query is correct. You need to make sure that your column names and table names match exactly with the ones defined in the database schema

Regards
Gokul

Hi Mukeshkala,

Are parameters only for stored procedures??

Regards
Anusha

Thanks,

Can i pass parameters without stored procedures.

I mean to use parameters as variables

No , Simple Table