Home » RDBMS Server » Server Administration » what datatype should the column that sequence generate store in?
what datatype should the column that sequence generate store in? [message #432203] Sun, 22 November 2009 23:50 Go to next message
yuanqc
Messages: 2
Registered: November 2009
Junior Member
what datatype should the column that sequence generate store in?
number or varchar? which is perferable?
Re: what datatype should the column that sequence generate store in? [message #432205 is a reply to message #432203] Mon, 23 November 2009 00:12 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
yuanqc wrote on Sun, 22 November 2009 21:50
what datatype should the column that sequence generate store in?
number or varchar? which is perferable?


CREATE SEQUENCE customers_seq
START WITH 1000
INCREMENT BY 1
NOCACHE
NOCYCLE;

You can only increment a number.
Re: what datatype should the column that sequence generate store in? [message #432329 is a reply to message #432205] Mon, 23 November 2009 10:30 Go to previous messageGo to next message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member

Quote:
number or varchar? which is perferable?


It's upto you. If you want only numeric then go the number datatype if you want numeric & string then go with varchar

- Thanks
Re: what datatype should the column that sequence generate store in? [message #432334 is a reply to message #432329] Mon, 23 November 2009 11:06 Go to previous message
Michel Cadot
Messages: 68658
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
gentlebabu wrote on Mon, 23 November 2009 17:30
Quote:
number or varchar? which is perferable?


It's upto you. If you want only numeric then go the number datatype if you want numeric & string then go with varchar

- Thanks

What is doubtful in "the column that sequence generate store in?"
Data are numbers because sequence generates numbers.
Full stop.
So it is NOT up to you, it is NUMBER.

Regards
Michel

Previous Topic: Deallocating Memory Segments of Crashed Oracle Instance
Next Topic: Maximum number of cursors
Goto Forum:
  


Current Time: Sun Jun 02 13:15:39 CDT 2024