Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
746 views

I have 2 applications (one is SpringBoot app and another is a C++ app) calling the same Oracle sequence SEQUENCE_A responsible for generating PK on the same table TABLE-A. The sequence DDL is as: ...
pixel's user avatar
  • 10.8k
1 vote
0 answers
29 views

I see inconsistent hibernate behavior when using sequence to generate id, I have simple project with one entity Fruit and I'm using spring.jpa.hibernate.ddl-auto=create-drop so hibernate is launching ...
Raven Danish's user avatar
0 votes
3 answers
307 views

I want to get the next 10 values of the SEQUENCE at once. I can get those individually by calling SELECT setval('myseq', ...); -- Next nextval will return 43 10 times back to back. On ...
HappyTown's user avatar
  • 6,634
0 votes
0 answers
129 views

I have a Java system that uses Sequence in PK in database (postgreSQL and PGadmin) This sequence should take the current month (with two digits) followed by the current year. It turns out that a ...
Raquelhe's user avatar
0 votes
1 answer
836 views

I am brushing up my knowledge about SQL and I am learning more and more. However, I am not understanding the purpose of the Sequence we use. I am using SQL Server.
cbirole's user avatar
  • 27
0 votes
1 answer
1k views

I am trying to alter database sequence and restart it with value returned by complex SELECT statement. This is a simplified example that I prepared to replicate the issue: ALTER SEQUENCE abc....
Aleks Vujic's user avatar
  • 2,329
0 votes
1 answer
426 views

I have the next issue -> I have a table on my db with a composite id... Supose (Id1,Id2,Id3,Id4), the Id4 is generated by a sequence on the db... My question is, in spring boot, I generate the ...
Emmanuel Acosta's user avatar
0 votes
1 answer
171 views

I am trying to make a Postgres sequence that will reset once the id of the item it is linked to changes, e.g: ID SEQUENCE_VALUE 1 1 2 1 1 2 1 3 ...
matthew fabrie's user avatar
0 votes
2 answers
1k views

I need a help on persisting an entity in a Oracle DB table that uses trigger and sequence for PK. By now, I tried these from other stackoverflow questions: @Id @GeneratedValue(generator="...
Mikaelangel's user avatar
0 votes
1 answer
523 views

I have created a sequence but its not inserting ids in sequence order. For Ex: First I have created one set of record seq number generated as 1, 2, 3, 4 Again I have created another set of records ...
Abinnaya's user avatar
  • 223
0 votes
2 answers
658 views

There are 2 applications : one is using Spring boot - 1.5.18.Release version, which has hibernate version as 5.0.12.Final :https://search.maven.org/artifact/org.springframework.boot/spring-boot-...
CodeRunner's user avatar
0 votes
0 answers
26 views

I've a table with following structure: CREATE TABLE web.cabinet_account_section ( id serial NOT NULL, section_id text NULL, account_id int4 NULL, cabinet_param_id int4 NULL, ...
funnelCONN's user avatar
0 votes
1 answer
98 views

There is role sequence_owner. This is special tech role for working with sequence only. create role sequence_owner; GRANT sequence_owner TO administrator; GRANT USAGE, SELECT, UPDATE ON ALL SEQUENCES ...
yazabara's user avatar
  • 1,353
1 vote
1 answer
158 views

I am trying to create a SQL table, but I keep getting this error. Error report - ORA-00902: invalid datatype 00902. 00000 - "invalid datatype" Here is my code. CREATE TABLE viewers ( ...
Alex McGraw's user avatar
1 vote
3 answers
4k views

I have a table with id column as a number which have meanings. Different types of accounts start from different ranges. E.g Organisation 10000 <-> 100000, users 1000000 <-> 1kk. How can i ...
xxx_coder_noscope's user avatar
5 votes
3 answers
7k views

I'm having a table where I sometimes enter data in inline editors where I manually add the id value which is usually auto-incremented. In a case where id 4 was auto generated using scripts and then ...
Charith Jayasanka's user avatar
0 votes
1 answer
170 views

In database server Postgres 9.x or Postgres 10.x can I share the same sequence from 2 user? For example in the same database dbTest there are 2 schemas userA is schema owner schemaA with a sequenceA ...
sunrelax's user avatar
0 votes
0 answers
281 views

I am fairly new to hibernate and this is very strange - I am trying to run a Spring-Hibernate rest application on tomcat using eclipse. I have an entity defined as below - @Entity @Table(name = "...
Gunwant's user avatar
  • 1,009
1 vote
0 answers
34 views

I have a id field where id is serial and in the same table i have unique constraints. The problem here is when an unique constraint fails if the current ID value is 5 then after failing the next ID ...
Jithin Kumar S's user avatar
1 vote
1 answer
2k views

I have a query CREATE SEQUENCE "SEQ_ID" MINVALUE 1 MAXVALUE 99999 INCREMENT BY 1 START WITH 121 CACHE 20 NOORDER NOCYCLE; This one is of oracle commands. Now, I ...
Prajna's user avatar
  • 159
0 votes
2 answers
92 views

I am trying to insert an alphanumeric sequence in Oracle but it is not working. create sequence LIB start with 1 increment by 1; select 'LIBR'||to_char(seq_no.nextval,'FM0000099') from dual; ...
Amit prajapati's user avatar
0 votes
3 answers
838 views

I have a script (that can fail) with multiple inserts that include nextval as insert into table a (id, value) (id_seq.nextval, 'value'); ... If script fails and I rollback the inserts, the sequence ...
Ori Marko's user avatar
  • 59.3k
0 votes
2 answers
451 views

I'm having troubles resetting the sequences as automatically as possible. I'm trying to use the next query from phpPgAdmin: SELECT SETVAL('course_subjects_seq', (SELECT MAX(subject_id) FROM ...
an4rei's user avatar
  • 57
0 votes
1 answer
111 views

I'm trying to insert a Number as an ID in a column in my database by a loop which sets the new ID by a Sequence. When I try to insert it, the row hasn't been created or the field where my number ...
Silky 's user avatar
  • 53
0 votes
0 answers
72 views

I need to update product_details table with unique ID(CHARGE_NUMBER) againt each batch_ID and for the next batch ID unique ID again will start with 1 I have write a code using sequence. update ...
Deepak Patil's user avatar