Avatar of bhsdba50
bhsdba50
Flag for United States of America asked on

creating a view

I have to create a view to be used as a export.  The target has columns not contained in the source. How do I reference and define the space without the column name? NOTE -- Means no column_name in table.

select RPAD(REC,2,'I') REC,
       RPAD(SUPP,8,' ')SUPP,
       RPAD(INVOICE,12,' ') INVOICE,
       TO_CHAR(IDATE, 'MM/DD/RR') IDATE,
       TO_CHAR(DDUE, 'MM/DD/RR') DDUE,
       RPAD(ICAMNT,12,' ') ICAMNT,
       --RPAD(NVL(SEP_CHK_CODE,1,'N') SEP_CHECK_CODE,
       RPAD(NVL(OREF,15,' ') OREF,
       RPAD(ICHRG,12,' ') ICHRG
       RPAD(NVL(NUM,'0'),68,' '),
        --   RPAD(NVL(IMPTFR,'M'),11,' ')
      from <table_name>;
SQL

Avatar of undefined
Last Comment
Sean Stuber

8/22/2022 - Mon
Sean Stuber

just create an alias

select RPAD(REC,2,'I') REC,
       RPAD(SUPP,8,' ')SUPP,
       RPAD(INVOICE,12,' ') INVOICE,
       TO_CHAR(IDATE, 'MM/DD/RR') IDATE,
       TO_CHAR(DDUE, 'MM/DD/RR') DDUE,
       RPAD(ICAMNT,12,' ') ICAMNT,
       NULL  some_column,
       RPAD(NVL(SEP_CHK_CODE,1,'N') SEP_CHECK_CODE,
       RPAD(NVL(OREF,15,' ') OREF,
       RPAD(ICHRG,12,' ') ICHRG
       RPAD(NVL(NUM,'0'),68,' '),
       NULL some_other_column,
       RPAD(NVL(IMPTFR,'M'),11,' ')
      from <table_name>;
bhsdba50

ASKER
How do I define the spce needed?  NULL (BCOLUMN ,4,' ')    ?????
ASKER CERTIFIED SOLUTION
Sean Stuber

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck