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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:27:18+00:00 2026-06-03T22:27:18+00:00

I want to create a stored procedure with 4 insert and i have this

  • 0

I want to create a stored procedure with 4 insert and i have this code

  Driver * driver = get_driver_instance();
  auto_ptr< Connection > vCon(driver->connect(getHost(), getUser(), getPassword()));
  vCon->setSchema(getDB());
  auto_ptr< Statement > vStmt(vCon->createStatement());

  vStmt->execute("DROP PROCEDURE IF EXISTS add");
  vStmt->execute("CREATE PROCEDURE add() begin DECLARE vEvId int DEFAULT 0; DECLARE vAdrEvId int DEFAULT 0; insert into adrEv(den) values('test'); select last_insert_id() into vAdrEvId; insert into ev(den,adrEvId) values('test',vAdrEvId);  select last_insert_id() into vEvId;  ... other insert ...   END;");

  vStmt->execute("CALL add()");
  vStmt->execute("DROP PROCEDURE IF EXISTS add");

whay i get this error # ERR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add' at line 1 (MySQL error code: 1064, SQLState: 42000 )

  • 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-03T22:27:19+00:00Added an answer on June 3, 2026 at 10:27 pm

    ADD is a reserved word for MySQL. Try using a more specific/descriptive procedure name.

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

Sidebar

Related Questions

I have a stored procedure in which i want to create a user defined
I want to write a stored procedure like this Create Proc dbo.GetApplicantsByIDs as Select
I have a stored procedure like this: CREATE PROCEDURE up_action (@id int ,@group varchar(30)=''
I want to create a stored procedure (on SQL Server 2005) that fetches a
I have information stored in a database that I want to use to create
I have a stored procedure written in T-SQL and want to use a table
I want a stored-procedure to create a temporary table, populate the table with data,
I have a stored Procedure (Generate_Insert)which will output an Insert statement as output given
I have written a stored procedure in SQL Server 2000. I want a serial
When I create areport in VS 2008 and try to use this stored procedure

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.