I'm using Oracle 12C.
All of my stored procedures worked so far for the last 6 months but from today some of them are not working.
create table Table1
(
ID NUMBER generated by default on null as identity
constraint FGEN_PAY_FLEX_PK
primary key,
CARD_NO VARCHAR2(19) not null
);
Use Case-1Expectation:The following statement will work without error -
Insert Into Table1(Card_No) value('12345');Actual:Yes, it is working. Oracle is generating an id for the identity column.
Use Case-2Expectation:The following statement will work without error -
create PROCEDURE MY_SAMPLE_PROCEDURE(I_CARD_NUMBER IN VARCHAR2)
AS
BEGIN
INSERT into Table1 (Card_No)
select '12345' FROM DUAL;
END LOAD_SINGLE_PAYFLEX_DATA;
/
declare
I_CARD_NUMBER VARCHAR2(100) := '12345';
begin
MY_SAMPLE_PROCEDURE(
I_CARD_NUMBER=> I_CARD_NUMBER
);
end;
Actual:No, it's not working now. It worked 2 days ago.
I'm getting the following exception while trying to execute the procedure -
ORA-01400: cannot insert NULL into ("STATEMENT"."Table1"."ID")
It looks fine to me...
create table table1 (
id number generated by default on null as identity
constraint fgen_pay_flex_pk
primary key,
card_no varchar2(19) not null
);
create or replace procedure my_sample_procedure(i_card_number in varchar2)
as
begin
insert into table1 (card_no)
select '12345' from dual;
end my_sample_procedure;
/
declare
i_card_number varchar2(100) := '12345';
begin
my_sample_procedure(
i_card_number=> i_card_number
);
end;
/
select * from table1;
ID CARD_NO
1 12345 No, it's not working now. It worked 2 days ago.So what changed?