![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I would like to insert some data series (aroung 60.000 values / series). My table have this columns: master_id, series_id, position, value (all ints) Now I would like to create two sequences, first series_id_seq and second position_seq. The position sequence must reset when the series sequence increases, the series sequence must then reset if the create a new master_id. In my code I would like to do this: loStatament("reset series seq"); for int n=0; n < series.count; n++) { nSeries = loStatement("select nextval(series seq)"); loStatament("reset position seq"); for int i=0; i < series[n].size; i++) { loStatement("insert into (master_id, series_id, value) values(?,?,?)"); loStatement.setInt(1, master_id); loStatament.setInt(2, nSeries); loStatament.setint(3, series[n].getValue(i)); loStatament.executeQuery(); } } The PK of the table is: master_id + series_id + position. The position id will create by the insert trigger. Is there any problem with shared connection (I know the sequences are used in the session). The position and series sequence must increase continuously for the master id. Is it also a good way to do this with sequences or should I create the numbers on my client application? |
#3
| |||
| |||
|
|
I would like to insert some data series (aroung 60.000 values / series). My table have this columns: master_id, series_id, position, value (all ints) Now I would like to create two sequences, first series_id_seq and second position_seq. The position sequence must reset when the series sequence increases, the series sequence must then reset if the create a new master_id. In my code I would like to do this: loStatament("reset series seq"); for int n=0; n < series.count; n++) { nSeries = loStatement("select nextval(series seq)"); loStatament("reset position seq"); for int i=0; i < series[n].size; i++) { loStatement("insert into (master_id, series_id, value) values(?,?,?)"); loStatement.setInt(1, master_id); loStatament.setInt(2, nSeries); loStatament.setint(3, series[n].getValue(i)); loStatament.executeQuery(); } } The PK of the table is: master_id + series_id + position. The position id will create by the insert trigger. Is there any problem with shared connection (I know the sequences are used in the session). The position and series sequence must increase continuously for the master id. Is it also a good way to do this with sequences or should I create the numbers on my client application? |
#4
| |||
| |||
|
|
I would like to insert some data series (aroung 60.000 values / series). My table have this columns: master_id, series_id, position, value (all ints) Now I would like to create two sequences, first series_id_seq and second position_seq. The position sequence must reset when the series sequence increases, the series sequence must then reset if the create a new master_id. In my code I would like to do this: loStatament("reset series seq"); for int n=0; n < series.count; n++) { nSeries = loStatement("select nextval(series seq)"); loStatament("reset position seq"); for int i=0; i < series[n].size; i++) { loStatement("insert into (master_id, series_id, value) values(?,?,?)"); loStatement.setInt(1, master_id); loStatament.setInt(2, nSeries); loStatament.setint(3, series[n].getValue(i)); loStatament.executeQuery(); } } The PK of the table is: master_id + series_id + position. The position id will create by the insert trigger. Is there any problem with shared connection (I know the sequences are used in the session). The position and series sequence must increase continuously for the master id. Is it also a good way to do this with sequences or should I create the numbers on my client application? |
#5
| |||
| |||
|
|
I would like to insert some data series (aroung 60.000 values / series). My table have this columns: master_id, series_id, position, value (all ints) Now I would like to create two sequences, first series_id_seq and second position_seq. The position sequence must reset when the series sequence increases, the series sequence must then reset if the create a new master_id. In my code I would like to do this: loStatament("reset series seq"); for int n=0; n < series.count; n++) { nSeries = loStatement("select nextval(series seq)"); loStatament("reset position seq"); for int i=0; i < series[n].size; i++) { loStatement("insert into (master_id, series_id, value) values(?,?,?)"); loStatement.setInt(1, master_id); loStatament.setInt(2, nSeries); loStatament.setint(3, series[n].getValue(i)); loStatament.executeQuery(); } } The PK of the table is: master_id + series_id + position. The position id will create by the insert trigger. Is there any problem with shared connection (I know the sequences are used in the session). The position and series sequence must increase continuously for the master id. Is it also a good way to do this with sequences or should I create the numbers on my client application? |
#6
| |||
| |||
|
|
I would like to insert some data series (aroung 60.000 values / series). My table have this columns: master_id, series_id, position, value (all ints) Now I would like to create two sequences, first series_id_seq and second position_seq. The position sequence must reset when the series sequence increases, the series sequence must then reset if the create a new master_id. In my code I would like to do this: loStatament("reset series seq"); for int n=0; n < series.count; n++) { nSeries = loStatement("select nextval(series seq)"); loStatament("reset position seq"); for int i=0; i < series[n].size; i++) { loStatement("insert into (master_id, series_id, value) values(?,?,?)"); loStatement.setInt(1, master_id); loStatament.setInt(2, nSeries); loStatament.setint(3, series[n].getValue(i)); loStatament.executeQuery(); } } The PK of the table is: master_id + series_id + position. The position id will create by the insert trigger. Is there any problem with shared connection (I know the sequences are used in the session). The position and series sequence must increase continuously for the master id. Is it also a good way to do this with sequences or should I create the numbers on my client application? |
#7
| |||
| |||
|
|
I would like to insert some data series (aroung 60.000 values / series). My table have this columns: master_id, series_id, position, value (all ints) Now I would like to create two sequences, first series_id_seq and second position_seq. The position sequence must reset when the series sequence increases, the series sequence must then reset if the create a new master_id. In my code I would like to do this: loStatament("reset series seq"); for int n=0; n < series.count; n++) { nSeries = loStatement("select nextval(series seq)"); loStatament("reset position seq"); for int i=0; i < series[n].size; i++) { loStatement("insert into (master_id, series_id, value) values(?,?,?)"); loStatement.setInt(1, master_id); loStatament.setInt(2, nSeries); loStatament.setint(3, series[n].getValue(i)); loStatament.executeQuery(); } } The PK of the table is: master_id + series_id + position. The position id will create by the insert trigger. Is there any problem with shared connection (I know the sequences are used in the session). The position and series sequence must increase continuously for the master id. Is it also a good way to do this with sequences or should I create the numbers on my client application? |
#8
| |||
| |||
|
|
I would like to insert some data series (aroung 60.000 values / series). My table have this columns: master_id, series_id, position, value (all ints) Now I would like to create two sequences, first series_id_seq and second position_seq. The position sequence must reset when the series sequence increases, the series sequence must then reset if the create a new master_id. In my code I would like to do this: loStatament("reset series seq"); for int n=0; n < series.count; n++) { nSeries = loStatement("select nextval(series seq)"); loStatament("reset position seq"); for int i=0; i < series[n].size; i++) { loStatement("insert into (master_id, series_id, value) values(?,?,?)"); loStatement.setInt(1, master_id); loStatament.setInt(2, nSeries); loStatament.setint(3, series[n].getValue(i)); loStatament.executeQuery(); } } The PK of the table is: master_id + series_id + position. The position id will create by the insert trigger. Is there any problem with shared connection (I know the sequences are used in the session). The position and series sequence must increase continuously for the master id. Is it also a good way to do this with sequences or should I create the numbers on my client application? |
#9
| |||
| |||
|
|
I would like to insert some data series (aroung 60.000 values / series). My table have this columns: master_id, series_id, position, value (all ints) Now I would like to create two sequences, first series_id_seq and second position_seq. The position sequence must reset when the series sequence increases, the series sequence must then reset if the create a new master_id. In my code I would like to do this: loStatament("reset series seq"); for int n=0; n < series.count; n++) { nSeries = loStatement("select nextval(series seq)"); loStatament("reset position seq"); for int i=0; i < series[n].size; i++) { loStatement("insert into (master_id, series_id, value) values(?,?,?)"); loStatement.setInt(1, master_id); loStatament.setInt(2, nSeries); loStatament.setint(3, series[n].getValue(i)); loStatament.executeQuery(); } } The PK of the table is: master_id + series_id + position. The position id will create by the insert trigger. Is there any problem with shared connection (I know the sequences are used in the session). The position and series sequence must increase continuously for the master id. Is it also a good way to do this with sequences or should I create the numbers on my client application? |
#10
| ||||
| ||||
|
|
When does "master_id" or "series_id" change to the new value? |
|
After a new series_id has been created, will there no more INSERTs for older series_ids? |
|
Do you generate all IDs yourself or are they given to you? |
|
I hope that with "must increase continuously" you do not mean that there may not be any "holes" in the sequence, just that it should increase. |
![]() |
| Thread Tools | |
| Display Modes | |
| |