Multiple INTO in stored procedure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • E11esar
    New Member
    • Nov 2008
    • 132

    Multiple INTO in stored procedure

    Hi there, I am working on creating an Oracle stored procedure and am running into all kinds of problems.

    Below is my first attempt at this and will hopefully highlight what it is I am trying to accomplish:

    Code:
    CREATE OR REPLACE PROCEDURE SADAS_MANAGER.LLPGAddSearchOne
    
    (
        p_postcode          in  varchar2, 
        p_paostartnumber    in  int,
        v_fulladd           out varchar2,
        v_lpi_usrn          out int,
        v_st_desc_usrn      out int,
        v_lpi_uprn          out varchar2,
        v_blpu_uprn         out varchar2
        
    ) 
    
    IS 
    
    BEGIN
     
    select  NLPG_LPI.SAO_START_NUMBER||' '||NLPG_LPI.SAO_START_SUFFIX||' '||NLPG_LPI.SAO_END_NUMBER||' '||NLPG_LPI.SAO_END_SUFFIX||' '||NLPG_LPI.SAO_TEXT||' '||
            NLPG_LPI.PAO_START_NUMBER||' '||NLPG_LPI.PAO_START_SUFFIX||' '||NLPG_LPI.PAO_END_NUMBER||' '||NLPG_LPI.PAO_END_SUFFIX||' '||NLPG_LPI.PAO_TEXT||' '||
            NLPG_BLPU.ORGANISATION||' '|| NSG_STREET_DESCRIPTOR.STREET_DESCRIPTOR||' '||NSG_STREET_DESCRIPTOR.TOWN_NAME||' '||NLPG_LPI.POSTCODE 
                                            into v_fulladd,
                                         
            NLPG_LPI.USRN                   into v_lpi_usrn, 
            NSG_STREET_DESCRIPTOR.USRN      into v_st_desc_usrn, 
            NLPG_LPI.UPRN                   into v_lpi_uprn, 
            NLPG_BLPU.UPRN                  into v_blpu_uprn
    
    FROM    NLPG_LPI, NLPG_BLPU, NSG_STREET_DESCRIPTOR 
    where   nlpg_lpi.postcode = p_postcode
    and     nlpg_lpi.pao_start_number =  p_paostartnumber
    and     nlpg_blpu.uprn = nlpg_lpi.uprn 
    and     nlpg_lpi.usrn = nsg_street_descriptor.usrn
    ORDER BY ABS(NLPG_LPI.PAO_START_NUMBER) ASC
    
    ;
    END;
    /
    I receive the followign error when I try this:

    "ERROR line 23, col 41, ending_line 23, ending_col 44, Found 'into', Expecting: @ or ( OVER or . or , or FROM"

    This is with the second INTO statement so I am wondering if my logic is obviously way out here.

    Any help will be very welcome please?

    Thank you.

    M :)
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You need to use only one select into clause
    eg.
    Code:
    select f1,f2,f3 into v1,v2,v3 from table1 t1 ,table2 t2 where  t1.f1=t2.f3 and.............

    Comment

    • E11esar
      New Member
      • Nov 2008
      • 132

      #3
      answer

      Thank you, that does the job :)

      Comment

      Working...