Home » SQL & PL/SQL » SQL & PL/SQL » Oracle Alphanumeric Sequence (Oracle 11g,win7)
Oracle Alphanumeric Sequence [message #613311] |
Sun, 04 May 2014 07:53 |
Xandot
Messages: 235 Registered: January 2014 Location: India
|
Senior Member |
|
|
Hello Friends,
I am want to create one sequence that contain some alphanumeric words.The Sequence is start like
1A,2A,3A....9A after the 9A the next value is 1B,1C,1D...1Z .than after 2B,2C....2Z. so finally the series like ..
---------------------
1A,1B,1C....1Z
2A,2B.......2Z
.........
......SO ON ...
-------------------------
Please Help me out....
Thanks
|
|
|
|
Re: Oracle Alphanumeric Sequence [message #613314 is a reply to message #613313] |
Sun, 04 May 2014 08:48 |
Xandot
Messages: 235 Registered: January 2014 Location: India
|
Senior Member |
|
|
The proper sequence is ...
1A,2A,3A,4A...9A,1B,1C,1D....1Z,2B,2C,2D....2Z,3B,3C,3D....3Z,4B,4C,4D...4Z.....So on ..
and this sequence is end with 9z(Last Value).
Thanks for reply...
|
|
|
|
|
Re: Oracle Alphanumeric Sequence [message #613317 is a reply to message #613314] |
Sun, 04 May 2014 09:12 |
|
Michel Cadot
Messages: 68624 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Quote:1A,2A,3A,4A...9A,1B,1C,1D....1Z,2B,2C,2D....2Z,3B,3C,3D....3Z,
Are you sure?
See what you wrote:
1A,2A,3A,4A...9A
1B,1C,1D....1Z
2B,2C,2D....2Z
3B,3C,3D....3Z
You want 9 "A" first then 25 "1", then 25 "2", then 25 "3" and what after?
[Updated on: Sun, 04 May 2014 09:22] Report message to a moderator
|
|
|
|
|
|
|
Re: Oracle Alphanumeric Sequence [message #613354 is a reply to message #613351] |
Mon, 05 May 2014 07:49 |
|
Michel Cadot
Messages: 68624 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
In addition...
Verify your statements are correct:
SQL> creat sequence numbers
SP2-0734: unknown command beginning "creat sequ..." - rest of line ignored.
SQL> start wiht 1
SP2-0310: unable to open file "wiht.sql"
SQL> max value 1000
SP2-0734: unknown command beginning "max value ..." - rest of line ignored.
SQL> minvalue 1
SP2-0042: unknown command "minvalue 1" - rest of line ignored.
SQL> cycle
SP2-0042: unknown command "cycle" - rest of line ignored.
Verify that your "solution" fits the need.
Here 1) we don't know what are the specifications and 2) anyway, given the few we know, I doubt "chr(numbers.nextval)||chr(abc.nextval)" will give a number followed by a character.
[Updated on: Tue, 06 May 2014 02:02] Report message to a moderator
|
|
|
Re: Oracle Alphanumeric Sequence [message #613361 is a reply to message #613351] |
Mon, 05 May 2014 10:24 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
@forums_man,
Apart from what John suggested you to follow the forum rules, please look your untested code :
forums_man wrote on Mon, 05 May 2014 16:32
mix varchare2;
Above is a syntax error.
Quote:
just call the function in loop
Why plsql? Also, think about the sequence when it exceeds the required limits which you assumed to just suffice the requirement for Aplhabets and Numbers.
P.S. : I appreciate. Good to see that you tried to post a solution, however, if it is syntactically incorrect then it is not going to benifit anyone. Please reconsider posting again with a syntactically correct code. Thanks.
[Updated on: Mon, 05 May 2014 10:29] Report message to a moderator
|
|
|
Re: Oracle Alphanumeric Sequence [message #613363 is a reply to message #613351] |
Mon, 05 May 2014 14:52 |
Solomon Yakobson
Messages: 3269 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
forums_man wrote on Mon, 05 May 2014 07:02
create sequence abc
creat sequence numbers
finally just call the function in loop
No need for two sequences. No need for function. All can be done in SQL with one sequence + CEIL + MOD + CHR.
SY.
|
|
|
|
Goto Forum:
Current Time: Thu Mar 28 03:55:59 CDT 2024
|