473,465 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Stored procedure and variables

JamieHowarth0
533 Recognized Expert Contributor
Hi folks,

Major bugbear - I've just written a stored procedure as part of a challenge-response authentication system in classic ASP and VB. I won't post all my code but basically part of the authentication code is that the user's email address gets posted to my MySQL database server and returns a replication ID as the "challenge" token.

My SP code is as follows:
Expand|Select|Wrap|Line Numbers
  1. DELIMITER $$
  2.  
  3. CREATE DEFINER=`admin`@`%` PROCEDURE `NewAuthToken`(IN MyUsername VARCHAR(255), OUT MyNewToken VARCHAR(36))
  4. BEGIN
  5. SET MyNewToken = UUID();
  6. UPDATE tbl_customers SET AuthToken = MyNewToken WHERE tbl_customers.CltEmail = MyUsername;
  7. END $$
  8.  
  9. DELIMITER ;
  10.  
When I try and execute the above code I get the error "OUT or INOUT argument 2 for routine NewAuthToken is not a variable or NEW pseudo-variable in BEFORE trigger". I've tried declaring the variable using DECLARE but then I get an error on that too.

Any ideas?

Many thanks,

medicineworker
Feb 3 '08 #1
1 8003
JamieHowarth0
533 Recognized Expert Contributor
And it's fixed! Removed the IN and OUT specifications and for variables going OUT, simply passed a null value into the procedure. Challenge-Response in classic ASP accomplished!

If anyone is interested in my code then PM me (cause it involves a Javascript MD5 function, then passing this in and out of two stored procedures, so a couple of different files).

medicineworker
Feb 6 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Luis | last post by:
I'm using a SQL Server 2000 stored procedure similar to the one below to upload data to a database. This data is collected from the user on a number of asp pages and stored in session variables...
6
by: Shaun Stuart | last post by:
I've got a webpage that calls some stored procedures with input variables. The procedures return recordsets and also some output variables. We're trying to get the values of the output variables....
8
by: Tod Thames | last post by:
I currently have a sql statement that works great. I want to convert it to a stored procedure so I can generate results from a webpage. Below is the stored procedure that is working fine. ...
5
by: Raquel | last post by:
This is a very simple DB2 SQLJ stored procedure. The problem is that it seems to run fine but returns NOTHING. I mean..as if nothing has happened..not resultset is returned. I am passing value...
4
by: Mullin Yu | last post by:
i have a stored procedure at sql server 2k. which will update records and select result from temp table. if i use SqlConnection class, and i do both. but, if i use OleDbConnection class, i can...
5
by: Andy G | last post by:
I have a registration page that captures 75% of the users data. After they enter that info they are redirected to one of two pages depending on how they answered a question on the registation...
1
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 ( )...
9
by: Frawls | last post by:
Hi I Am am having problems with a stored Procedure that i wrote. Basically whats happening is that the Stored procedure Runs fine when i EXECUTE it in SQL Query analyzer. But when i debug...
1
by: barmatt80 | last post by:
I have found alot of help on this site, and is helping me along. I am having trouble with a stored procedure. This is my first stored procedure. The task I was given was to create a stored...
0
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
1
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...
0
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...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.