User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Oracle section within the Web Development category of DaniWeb, a massive community of 456,608 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,456 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Oracle advertiser: Programming Forums
Views: 1343 | Replies: 2 | Solved
Reply
Join Date: Nov 2006
Posts: 22
Reputation: Lost in Code... is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Lost in Code... Lost in Code... is offline Offline
Newbie Poster

Help error help

  #1  
Nov 6th, 2007
Greetings,

I'm having a heck of a time trying to get this pl/sql program to work. I'm to invoke it using shopper id and then again by shopper last name. I've banged my head on this for a while now and it seems that every change I make creates more problems. Here is my code, and i'll also include the error message. thanks

 CREATE OR REPLACE PACKAGE shop_query_pkg IS
    PROCEDURE shopper_search_pp
     (P_id     IN bb_shopper.IDSHOPPER%TYPE,
     p_name  OUT bb_shopper.LASTNAME%TYPE,
     p_city  OUT bb_shopper.CITY%TYPE,
     p_state  OUT bb_shopper.STATE%TYPE,
     p_pnum  OUT bb_shopper.PHONE%TYPE,
     p_email OUT bb_shopper.EMAIL%TYPE);
     PROCEDURE shopper_search_pp
    (p_name  IN  bb_shopper.LASTNAME%TYPE,
     p_id    OUT bb_shopper.IDSHOPPER%TYPE,
     p_city  OUT bb_shopper.CITY%TYPE,
     p_state OUT bb_shopper.STATE%TYPE,
     p_pnum  OUT bb_shopper.PHONE%TYPE,
     p_email OUT bb_shopper.EMAIL%TYPE);
  END;
  /
  CREATE OR REPLACE PACKAGE BODY shop_query_pkg 
  IS
    PROCEDURE shopper_search_pp
   (p_id     IN bb_shopper.IDSHOPPER%TYPE,
    p_name  OUT bb_shopper.LASTNAME%TYPE,
    p_city  OUT bb_shopper.CITY%TYPE,
    p_state  OUT bb_shopper.STATE%TYPE,
    p_pnum  OUT bb_shopper.PHONE%TYPE,
    p_email OUT bb_shopper.EMAIL%TYPE)
  IS
      BEGIN
              SELECT LASTNAME, CITY, STATE, PHONE, EMAIL
              INTO p_id, p_name, p_city, p_state, p_pnum, p_email
              FROM bb_shopper
              WHERE IDSHOPPER = p_id;
  END;  
    PROCEDURE shopper_search_pp
   (p_name IN bb_shopper.LASTNAME%TYPE,
    p_id OUT bb_shopper.IDSHOPPER%TYPE,
    p_city OUT bb_shopper.CITY%TYPE,
    p_state OUT bb_shopper.STATE%TYPE,
    p_pnum OUT bb_shopper.PHONE%TYPE,
    p_email OUT bb_shopper.EMAIL%TYPE)
    IS
      BEGIN
              SELECT IDSHOPPER, CITY, STATE, PHONE, EMAIL
              INTO p_name, p_id, p_city, p_state, p_pnum, p_email
              FROM bb_shopper
              WHERE LASTNAME = p_name;
    END;
  END;
  /
  



show errors

Errors for PACKAGE BODY SHOP_QUERY_PKG:
LINE/COL
ERROR
12/4
PL/SQL: SQL Statement ignored
13/9
PLS-00403: expression 'P_ID' cannot be used as an INTO-target of a SELECT/FETCH statement
14/4
PL/SQL: ORA-00913: too many values
26/6
PL/SQL: SQL Statement ignored
27/9
PLS-00403: expression 'P_NAME' cannot be used as an INTO-target o f a SELECT/FETCH statement
28/4
PL/SQL: ORA-00913: too many values



BTW, what do you use in the wrap code fields? I tried SQL and oracle. thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,445
Reputation: debasisdas is on a distinguished road 
Rep Power: 4
Solved Threads: 87
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Nearly a Posting Virtuoso

Re: error help

  #2  
Nov 7th, 2007
That is because both the variables P_ID and P_NAME are IN type variables. So you cant asign value to a In type variable in a select into statment.
Share your Knowledge.
Reply With Quote  
Join Date: Nov 2006
Posts: 22
Reputation: Lost in Code... is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Lost in Code... Lost in Code... is offline Offline
Newbie Poster

Re: error help

  #3  
Nov 7th, 2007
Thank you, I new it was something goofy. thanks for your input.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Oracle Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Oracle Forum

All times are GMT -4. The time now is 7:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC