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?
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!