Jump to content


Photo

Problem In Creating Stored Procedure

stored procedure

  • Please log in to reply
3 replies to this topic

#1 pseudocod

pseudocod

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 04 November 2012 - 03:31 AM

DELIMITER //
CREATE PROCEDURE NEW_CUST(IN c_name VARCHAR(50),IN c_fname VARCHAR(50),IN c_g_n VARCHAR(50),IN c_address VARCHAR(50),IN c_city VARCHAR(50),IN c_cont INT)
BEGIN
INSERT INTO customer_info(c_name,c_fname,c_g_n,c_address,c_city,c_contact)
VALUES(c_name,c_fname,c_g_n,c_address,c_city,c_contact)
END//
DELIMITER ;

i m not able to compile this 'new_cust' stored procedure. Please make me correct.


sqlYog is reporting this error number : 1064
Error Description : 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 'END' at line 5...


Actually I m from sql server background and got to work with mysql. Hope you would understand my problem.

Thank you!

#2 shubh

shubh

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • Gender:Male

Posted 04 November 2012 - 08:47 AM

Hi,

Although I am answering to your problem., but this forum is for discussions on issues related to SQLyog, not MySQL.

You have not placed ';' in your insert query. Corrected one is written below:

DELIMITER //
CREATE PROCEDURE NEW_CUST(IN c_name VARCHAR(50),IN c_fname VARCHAR(50),IN c_g_n VARCHAR(50),IN c_address VARCHAR(50),IN c_city VARCHAR(50),IN c_cont INT)
BEGIN
INSERT INTO customer_info(c_name,c_fname,c_g_n,c_address,c_city,c_contact)
VALUES(c_name,c_fname,c_g_n,c_address,c_city,c_contact);
END//
DELIMITER ;

#3 pseudocod

pseudocod

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 04 November 2012 - 10:21 AM

Hi,

Although I am answering to your problem., but this forum is for discussions on issues related to SQLyog, not MySQL.



Thank you so much for your time here. However, I would keep this thing in my mind for future reference. Thanks again sir!

#4 attilialats

attilialats

    Newbie

  • Members
  • Pip
  • 3 posts
  • Gender:Female
  • Location:135232

Posted 28 March 2017 - 07:40 AM

Im using Firebird, how can I create a Stored Procedure in a database with zeos ?
I tried using zquer.sql.add and zquery.exec but if the procedure is too long I receive error.

Thank You

вот





Also tagged with one or more of these keywords: stored procedure

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users