I'm still trying to get the hang of stored procedures. In the constant cycle of revising a procedure, I need to drop a procedure if it's already in the database and add its replacement. Not hard. So what's wrong with this easy drop/add procedure sequence? - DROP PROCEDURE changeValue;
-
ADD PROCEDURE changeValue (IN val INT)
-
BEGIN
-
SET val = val - 1;
-
END;
Each statement individually works, and I can't spot anything that would break the query above. Heck, I can't spot any differences between this and sample code.
8 1509
I'm still trying to get the hang of stored procedures. In the constant cycle of revising a procedure, I need to drop a procedure if it's already in the database and add its replacement. Not hard. So what's wrong with this easy drop/add procedure sequence? - DROP PROCEDURE changeValue;
-
ADD PROCEDURE changeValue (IN val INT)
-
BEGIN
-
SET val = val - 1;
-
END;
Each statement individually works, and I can't spot anything that would break the query above. Heck, I can't spot any differences between this and sample code.
If I'm not mistaken, it's CREATE PROCEDURE, not ADD PROCEDURE
maybe that's the error?
Oh god. *facepalm*
I must've started out with CREATE PROCEDURE (because it had processed earlier), and then changed it to ADD PROCEDURE along the line.
Thanks!
OK, looks like I'm still stumped. This version, too, has a syntax problem I can't spot. Disregard the fact that inValue and dayCount don't do anything. - CREATE PROCEDURE myProc (IN inValue INT)
-
BEGIN
-
DECLARE myCount INT;
-
END;
Heya, Spamguy.
What is the full text of the error that MySQL is reporting?
Hiya:
I'll pass it along when I get to the database tomorrow morning. But trying it on a second computer, it works. Doubly baffling!
Heya, Spamguy.
Is the procedure already created on the other computer?
Try calling
first.
I...don't understand. I spent 15 minutes yesterday debugging this procedure before posting here. And now it works effortlessly. *sigh*
Thanks anyway.
Heya, Spamguy.
Figure it this way:
Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: kjc |
last post by:
I have a stored procedure what produces N number of rows.
The rows are ordered by a cataegoryType as follows
catA
catB
catC
What is needed to do on the C++ code side is break these out...
|
by: mas |
last post by:
I have a Stored Procedure (SP) that creates the data required for a
report that I show on a web page. The SP does all the work and just
returns back a results set that I dump in an ASP.NET...
|
by: Lili |
last post by:
I'm having problems creating a simple stored procedure in DB2. Can
someone help? Here is the screen dump when I tried to load the stored
procedure. Thanks for any help.
Create procedure...
|
by: Nils Magnus Englund |
last post by:
Hi,
I've made a HttpModule which deals with user authentication. On the first
request in a users session, it fetches data from a SQL Server using the
following code:
using (SqlConnection...
|
by: mooreit |
last post by:
The purpose for my questions is accessing these technologies from
applications. I develop both applications and databases. Working with
Microsoft C#.NET and Microsoft SQL Server 2000 Production and...
|
by: E.T. Grey |
last post by:
I have been busting my nut over this for pretty much most of the day and
it is driving me nuts. I posted this to an mySQL ng yesterday and I have
not had any response (I'm pulling my hair out...
|
by: James |
last post by:
How can I see/set the timeout for a postback? I have a button click event
which loops through a DataSet and calls a stored procedure for every record
in the dataset. This can be a very large...
|
by: peaceburn |
last post by:
Hi,
I'm gonna pull my hair in the coming days with these DB2 stored
procedures.
So the issue, let's assume a simple stored procedure like this :
CREATE PROCEDURE MYSCHEMA.PROCEDURE1 ( )...
|
by: Ted |
last post by:
In MS SQL I used the following to create a stored procedure.
USE AdventureWorks;
GO
IF OBJECT_ID ( 'HumanResources.usp_My_Search', 'P' ) IS NOT NULL
DROP PROCEDURE HumanResources.usp_My_Search;...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |