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 8877401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:27:35+00:00 2026-06-14T19:27:35+00:00

I am using 11g I have table CREATE TABLE Agency ( AgencyID int not

  • 0

I am using 11g
I have table

CREATE TABLE Agency
(
AgencyID          int   not null PRIMARY KEY,
AgencyName        VARCHAR2(30) not null,
AgencyLtrCode     VARCHAR2(10) not null,
IsActive          VARCHAR2(3) DEFAULT 'yes'NOT NULL,
LastListSentData  DATE DEFAULT SYSDATE ,
LetterSendDate    DATE DEFAULT SYSDATE ,
CertificationDate DATE DEFAULT SYSDATE ,
CeresNo       int,
AgencyAreaID      int not null,
CONSTRAINT fk_Agency FOREIGN KEY (AgencyAreaID) REFERENCES AgencyArea(AriaID)
);

I use procedure to insert new records in it

create or replace PROCEDURE insert_AGENCY_Procedure(
       AGENCYID IN AGENCY.AGENCYID%TYPE,
       AGENCYNAME IN AGENCY.AGENCYNAME%TYPE,
       AGENCYLTRCODE IN AGENCY.AGENCYLTRCODE%TYPE,  
       ISACTIVE IN AGENCY.ISACTIVE%TYPE DEFAULT 'yes',
       LASTLISTSENTDATA IN AGENCY.LASTLISTSENTDATA%TYPE DEFAULT SYSDATE,
       LETTERSENDDATE IN AGENCY.LETTERSENDDATE%TYPE DEFAULT SYSDATE,
       CERTIFICATIONDATE IN AGENCY.CERTIFICATIONDATE%TYPE DEFAULT SYSDATE,
       CERESNO IN AGENCY.CERESNO%TYPE,
       AGENCYAREAID IN AGENCY.AGENCYAREAID%TYPE)
IS BEGIN
  INSERT INTO AGENCY("AGENCYID", "AGENCYNAME","AGENCYLTRCODE","ISACTIVE","LASTLISTSENTDATA","LETTERSENDDATE","CERTIFICATIONDATE","CERESNO","AGENCYAREAID") 
  VALUES             (AGENCYID, AGENCYNAME,AGENCYLTRCODE,ISACTIVE,LASTLISTSENTDATA,LETTERSENDDATE,CERTIFICATIONDATE,CERESNO,AGENCYAREAID);
  COMMIT;
END;​​

right now it throw error “Error at line 17: PLS-00103: Encountered the symbol “” ”
line 17 had only END; on it

when I submit inserting which looks like

BEGIN
insert_AGENCY_Procedure(9003,'Some Other Church', 'SomOTCh','no',10-10-2011,10/10/2011,10/10/2011,17,2   );
END;

it throws error

ORA-06550: line 2, column 4:
PLS-00306: wrong number or types of arguments in call to 'INSERT_AGENCY_PROCEDURE'
ORA-06550: line 2, column 4:
PL/SQL: Statement ignored

or other insert like

BEGIN
insert_AGENCY_Procedure(9003,'Some Other Church',SomOTCh',DEFAULT,DEFAULT,DEFAULT,DEFAULT,17,2   );
END;

it throws error

ORA-06550: line 2, column 64:
PLS-00103: Encountered the symbol "DEFAULT" when expecting one of the following:

   ( - + case mod new not null 

The question is what is wrong with my procedure? I was trying to resolve this problem but stuck 🙁

  • 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-06-14T19:27:37+00:00Added an answer on June 14, 2026 at 7:27 pm

    First off, the INSERT_AGENCY_PROCEDURE procedure is defined to take 8 parameters but you are trying to pass in 9 parameters. It appears that you are trying to pass in an AgencyLtrCode but the procedure does not take an AgencyLtrCode as a parameter. You would either have to stop trying to pass in the AgencyLtrCode or you would need to modify the procedure to accept that parameter.

    Second, you need to pass dates to the procedure given the declaration. Your actual procedure call will error out because what you are passing in for the date parameters are not dates (and cannot be implicitly converted to dates). Assuming that we eliminate the third parameter (which is what appears to be the AgencyLtrCode discussed above), you would want something like

    BEGIN
      insert_AGENCY_Procedure(9003,
                              'Some Other Church', 
                              'no', 
                              to_date('10-10-2011', 'DD-MM-YYYY'), 
                              to_date('10/10/2011', 'DD/MM/YYYY'),
                              to_date('10/10/2011','DD/MM/YYYY'),
                              17,
                              2   );
    END;
    

    Third, your procedure is incorrect. The parameters LASTLISTSENTDATA, LETTERSENDDATE, and CERTIFICATIONDATE are defined as dates so you should not call to_date on them. If you do, you force Oracle to implicitly convert the date to a string using the session’s NLS_DATE_FORMAT, then convert the string back to a date using the explicit format mask. That will fail if the session’s NLS_DATE_FORMAT is not what you expect.

    Finally, declaring optional parameters in the middle of a procedure declaration is rarely correct. If you want to use positional binding and you want the ability to omit parameters, the optional parameters need to be at the end of the parameter list. You can define optional parameters in the middle of the parameter list and then use named binds (as DazzaL demonstrates) but that is seldom what you want to force future developers to use.

    In your updated procedure, the declaration of the AgencyLtrCode parameter appears to be incorrect

    AGENCYLTRCODE IN AGENCYLTRCODE%TYPE
    

    needs to be

    AGENCYLTRCODE IN AGENCY.AGENCYLTRCODE%TYPE
    

    You are missing the name of the table.

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

Sidebar

Related Questions

I have a situation like this: create table a( a_id number(38) not null, constraint
I'm using oracle 11g sql developer I have a varchar2 column with dates as
I am developing an application using oracle 11g, Java(struts2) and Hibernate. I have table
I am using oracle 11g and have a table with an XMLType. There are
I'm using Oracle 11g R2. I have a table with 9.1 billion rows. When
I am using Oracle 11g r2 . I have a table that stores images
We are using Seam 2.2.0 Java 1.6.14 Weblogic 10.3.1.0 (named 11g Doh!) I have
Using Oracle 11g release 2, the following query gives an ORA-01790: expression must have
we have written a C# 3.5 client talking to an Oracle database (11g) using
I am using oracle 11g and have written a stored procedure which stores values

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.