• How do I access a specific member in a file using SQL

    From Sandro L.@21:1/5 to All on Wed Sep 16 08:24:14 2020
    Il giorno venerdì 16 giugno 2000 alle 09:00:00 UTC+2 Gilad Gordon ha scritto:
    hi Elbert,
    suppose you want to access member CPNY02 of file CUSTPF.
    first of all, use the following statement:
    CREATE ALIAS CUST_C02 FOR CUSTPF(CPNY02)
    now that you have an alias on that file use the next statement:
    SELECT * FROM CUST_C02 ALIAS
    to access the desired member.
    hope this helps.
    --
    Gilad Gordon
    Segment IT (Israel)
    gi...@segment.co.il
    <elb...@cmfurniture.com> wrote in message
    news:3948db6d...@news.abts.net...
    I am writing an inquiry program in RPGLE with embedded SQL. I wish to access data from a specific member in a physical file. I can't figure
    out how to code the SELECT FROM statement to point to the file member
    I need.

    Does SQL support multiple members in a physical file?

    We're using an AS400 model 170, V4R4. Any help would be appreciated.

    Elbert Cook
    AS/400 Programmer
    Craftmaster Furniture

    is the alias persistent?
    i would need to do spot queries on some files with members but i do not want to create permament aliases is that possible now?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Zich@21:1/5 to All on Wed Sep 16 12:50:31 2020
    Am Mittwoch, 16. September 2020 17:24:18 UTC+2 schrieb Sandro L.:
    Il giorno venerdì 16 giugno 2000 alle 09:00:00 UTC+2 Gilad Gordon ha scritto:
    hi Elbert,
    suppose you want to access member CPNY02 of file CUSTPF.
    first of all, use the following statement:
    CREATE ALIAS CUST_C02 FOR CUSTPF(CPNY02)
    now that you have an alias on that file use the next statement:
    SELECT * FROM CUST_C02 ALIAS
    to access the desired member.
    hope this helps.
    --
    Gilad Gordon
    Segment IT (Israel)
    gi...@segment.co.il
    <elb...@cmfurniture.com> wrote in message
    news:3948db6d...@news.abts.net...
    I am writing an inquiry program in RPGLE with embedded SQL. I wish to access data from a specific member in a physical file. I can't figure
    out how to code the SELECT FROM statement to point to the file member
    I need.

    Does SQL support multiple members in a physical file?

    We're using an AS400 model 170, V4R4. Any help would be appreciated.

    Elbert Cook
    AS/400 Programmer
    Craftmaster Furniture

    is the alias persistent?
    i would need to do spot queries on some files with members but i do not want to create permament aliases is that possible now?

    The statement
    SELECT * FROM CUSTPF MBR(CPNY02)
    should work for you :-)

    Regards
    Peter Zich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)