But the scope of a prepared statement is only the session? I want a stored
procedure to avoid some sql in clientside code...Or do you mean a prep in
the stored?

/Jon

On 7/25/06, Burke, Dan <[EMAIL PROTECTED]> wrote:


If I understand correctly, what you need is prepared statements.

http://dev.mysql.com/doc/refman/5.0/en/sqlps.html

Dan.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon
Sent: Tuesday, July 25, 2006 7:44 AM
To: Visolve DB Team
Cc: mysql@lists.mysql.com; Sena
Subject: Re: Stored procedures

On 7/25/06, Visolve DB Team <[EMAIL PROTECTED]> wrote:
>
> Hello  Jon.


Hi there Team :)

And thanks for the quick reply

Could you tell me the version of MySql ?. You can find the version by
> excuting the command
>
> SELECT version()
>
> If the version is below 5, the stored procedure feature would not work
.



The version shown is 5.0.21-standard (from the rpm
MySQL-server-standard-5.0.21-1.rhel3).

I have no problem with other sp, like:
CREATE PROCEDURE sp_test3 (IN value int)
select count(*) from some_table where foo > value;

It's just defining table and limit I've had problems with (there is also
one
mentioning this in the manual about creating sp
http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html )

So could it be that it's not possible?

/Jon


Thanks
> Visolve DB Team.
>
>
>
> ----- Original Message -----
> From: "Jon" <[EMAIL PROTECTED]>
> To: <mysql@lists.mysql.com>
> Sent: Tuesday, July 25, 2006 2:40 PM
> Subject: Stored procedures
>
>
> > Hi list
> >
> > I'm trying to make stored procedures use parameters for limit and
> tables,
> > I
> > guess this is either me using the wrong datatype or it's not
possible.
> > I'm
> > having the same issue with seting the table for the query:
> >
> > CREATE  PROCEDURE sp_test1 (IN some_limit int)
> > select * from some_table limit some_limit;
> >
> > and
> > CREATE  PROCEDURE sp_test2 (IN some_table table)
> > select * from some_table;
> >
> >
> > Both fail with "ERROR 1064 (42000)".
> >
> > Can someone please shed some light on this for me? Is this a problem
> with
> > procedures not being able to do this or is it wrong datatypes or
> something
> > completely different?
> >
> > Thanks in advance
> > Jon
> >
>
>


----------------------------------------------------------------------
This message has been scanned for viruses by TechTeam's email gateway.


-----------------------------------------------------------------------------------------------------------------------
This e-mail transmission is strictly confidential and intended solely
for the person or organization to whom it is addressed. It may contain
privileged and confidential information and if you are not the intended
recipient, you must not copy, distribute or take any action in reliance
on it. If you have received this e-mail in error, please notify the sender
as soon as possible and delete the e-mail message and any attachment(s).
This message has been scanned for viruses by TechTeam's email gateway.


...

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


Reply via email to