How to create a SQL VIEW of the file to present packed or binary values as characters? I know we can create an sql view using CREATE VIEW library/view1 AS SELECT * FROM library/filename. But can anyone tell me how to present packed or binary values as characters using this? I used the command cast but it threw error keyword cast not expected. My As400 version is V4R2.
I gave command CREATE VIEW palib/sijiq AS SELECT GGMID as GGMID, cast(GCMPNY as char(2)) as GCMPNY,GPCNTR as GPCNTR,GACC as GACC, GRP1 as GRP1, GRP2 as GRP2, GRP3 as GRP3,GMDESC as GMDESC, cast(GPD1 as char(8)) as GPD1,cast(GPD2 as char(8)) as GPD2 from bpcsfe2/ggm. It throws me "Keyword CAST not expected. Valid tokens: , FROM INTO." Sometimes getting error "Column list required for CREATE VIEW".
Is there any thing else I need to do?
May 2, 2012 7:18 AM
June 13, 2013 5:16 PM