Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 585337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:59:32+00:00 2026-05-13T14:59:32+00:00

i keep getting the following errror, ‘ORA-01008: not all variables bound’, im guessign its

  • 0

i keep getting the following errror, ‘ORA-01008: not all variables bound’, im guessign its
all based on my pPostcode param but im not sure.
I am a beginner the the whole PLSQL secne and any help would be greatly apriciated

here is my procedure:

 procedure all_customer_postcode(pPostcode in carer.postcode%type
                                ,pReport out SYS_REFCURSOR) is
  begin
    open pReport for
      select c.id, c.forename, c.surname,c.address_1,c.address_2,
             c.address_3,c.address_4, c.postcode, c.date_of_birth, cf.id    
        from customer c, customer_friend cf,customer_friend_for cff 
       where c.id = cff.customer_id AND cff.id = cff.customer_friend_id
       AND c.postcode = pPostcode;
  end;

Thanks Jon

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:59:32+00:00Added an answer on May 13, 2026 at 2:59 pm

    I have amended your procedure slight, as the WHERE clause you published didn’t make sense to me…

    SQL> create or replace procedure all_customer_postcode
      2          (pPostcode in customer.postcode%type
      3                                  ,pReport out SYS_REFCURSOR) is
      4  begin
      5      open pReport for
      6        select c.id
      7               , c.forename
      8               , c.surname
      9               ,c.address_1
     10               ,c.address_2
     11               ,c.postcode
     12               , c.date_of_birth
     13               , cf.id  as cf_id
     14          from customer c
     15              , customer_friend cf
     16              ,customer_friend_for cff
     17         where c.id = cff.customer_id
     18         AND cf.id = cff.customer_friend_id
     19         AND c.postcode = pPostcode;
     20  end;
     21  /
    
    Procedure created.
    
    SQL>
    

    Calling it in SQL*Plus with variables works …

    SQL> var rc refcursor
    SQL> var pc varchar2(8)
    SQL> exec :pc := 'ML1 4KJ'
    
    PL/SQL procedure successfully completed.
    
    SQL> exec all_customer_postcode(:pc, :rc)
    
    PL/SQL procedure successfully completed.
    
    SQL> print rc
    
            ID FORENAME   SURNAME    ADDRESS_1            ADDRESS_2            POSTCODE DATE_OF_B      CF_ID
    ---------- ---------- ---------- -------------------- -------------------- -------- --------- ----------
             1 Joe        Chip       1234 Telepath Drive  Milton Lumpky        ML1 4KJ  01-FEB-90         11
             4 Ray        Hollis     777 Telepath Drive   Milton Lumpky        ML1 4KJ  01-SEP-81         44
             5 Pat        Conley     1235 Telepath Drive  Milton Lumpky        ML1 4KJ  01-OCT-91         55
    
    SQL>
    

    So, how can we get it to hurl an ORA-1008? By turning the query into a string and changing the way the parameter is declared…

    SQL> create or replace procedure all_customer_postcode
      2          (pPostcode in customer.postcode%type
      3                                  ,pReport out SYS_REFCURSOR) is
      4  begin
      5      open pReport for
      6        'select c.id
      7               , c.forename
      8               , c.surname
      9               ,c.address_1
     10               ,c.address_2
     11               ,c.postcode
     12               , c.date_of_birth
     13               , cf.id  as cf_id
     14          from customer c
     15              , customer_friend cf
     16              ,customer_friend_for cff
     17         where c.id = cff.customer_id
     18         AND cf.id = cff.customer_friend_id
     19         AND c.postcode = :pPostcode';
     20  end;
     21  /
    
    Procedure created.
    
    SQL> exec all_customer_postcode(:pc, :rc)
    BEGIN all_customer_postcode(:pc, :rc); END;
    
    *
    ERROR at line 1:
    ORA-01008: not all variables bound
    ORA-06512: at "APC.ALL_CUSTOMER_POSTCODE", line 5
    ORA-06512: at line 1
    
    
    SQL>
    

    so let’s fix that …

    SQL> create or replace procedure all_customer_postcode
      2          (pPostcode in customer.postcode%type
      3                                  ,pReport out SYS_REFCURSOR) is
      4  begin
      5      open pReport for
      6        'select c.id
      7               , c.forename
      8               , c.surname
      9               ,c.address_1
     10               ,c.address_2
     11               ,c.postcode
     12               , c.date_of_birth
     13               , cf.id  as cf_id
     14          from customer c
     15              , customer_friend cf
     16              ,customer_friend_for cff
     17         where c.id = cff.customer_id
     18         AND cf.id = cff.customer_friend_id
     19         AND c.postcode = :pPostcode' using pPostcode;
     20  end;
     21  /
    
    Procedure created.
    
    SQL> exec all_customer_postcode(:pc, :rc)
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    So I have managed to recreate an ORA-1008; I’m not sure whether it matches your ORA-1008 situation. Your intuition is right, it is something to do with how the value in pPostcode is passed to the query. It is just that the code you posted actually does it correctly and so doesn’t fail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting the following error when debugging. Cross-thread operation not valid: Control 'richTextBoxReceivedMsg'
I keep getting the following error Could not find a base address that matches
I have a web app built against asp.net 2.0, but keep getting the following
I keep getting the following error, I open visual studio and after a while
I keep getting the following error: Cannot access a disposed object. Object name: 'AdoTransaction'.
I keep getting the following error: AttributeError: Caribou instance has no attribute 'on_key_up' The
I keep getting the following error message ERROR 1064 (42000): You have an error
When I deploy my application to GoogleAppEngine I keep getting the following error Uncaught
I'm pretty new to ruby, I keep getting the following error: in gem_original_require': ./helpers/navigation.rb:28:
What is wrong with the statement below? I keep getting the following error message....

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.