Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2012
    Posts
    33

    Unanswered: Create function and error

    Hello. Following is my function:
    Code:
    CREATE OR REPLACE FUNCTION DOWNLOAD_ADDRESS(id_in_person int,id_in_type_address int) RETURN VARCHAR2 IS
    address_return varchar2(1000);
    BEGIN
    SELECT street, no_home, no_local, place, posta_code INTO address_return FROM address where address.id_operson=id_in_person AND address.id_type_address=id_in_address;
      RETURN address_return;
    END DOWNLOAD_ADDRESS;
    
    - SQL Statement ignored
    - ORA-00947 : not enough values
    Thanks for advanced

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Number of columns you SELECT must be equal to number of variables you select INTO.

    For example:
    Code:
    select street into address_return
    or
    select street ||', '|| no_home into address_return
    etc.

  3. #3
    Join Date
    Aug 2012
    Posts
    33
    Thanks It's working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •