RE: DML within a function

  • From: <arul.kumar@xxxxxx>
  • To: <salva@xxxxxxxx>
  • Date: Tue, 16 Nov 2004 13:38:33 -0000

How about encapsulating the same in a INSERT Trigger?

The trigger will check the last id & increment the value by 1 & insert =
into the table!


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx =
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Jan SALVA
Sent: 16 November 2004 13:36
To: oracle-l@xxxxxxxxxxxxx
Subject: DML within a function


Hello all,
when I use update command within a user defined function, I got =3D
ORA-06512 error: Can't use DML within a function.
Is ANY possibility to modify data within a function? Some dynamic sql or =
=3D
other feature?
Why I need it:
In my db - primary key values are set by application, it mean that last =
=3D
used Id is in "counters" table. Unfortunatelly sequence objects aren't =
=3D
used. When I need new Id, i get it with stored procedure, which handles =
=3D
my "counters" table. The big disadvantage is that I can't use this =3D
schema for multi-row inserts, I must use cursors :-(. I know that this =
=3D
is bad solution, but I can't do anything with it now and I need improve =
=3D
db performance. If I have function, which handles my counters table, I =
=3D
would use it directly in insert command without cursor need.
Thank you for any answers.
--
//www.freelists.org/webpage/oracle-l
--
//www.freelists.org/webpage/oracle-l

Other related posts: