Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,528 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I need to insert rows into an oracle table but the oracle table has auto increment sequence.
so one column definition is like this:-
"ID" NUMBER(10,0) DEFAULT "SC1"."DAT1_CTR_SEQ"."NEXTVAL" NOT NULL ENABLE
Thanks for posting your question in the Microsoft Q&A forum.
Did you try this command?
INSERT INTO your_table_name (ID, other_column1, other_column2) VALUES ("SC1"."DAT1_CTR_SEQ"."NEXTVAL", 'value1', 'value2');
Also, you can use the following command to return the inserted ID.
DECLARE
v_id NUMBER;
BEGIN
INSERT INTO your_table_name (ID, other_column1, other_column2)
VALUES ("SC1"."DAT1_CTR_SEQ"."NEXTVAL", 'value1', 'value2')
RETURNING ID INTO v_id;
DBMS_OUTPUT.PUT_LINE('Inserted ID: ' || v_id);
END;
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **