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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:42:33+00:00 2026-05-16T05:42:33+00:00

I am new to using procedures and cannot seem to get mine working. I

  • 0

I am new to using procedures and cannot seem to get mine working. I am using MySQL v5.1.36 and inputing my code using MySQL Console on a WAMPP server. If I go to (re)create the procedure. I get error #1304 (42000).

mysql>  DELIMITER //
mysql>
mysql>  CREATE PROCEDURE modx.getCRID (IN x VARCHAR(255),OUT y INT)
    ->  BEGIN
    ->          DECLARE y INT;
    ->          SELECT id INTO y
    ->          FROM `modx`.coverage_region
    ->          WHERE `coverage_region`.name = x;
    ->  END//
ERROR 1304 (42000): PROCEDURE getCRID already exists
mysql>
mysql>  DELIMITER ;

However, if I try to use the procedure I get error #1305 (42000).

mysql> USE modx;
Database changed
mysql> SET @crID = modx.getCRID("South East");
ERROR 1305 (42000): FUNCTION modx.getCRID does not exist

If the procedure exists for one how can it not exist for the other? What am I doing wrong.

  • 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-16T05:42:34+00:00Added an answer on May 16, 2026 at 5:42 am

    I believe the problems are

    1. The first error occurs because you are attempting to re-create an existing procedure. If you were to drop the procedure first you would not get this error,
    2. The second error is because PROCEDUREs are invoked with CALL statements, while FUNCTIONs are invoked as function references, as in your code. You must define a FUNCTION, not a PROCEDURE. The (MySQL documentation) says:

    The CREATE FUNCTION statement is also
    used in MySQL to support UDFs
    (user-defined functions). See Section
    21.2, “Adding New Functions to MySQL”. A UDF can be regarded as an external
    stored function. Stored functions
    share their namespace with UDFs. See
    Section 8.2.3, “Function Name Parsing
    and Resolution”, for the rules
    describing how the server interprets
    references to different kinds of
    functions.

    To invoke a stored procedure, use the
    CALL statement (see Section 12.2.1,
    “CALL Syntax”). To invoke a stored
    function, refer to it in an
    expression. The function returns a
    value during expression evaluation.

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

Sidebar

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.