dbTalk Databases Forums  

ORA-04091 with table insert

comp.databases.oracle.server comp.databases.oracle.server


Discuss ORA-04091 with table insert in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
steph
 
Posts: n/a

Default ORA-04091 with table insert - 06-19-2008 , 09:48 AM






Hi Group,

Oracle 10G - This is my problem:

There's a table containing a time series like

date,val
1.1.08,2
2.1.08,1
3.1.08,4
5.1.08,-1

Now I need to advance this table in time, the new records come from a
query so I have something like:

insert into timeseriestable
select date,val from timeseriesquery
/

Now in this query I need to access the last value of the time-series
as a kind of a starting value for calculating the new records. (In
this example -1).

Unfortunately this leads to a ORA-04091. I understand the reason for
the problem, but I didn't find a good way to circumvent this. One idea
is to create a materialized view containing the last values for each
time series (yes, there's more than one time series involved ...). But
this solution is less flexible as I need to refresh the materialized
view before each update. The other idea is to use some pl/sql code
with an autonomous transaction to access the last value of the time
series. What else could i do here?

Thanks,
Stephan

Reply With Quote
  #2  
Old   
steph
 
Posts: n/a

Default Re: ORA-04091 with table insert - 06-19-2008 , 11:58 AM






On 19 Jun., 16:48, steph <stepha... (AT) yahoo (DOT) de> wrote:
Quote:
Hi Group,

Oracle 10G - This is my problem:

There's a table containing a time series like

date,val
1.1.08,2
2.1.08,1
3.1.08,4
5.1.08,-1

Now I need to advance this table in time, the new records come from a
query so I have something like:

insert into timeseriestable
select date,val from timeseriesquery
/

Now in this query I need to access the last value of the time-series
as a kind of a starting value for calculating the new records. (In
this example -1).

Unfortunately this leads to a ORA-04091. I understand the reason for
the problem, but I didn't find a good way to circumvent this. One idea
is to create a materialized view containing the last values for each
time series (yes, there's more than one time series involved ...). But
this solution is less flexible as I need to refresh the materialized
view before each update. The other idea is to use some pl/sql code
with an autonomous transaction to access the last value of the time
series. What else could i do here?

Thanks,
Stephan
solved this with an autonomous pl/sql function.


Reply With Quote
  #3  
Old   
steph
 
Posts: n/a

Default Re: ORA-04091 with table insert - 06-19-2008 , 11:58 AM



On 19 Jun., 16:48, steph <stepha... (AT) yahoo (DOT) de> wrote:
Quote:
Hi Group,

Oracle 10G - This is my problem:

There's a table containing a time series like

date,val
1.1.08,2
2.1.08,1
3.1.08,4
5.1.08,-1

Now I need to advance this table in time, the new records come from a
query so I have something like:

insert into timeseriestable
select date,val from timeseriesquery
/

Now in this query I need to access the last value of the time-series
as a kind of a starting value for calculating the new records. (In
this example -1).

Unfortunately this leads to a ORA-04091. I understand the reason for
the problem, but I didn't find a good way to circumvent this. One idea
is to create a materialized view containing the last values for each
time series (yes, there's more than one time series involved ...). But
this solution is less flexible as I need to refresh the materialized
view before each update. The other idea is to use some pl/sql code
with an autonomous transaction to access the last value of the time
series. What else could i do here?

Thanks,
Stephan
solved this with an autonomous pl/sql function.


Reply With Quote
  #4  
Old   
steph
 
Posts: n/a

Default Re: ORA-04091 with table insert - 06-19-2008 , 11:58 AM



On 19 Jun., 16:48, steph <stepha... (AT) yahoo (DOT) de> wrote:
Quote:
Hi Group,

Oracle 10G - This is my problem:

There's a table containing a time series like

date,val
1.1.08,2
2.1.08,1
3.1.08,4
5.1.08,-1

Now I need to advance this table in time, the new records come from a
query so I have something like:

insert into timeseriestable
select date,val from timeseriesquery
/

Now in this query I need to access the last value of the time-series
as a kind of a starting value for calculating the new records. (In
this example -1).

Unfortunately this leads to a ORA-04091. I understand the reason for
the problem, but I didn't find a good way to circumvent this. One idea
is to create a materialized view containing the last values for each
time series (yes, there's more than one time series involved ...). But
this solution is less flexible as I need to refresh the materialized
view before each update. The other idea is to use some pl/sql code
with an autonomous transaction to access the last value of the time
series. What else could i do here?

Thanks,
Stephan
solved this with an autonomous pl/sql function.


Reply With Quote
  #5  
Old   
steph
 
Posts: n/a

Default Re: ORA-04091 with table insert - 06-19-2008 , 11:58 AM



On 19 Jun., 16:48, steph <stepha... (AT) yahoo (DOT) de> wrote:
Quote:
Hi Group,

Oracle 10G - This is my problem:

There's a table containing a time series like

date,val
1.1.08,2
2.1.08,1
3.1.08,4
5.1.08,-1

Now I need to advance this table in time, the new records come from a
query so I have something like:

insert into timeseriestable
select date,val from timeseriesquery
/

Now in this query I need to access the last value of the time-series
as a kind of a starting value for calculating the new records. (In
this example -1).

Unfortunately this leads to a ORA-04091. I understand the reason for
the problem, but I didn't find a good way to circumvent this. One idea
is to create a materialized view containing the last values for each
time series (yes, there's more than one time series involved ...). But
this solution is less flexible as I need to refresh the materialized
view before each update. The other idea is to use some pl/sql code
with an autonomous transaction to access the last value of the time
series. What else could i do here?

Thanks,
Stephan
solved this with an autonomous pl/sql function.


Reply With Quote
  #6  
Old   
steph
 
Posts: n/a

Default Re: ORA-04091 with table insert - 06-19-2008 , 11:58 AM



On 19 Jun., 16:48, steph <stepha... (AT) yahoo (DOT) de> wrote:
Quote:
Hi Group,

Oracle 10G - This is my problem:

There's a table containing a time series like

date,val
1.1.08,2
2.1.08,1
3.1.08,4
5.1.08,-1

Now I need to advance this table in time, the new records come from a
query so I have something like:

insert into timeseriestable
select date,val from timeseriesquery
/

Now in this query I need to access the last value of the time-series
as a kind of a starting value for calculating the new records. (In
this example -1).

Unfortunately this leads to a ORA-04091. I understand the reason for
the problem, but I didn't find a good way to circumvent this. One idea
is to create a materialized view containing the last values for each
time series (yes, there's more than one time series involved ...). But
this solution is less flexible as I need to refresh the materialized
view before each update. The other idea is to use some pl/sql code
with an autonomous transaction to access the last value of the time
series. What else could i do here?

Thanks,
Stephan
solved this with an autonomous pl/sql function.


Reply With Quote
  #7  
Old   
steph
 
Posts: n/a

Default Re: ORA-04091 with table insert - 06-19-2008 , 11:58 AM



On 19 Jun., 16:48, steph <stepha... (AT) yahoo (DOT) de> wrote:
Quote:
Hi Group,

Oracle 10G - This is my problem:

There's a table containing a time series like

date,val
1.1.08,2
2.1.08,1
3.1.08,4
5.1.08,-1

Now I need to advance this table in time, the new records come from a
query so I have something like:

insert into timeseriestable
select date,val from timeseriesquery
/

Now in this query I need to access the last value of the time-series
as a kind of a starting value for calculating the new records. (In
this example -1).

Unfortunately this leads to a ORA-04091. I understand the reason for
the problem, but I didn't find a good way to circumvent this. One idea
is to create a materialized view containing the last values for each
time series (yes, there's more than one time series involved ...). But
this solution is less flexible as I need to refresh the materialized
view before each update. The other idea is to use some pl/sql code
with an autonomous transaction to access the last value of the time
series. What else could i do here?

Thanks,
Stephan
solved this with an autonomous pl/sql function.


Reply With Quote
  #8  
Old   
steph
 
Posts: n/a

Default Re: ORA-04091 with table insert - 06-19-2008 , 11:58 AM



On 19 Jun., 16:48, steph <stepha... (AT) yahoo (DOT) de> wrote:
Quote:
Hi Group,

Oracle 10G - This is my problem:

There's a table containing a time series like

date,val
1.1.08,2
2.1.08,1
3.1.08,4
5.1.08,-1

Now I need to advance this table in time, the new records come from a
query so I have something like:

insert into timeseriestable
select date,val from timeseriesquery
/

Now in this query I need to access the last value of the time-series
as a kind of a starting value for calculating the new records. (In
this example -1).

Unfortunately this leads to a ORA-04091. I understand the reason for
the problem, but I didn't find a good way to circumvent this. One idea
is to create a materialized view containing the last values for each
time series (yes, there's more than one time series involved ...). But
this solution is less flexible as I need to refresh the materialized
view before each update. The other idea is to use some pl/sql code
with an autonomous transaction to access the last value of the time
series. What else could i do here?

Thanks,
Stephan
solved this with an autonomous pl/sql function.


Reply With Quote
  #9  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: ORA-04091 with table insert - 06-20-2008 , 02:25 AM



On Thu, 19 Jun 2008 09:58:39 -0700, steph wrote:


Quote:
solved this with an autonomous pl/sql function.
Oracle11 has compound triggers precisely to deal with this kind of
situation.

--
Mladen Gogala
http://mgogala.freehostia.com


Reply With Quote
  #10  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: ORA-04091 with table insert - 06-20-2008 , 02:25 AM



On Thu, 19 Jun 2008 09:58:39 -0700, steph wrote:


Quote:
solved this with an autonomous pl/sql function.
Oracle11 has compound triggers precisely to deal with this kind of
situation.

--
Mladen Gogala
http://mgogala.freehostia.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.