I have TABLE1 with columns COL1,COL2 defined as LongVarChar in Oracle.
Every time user loads a record to TABLE1, COL1 will have the old value and COL2 will have the old value + new value. i.e.
For ex:
COL1 COL2
Bat
Bat Bat Ball
Bat Ball Bat Ball Wicket
Bat Ball Wicket Bat Ball Wicket Stump
To get the only new value, i am planning to delete contents of COL2 from COL1 contents..I think this is a pretty bad idea..
I tried the usual “-” operator and it says "Expected Numeric but received CLOB"
But does any one any better idea or how to accomplish this?
Thanks so much
Assuming you mean Varchar2, and (as in your example), each old value is separated by an additional space, then something like this should work:
eg:
results in ‘Bat’
results in ‘Ball’
But if you’re actually talking about a
CLOBdatatype, then substitute:instead of colX (where X is 1 or 2)
[This will give you the first 4000 bytes of the CLOB – in order to get more, you’d have to use PL/SQL]