If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Functions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-26-04, 10:48
trieder trieder is offline
Registered User
 
Join Date: Sep 2003
Posts: 69
Functions

I have been fooling around with Functions and Stored Procedures trying to get a feel for them (PL/SQL was pretty easy, so I figured this couldn't be very hard). Any ideas on what's wrong with this (the documentation is slightly lacking):

delimiter $
CREATE FUCNTION isemployee(first VARCHAR(16), last VARCHAR(16)) RETURNS TINYINT
DECLARE CT TINYINT;
SELECT COUNT(EmployeeId)
INTO CT
FROM Employee WHERE
FName = First AND LName = Last;
RETURN CT;
$

ERROR 1064 (42000): 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 'FUCNTION isemployee(first VARCHAR(16), last VARCHAR(16)) RETURNS TINYINT
DECLARE' at line 1
Reply With Quote
  #2 (permalink)  
Old 08-26-04, 14:05
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
If you've just cut and pasted to here then you have the word function typed incorrectly and that is probably messing you up. If it is something other than that sorry I can't help further.
Reply With Quote
  #3 (permalink)  
Old 08-27-04, 00:48
trieder trieder is offline
Registered User
 
Join Date: Sep 2003
Posts: 69
Hah, yes this was actually my problem. I ran into another problem, but it turns out that Functions do not support DML. Go figure. You can do it in Oracle :/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On