Auto Generated No with varchar2(2) [message #165917] |
Mon, 03 April 2006 05:42 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
kamran.it
Messages: 265 Registered: September 2005 Location: Karachi
|
Senior Member |
|
|
Dear All
I created a form
there are 2 fields
1. srno number(4)
2. alpha varchar2(2)
srno is auto generated field.
I want to create record like :-
srno = 1 , alpha= A
srno = 1 , alpha= B
srno = 1 , alpha= C
when I whould like to change srno, change it..
there is any possibility.
|
|
|
|
Re: Auto Generated No with varchar2(2) [message #166171 is a reply to message #165917] |
Wed, 05 April 2006 00:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Always populate these values in the When-Create-Record trigger. These look like detail records using a master with 'srno=1'. Increment the 'srno' in the master record in the When-Create-Record trigger then in the detail record for the 'srno' use the item property 'Copy Value From' to point back to the master record. To increment the alphabetic values you may have to use a 'select' statement as some PL/SQL functions don't work in an assignment statement (depending on the version of PL/SQL you are running).select chr(ascii('a')+1)
from dual; returns 'b'.
David
[Updated on: Wed, 05 April 2006 00:15] Report message to a moderator
|
|
|
Re: Auto Generated No with varchar2(2) [message #166237 is a reply to message #166171] |
Wed, 05 April 2006 06:21 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
kamran.it
Messages: 265 Registered: September 2005 Location: Karachi
|
Senior Member |
|
|
WE MAKE ORDER SHEET
WE HAVE TO ASSIGN UNIQUE NUMBER TO EACH ORDER
EXAMPLE:
A PARTY GAVE US 3 ORDERS WHICH CONSIST SAME PARTICULAR BUT DATE ARE DIFFERENT.
WE WANT TO ASSIGN NUMBER
ORDER NO = 1-A
ORDER NO = 1-B
ORDER NO = 1-C
1 IS AUTOGENERATED BUT A.
|
|
|
|
|
Re: Auto Generated No with varchar2(2) [message #166432 is a reply to message #166393] |
Thu, 06 April 2006 05:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
kamran.it
Messages: 265 Registered: September 2005 Location: Karachi
|
Senior Member |
|
|
yes you can sey it is alphanumeric sequence
Example:
One Table Created.
create table pp_kd(
Pono number(6),
subpo varchar2(2),
constraints pono_subpo_pk1 primary key(pono,subpo),
Here I want to empty feild subpp which is not possible in this condition.
Numeirc is Autogenerated No but Character we will enter
1. pono number(6)
2. s_pono varchar2(2)
One thing we can not define in primary key both fields because s_pono no some time empty.
I have entered data
PONO = 1 (Autogenerated)
S_Pono = A
here i created a button NEW and ADD
When I press NEW it shows new PONO (autogenerated)
When I press ADD it Shows same PONO but S_pono empty,
Again I am entering data and Press ADD button
When I enter S_pono = A
show error msg
because it will search Pono and S_pono already exist.
Upd-mod: You almost got the code tags right.
[Updated on: Thu, 06 April 2006 19:48] by Moderator Report message to a moderator
|
|
|
|