Q: Do we have Sequence in Sybase I see tutorial talking about Sequence with syntax and example.
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00801.1601/doc/html/saiq-create-sequence-statement.html
But when I try creating sequence in Syabse through Squirrel, I get below error.
Error: 'SEQUENCE' is not a recognized CREATE option.

SQLState:  ZZZZZ
ErrorCode: 155

Then how do we create auto increment unique identifier in Sybase.
How do we use Identity in Sequence. How come sequence available in one Sybase version and not in another.
I connect to sybase using below dependency.
 <dependency>
    <groupId>com.sybase.jdbcx</groupId>
    <artifactId>jconn3</artifactId>
    <version>6.0</version>
</dependency>


A: A sequence as an object does not exist in Sybase ASE (assumption). The equivalent functionality is done using identity columns.
create table test_tab (
    test_tab_id     int          identity,
    test_tab_name   varchar(30)  not null )
go

insert into test_tab (test_tab_name) values ('Hello') 
go
insert into test_tab (test_tab_name) values ('World') 
go
select * from test_tab
go

Result

(1 row affected)
(1 row affected)
test_tab_id test_tab_name                                                

       1 Hello                                                        
       2 World                                                        

(2 rows affected)


A: One more point to add on identity is:
Once you truncate the table and insert data the old value of the identity is taken and then incremented.
Example:
select * from test_tab
go

2 rows 
1 hello
2 world

Truncate the table test_tab
go


insert into test_tab (test_tab_name) values ('Hai') 
go
insert into test_tab (test_tab_name) values ('done') 
go
select * from test_tab
go

You will get as below
3 hai
4 done


A: can we assign the sequence per combination
E.g.
       1 ABC
   2 ABC

   3 ABC

   4 ABC

  1  KLO

  2  KLO

  3  KLO

