HOW GENERATE ITEM CODE CONCATENATE WITH MAIN ITEM AND SUB ITEM (merged 2) [message #538452] |
Fri, 06 January 2012 02:21 |
|
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 741 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 |
|
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,
-
Attachment: ITEM.JPG
(Size: 56.29KB, Downloaded 1295 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 |
cookiemonster
Messages: 13963 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.
|
|
|
|
|
|
|