473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Prepare statement allows only global variables?

Expand|Select|Wrap|Line Numbers
  1. SET @qry = 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
  2. PREPARE stmt2 FROM @s;
  3. SET @first_param = 6;
  4. SET @sec_param = 8;
  5. EXECUTE stmt2 USING @first_param, @sec_param;
  6.  
These are few lines in my stored procedure. Here if I change the identifiers @qry, @first_param, @sec_param to qry, first_param, sec_param respectively
mysql doesn't allow to compile the stored procedure.

Why only global variables are allowed here?
Oct 6 '08 #1
0 1132

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

Similar topics

8
by: David Hitillambeau | last post by:
Hi guys, As I am new to Python, i was wondering how to declare and use global variables. Suppose i have the following structure in the same module (same file): def foo: <instructions>...
2
by: claus.hirth | last post by:
I wrote a stored procedure that uses a prepared INSERT INTO statement in order to play with the PREPARE and EXECUTE keywords. In transcript 1 below the call to that stored procedure does not...
0
by: RG | last post by:
OleDbCommand.Prepare error: Size of parameter (VB.NET 2003) I need to do a SQL INSERT statement into an Access table, and I’d like to use the exact technique described in the Help file example...
2
by: Rajat Katyal | last post by:
Hi: I prepare the statement for execution as follows: PREPARE query(text) as SELECT count(*) FROM transform_customer_billing where inv_no = $1; The problem is Iam not able to execute this...
35
by: Thierry Loiseau | last post by:
Hello all, and Happy end year 2005 ! Well, I would like to obtain a list of all JavaScript var statement, With "for...in" perharps ? That is bellow my recent test here, but the problem is...
1
by: rAinDeEr | last post by:
Hi, I have started using DB2 UDB ESE v8.2 in Linux recently. I have seen a lot of articles on packages, prepare statement, bind and execute statement. I havent got a clear idea. I have...
13
by: eman1000 | last post by:
I was recently looking at the prototype library (http://prototype.conio.net/) and I noticed the author used the following syntax: Object.extend(MyObj.prototype, { my_meth1: function(){},...
0
by: Gordon | last post by:
With the move over to PHP 5.x I' mnow writing a lot of code that makes use of prepared statements as the PHP manual has nothing but good things to say about them. They have less overhead for the...
1
by: Massimiliano Campagnoli | last post by:
Hy, I am trying to understand how the prepare statement works. I am using Qt C++ library to access db2: { .... QSqlQuery cust_query; cust_query.prepare("SELECT CUST_NAME FROM CUSTOMERS...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.