MySQL Forums
Forum List  »  Stored Procedures

Stored Procedure Syntax
Posted by: Paranoid Android
Date: November 03, 2005 09:30PM

--------------------------------------------------------------------------------

Hello,

I have been writing stored procedures for a while, however, I am new to writing stored procedures in MySQL.

I have some basic questions that I am having problems figuring out. My stored procedure looks like the following and the question related to it follow:

CREATE PROCEDURE `dbName`.`INSERT_USER`
(
_id CHAR(36),
_username VARCHAR(255),
_password VARCHAR(255),
_isActive BOOLEAN
)
BEGIN
INSERT INTO
user
(
id,
username,
password,
isActive
)
VALUES
(
_id,
_username,
_password,
_isActive
)
END

1. How do you use reserved words/functions as a column name? As you can see, I have 'password' as a column in my user table and I can't seem to figure out how to insert values into it through a stored procedure.

2. Can a parameter contain a "BOOLEAN" type? I was curious because my editor is not highlighting it as a keyword for stored procedure creation.

3. Can I declare parameters using the '@' like SQL server? I would like to do this for the sake of consistency. For example, instead of '_id', could I use '@id'?

Thank you so much!
Crystal

Options: ReplyQuote


Subject
Views
Written By
Posted
Stored Procedure Syntax
4099
November 03, 2005 09:30PM
1948
November 04, 2005 12:16AM
1876
November 06, 2005 09:34PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.