Its kinda complicated but I try to explain it ..I have a table in database somewhere looks like this. this is partno table
... | Part No | Convert | ...
... | 00000 | ABC | ...
... | 00001 | DEF | ...
All the input value must be start with 00000 or 00001, For example = 0000012345, 000014321.
Then, based on these first 5 value(00000 and 00001), it will be convert into like the Convert column.
Example:
====================
Input: 0000012345
Expected: ABC12345
====================
Input: 000014321
Expected: DEF4321
====================
Meaning that I must convert the input that I got based on the table above and I don't know how to do that.
What I have tried:
So, I cheated and make the query like this:
Insert into pencil (pencil_no,lastdate)
values('ABC'|| SUBSTR('" + pen + "',1,2), sysdate)
and it works as I get my desired output. But unfortunately this is not the right way as the data in the table will be updated and change.
Can anyone guide me how to do this? Thanks in advance