HOW GENERATE ITEM CODE CONCATENATE WITH MAIN ITEM AND SUB ITEM (merged 2) [message #538452] |
Fri, 06 January 2012 02:21 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
I AM TRYING TO GENERATE ITEM CODE CONCATENATE WITH MAIN ITEM AND SUB ITEM, I GOT SUCCESS TO CONCATENATE BUT I M NOT GETTING THE ITEM CODE SEQUENCE.
declare
v_item varchar2(10);
begin
select nvl(max(itemcode),0)+1 into v_item from R_item where mccode=:mccode and sccode=:sccode;
:ITEMCODE:=:MCCODE||'-'||:SCCODE||'-'||v_item;
end;
ITEMCODE = ITEM
MCCODE = MAINITEM
SCCODE = SUBITEM
-
Attachment: ITEM.JPG
(Size: 56.29KB, Downloaded 710 times)
|
|
|
|
Concatenation of Master Item,Sub Item and Generate Item Code [message #538466 is a reply to message #538452] |
Fri, 06 January 2012 06:02 ![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) |
|
how to generate item code concate with master item and sub item? i succeed to concate but item sequence not generating see the code below!
declare
v_item varchar2(10);
begin
select nvl(max(itemcode),0)+1
into v_item
from R_item
where mccode=:mccode and sccode=:sccode;
:ITEMCODE:=:MCCODE||'-'||:SCCODE||'-'||v_item;
end;
Best Regards,
![/forum/fa/9697/0/](/forum/fa/9697/0/)
-
Attachment: ITEM.JPG
(Size: 56.29KB, Downloaded 1244 times)
|
|
|
|
Re: Concatenation of Master Item,Sub Item and Generate Item Code [message #538477 is a reply to message #538467] |
Fri, 06 January 2012 07:36 ![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) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Unless you tell forms to apply each record to the DB as it is entered using either post or commit it won't work.
Those records are only in the form until one of those commands is issued. So a query against the DB will give the same result each time.
But I suggest you use an actual DB sequence instead, that's what they're there for, and if you don't sooner or later two users will generate the same item code at the same time.
|
|
|
|
|
|
|