R
Rich Baker
I have a project that has been upgraded from .Net 1.1 to 2.0 and I
cannot get the UpdateRowSource.FirstReturnedRecord of the InsertCommand
to work correctly using the OracleClient. It works correctly on 1.1 and
the DataSet is updated correctly after a DataAdapter.Update, but
although the insert happens to the database on 2.0, the DataSet is not
updated.
The InsertCommand is a PL/SQL stored procedure as follows
PROCEDURE insert_orders
( p_b IN INTEGER,
p_c IN VARCHAR,
p_d IN NUMBER,
p_e IN INTEGER,
p_f IN INTEGER,
p_g IN VARCHAR,
p_h IN INTEGER,
p_i IN VARCHAR,
p_results OUT REF CURSOR) AS
v_currentValue NUMBER;
BEGIN
-- Insert a row to orders table
INSERT INTO orders
( b,
c,
d,
e,
f,
g,
h,
i)
VALUES ( p_b,
p_c,
p_d,
p_e,
p_f,
p_g,
p_h,
p_i);
-- Get the order_id of the inserted row using the sequence
SELECT seq_id.currval
INTO v_currentValue
FROM dual;
-- Get the inserted row as output
OPEN p_results FOR
SELECT id,
b,
c,
d,
e,
f,
g,
h,
i
FROM orders
WHERE id = v_currentValue;
END insert_orders;
The value of Id is populated during a Pre-Insert Trigger from an Oracle
Sequence.
Has anyone else encountered this problem?
Many thanks
Richard
cannot get the UpdateRowSource.FirstReturnedRecord of the InsertCommand
to work correctly using the OracleClient. It works correctly on 1.1 and
the DataSet is updated correctly after a DataAdapter.Update, but
although the insert happens to the database on 2.0, the DataSet is not
updated.
The InsertCommand is a PL/SQL stored procedure as follows
PROCEDURE insert_orders
( p_b IN INTEGER,
p_c IN VARCHAR,
p_d IN NUMBER,
p_e IN INTEGER,
p_f IN INTEGER,
p_g IN VARCHAR,
p_h IN INTEGER,
p_i IN VARCHAR,
p_results OUT REF CURSOR) AS
v_currentValue NUMBER;
BEGIN
-- Insert a row to orders table
INSERT INTO orders
( b,
c,
d,
e,
f,
g,
h,
i)
VALUES ( p_b,
p_c,
p_d,
p_e,
p_f,
p_g,
p_h,
p_i);
-- Get the order_id of the inserted row using the sequence
SELECT seq_id.currval
INTO v_currentValue
FROM dual;
-- Get the inserted row as output
OPEN p_results FOR
SELECT id,
b,
c,
d,
e,
f,
g,
h,
i
FROM orders
WHERE id = v_currentValue;
END insert_orders;
The value of Id is populated during a Pre-Insert Trigger from an Oracle
Sequence.
Has anyone else encountered this problem?
Many thanks
Richard