Hi All
My googling has found a few ideas about how to get packed data OUT of a character field using SQL, but so far I haven't found any information on how to get it IN there.
I refer to, for instance, a general parameter file that has a key field and a general use character field that would usually be handled in RPG using a data structure so that it can contain whatever combination of character/zoned/packed data is required. However I'm working with embedded SQL and prefer to stick with that if possible.
It's easy enough if I want to put a constant value in. Say a 7,0 decimal value of 7654321 :
In this case the character data between 1-6 is undisturbed but 7-10 contains hex:
7531
642F
I suppose I could build the statement as a string and execute it using EXECUTE IMMEDIATE but I thought I'd see if there's a more elegant solution.
My googling has found a few ideas about how to get packed data OUT of a character field using SQL, but so far I haven't found any information on how to get it IN there.
I refer to, for instance, a general parameter file that has a key field and a general use character field that would usually be handled in RPG using a data structure so that it can contain whatever combination of character/zoned/packed data is required. However I'm working with embedded SQL and prefer to stick with that if possible.
It's easy enough if I want to put a constant value in. Say a 7,0 decimal value of 7654321 :
Code:
update hjwup set UPCOMP = insert(UPCOMP, 7, 4, x'7654321F')
7531
642F
I suppose I could build the statement as a string and execute it using EXECUTE IMMEDIATE but I thought I'd see if there's a more elegant solution.
Comment