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

  • Home
  • SEARCH
  • 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 3950206
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:35:05+00:00 2026-05-20T01:35:05+00:00

Hello I am a php developer, trying to get going with Oracle. So I

  • 0

Hello I am a php developer, trying to get going with Oracle. So I need to pass a collection of variables into an Oracle stored procedure. So as a basic try, I am trying to access a procedure which would accept three parameters, out of which two would be varrays, but when I pass the declared varrays, I am getting an error. I am pretty sure, it is something to do with a little syntax, but i am not able to figure out that thing.

Below is my table schema and stored procedure:

create table emails (
user_id varchar2(10),
friend_name varchar2(20),
email_address varchar2(20));

create or replace type email_array as varray(100) of varchar2(20);
/
show errors
create or replace type friend_array as varray(100) of varchar2(20);
/
show errors

create or replace procedure update_address_book(
p_user_id in varchar2,
p_friend_name friend_array,
p_email_addresses email_array)
is
begin
delete from emails where user_id = p_user_id;
forall i in indices of p_email_addresses
insert into emails (user_id, friend_name, email_address)
values (p_user_id, p_friend_name(i), p_email_addresses(i));
end update_address_book;

Now, below pasted is my the way I am trying to access this procedure from an anonymous block.

declare 
  type email_list is varray(100) of varchar2(20);
  type friend_list is varray(100) of varchar2(20);
  emails email_list;
  friends friend_list;
begin
 emails :=email_list('khwaja@gmail.com','sayya@gmail.com','mayya@gmail.com');
 friends := friend_list('kwaja','sayya','mayya');
 execute update_address_book('1',emails,friends);
end; 

The error I am getting is near the execute, I think I am not supposed to execute a procedure inside a declare block, but I am unable to understand how would I work around.

  • 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-20T01:35:05+00:00Added an answer on May 20, 2026 at 1:35 am

    You don’t need the keyword EXECUTE to call the procedure from within a PL/SQL block. Just remove that word.

    But it would be helpful if you showed the actual error(s) you’re getting as there could be something else wrong. For example, you also have the parameters to the update_address_book() call in the wrong order, and you’re recreating new types inside your block instead of using the ones declared earlier.

    This will run:

    declare 
        emails email_array;
        friends friend_array;
    begin
        emails := email_array('khwaja@gmail.com','sayya@gmail.com','mayya@gmail.com');
        friends := friend_array('kwaja','sayya','mayya');
        update_address_book('1',friends,emails);
    end;
    /
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dup of Some Basic PHP Questions Hello, I have a heap of tinyint fields
Hello I am compiling a program with make but I get the error of
intro Hello, I'm trying to develop some plugin or / and object in javascript,
hello I am a wordpress theme developer. i created a theme which works fine
I'm a new Java developer I've only ever done PHP in the past and
Hello I just start to develop php what I want to do is to
In PHP, it is possible to do this: <input type=text value= <?php echo Hello
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello again ladies and gents! OK, following on from my other question on ASP.NET
Hello I was writing a Regular Expression (first time in my life I might

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.