473,799 Members | 3,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stored Procedure Woes

Hello,

Decided (Finally!!!) to start testing out some of the new features 5.x has to offer. More specifically stored procedures and functions.
I have tried to create a procedure but I continue to get an error and I think my syntax is correct.....
Here is the code:
CREATE PROCEDURE usp_GetPermissi onGroups
(
IN WebFileName varchar(50),
IN PermGroupID int,
IN Action varchar(10)
)
BEGIN
SELECT * FROM webmanagement_f ilelist wf
LEFT JOIN webmanagement_g roupstofiles wg ON wf.intWebFileID = wg.intWebFileID
WHERE txtWebFileName= WebFileName AND intPermissionGr oupID = PermGroupID AND txtActionReques ted = Action
END

The SQL statement works fine on it's own and that is not the problem. The error is given for line 8 Which is where the Select statement begins, however
I see no error there. Could someone point me in the right direction with this. It is possible that the rest of my CREATE PROC statement is incorrect.
Any help would be appreciated.
Jul 20 '05 #1
1 1364
FYI,

Figured out my own question. Seems like the BEGIN....END block wasn't working correctly. I removed it and it worked. I figured
this out by reading the examples at the bottom of http://dev.mysql.com/doc/mysql/en/CREATE_PROCEDURE.html

The user states:

The problem was that the block within the Procedure was of multiple SQL statements.
To do that, you must surround it within a BEGIN ... END block.

//End

Since I did not have a block of statements I decided to remove the BEGIN...END and everything worked as I expected.


The Collective wrote:
Hello,

Decided (Finally!!!) to start testing out some of the new features 5.x
has to offer. More specifically stored procedures and functions.
I have tried to create a procedure but I continue to get an error and I
think my syntax is correct.....
Here is the code:
CREATE PROCEDURE usp_GetPermissi onGroups
(
IN WebFileName varchar(50),
IN PermGroupID int,
IN Action varchar(10)
)
BEGIN
SELECT * FROM webmanagement_f ilelist wf
LEFT JOIN webmanagement_g roupstofiles wg ON wf.intWebFileID =
wg.intWebFileID
WHERE txtWebFileName= WebFileName AND intPermissionGr oupID =
PermGroupID AND txtActionReques ted = Action
END

The SQL statement works fine on it's own and that is not the problem.
The error is given for line 8 Which is where the Select statement
begins, however
I see no error there. Could someone point me in the right direction with
this. It is possible that the rest of my CREATE PROC statement is
incorrect.
Any help would be appreciated.

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
22148
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my application server can talk to the database. I've determined the failure occurs when the the following statement is executed: cstmt.execute(); (due to the failure of println statements placed afterwards). I get the following error after trying to...
0
6706
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft Visual Basic .NET version of this article, see 308049. For a Microsoft Visual C++ .NET version of this article, see 310071. For a Microsoft Visual J# .NET version of this article, see 320627. This article refers to the following Microsoft .NET...
3
2807
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default" when I launched the IBM Distributed Debugger via D:\IBMDebug>idebug.exe -qdaemon -quiport=8000,8001 First, a bit of background. I am running DB2 V7.2 with Fixpack 9 applied on Windows XP Professional (all critical service applied). I've written...
4
3192
by: Rhino | last post by:
Is it possible for a Java Stored Procedure in DB2 V7.2 (Windows) to pass a Throwable back to the calling program as an OUT parameter? If yes, what datatype should I use when registering the Throwable as an OUT parameter and what datatype should I use in the CREATE PROCEDURE and DROP PROCEDURE statements? Here's what I tried: - the method signature for the stored procedure included: Throwable throwable
8
7948
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have created a temporary database with a tables space. Verified that DECLARE GLOBAL TEMPORARY TABLE TEMP (A INTEGER); INSERT INTO SESSION.TEMP VALUES(10); SELECT A FROM SESSION.TEMP; works from a query tool.
2
5462
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
3
1388
by: Andrew Hall | last post by:
Hello, We are using a number of stored procedures that are called often from our client programs. I include one here as an example. The problem we are seeing is that when executing some of these that deal with a large number of records, they begin execution and never return. The process handling the request chews 97% of CPU resources and must be cancelled before it will release. We have tried examining where in the process it stops via...
7
3470
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function 'UpdateRegistrant' expects parameter '@EMail', which was not supplied. The field value was null in the database and not changed in the FormView so is null going back into the stored procedure. I'm stumped and would greatly appreciate any suggestions.
2
4108
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
0
9544
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9077
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.