Hello, Jamie!
Are there any directives that should be included in my.cnf. I tried your
example below using "MySQL Control Center" and I still get errors...
CREATE PROCEDURE simpleproc (OUT param11 INT)
declare param1 int
SELECT COUNT(*) INTO param1 FROM test.t
[mysqlcctmp_1] ERROR 1064: You have an error in your SQL syntax. Check the
manual that corresponds to your MySQL server version for the right syntax to
use near 'declare param1 int' at line 1
AND
[mysqlcctmp_1] ERROR 1311: Undeclared variable: param1
Fredrick
----- Original Message -----
From: "jamie murray" <jamie.murray@stripped>
To: "Fredrick Bartlett" <palmtreefrb@stripped>; <win32@stripped>
Sent: Friday, January 02, 2004 9:00 PM
Subject: Re: MySQL 5.0
> Hey fred like I mentioned I'm also a win32 user and had similar
> results(things just aren't working the installer version was even worse).
> But the problem with the example below is the parameter in the select
> statement(param1) which should be the same as the parameter
> in the procedure definition(param11)
> (The documentation has a mistake/typo.)
>
> you could do
> CREATE PROCEDURE simpleproc (OUT param11 INT)
> declare param1 int;
> SELECT COUNT(*) INTO param1 FROM t;
>
> param11 = param1;(may need to use "set param11 = param1;" thankfully in
> oracle you don't have to do this)
>
> mysql> CREATE PROCEDURE simpleproc (OUT param11 INT)
> > -> SELECT COUNT(*) INTO param11 FROM t;
> > -> |
>
>
> Just to add I couldn't get compound statements to work
> with an example like
>
> create procedure foo(in name varchar(10))
> begin
> sql stmt 1
> sql stmt 2
> end
>
> basically up to this point all that worked for me was/is
>
> create procedure foo(parameter)
> sql stmt (either select or insert)
>
> and thats it !
>
> Scary part is I have worked on oracle and sql server for the last 5 years
> and the mysql procedures are more like sql server than oracle.
> it lacks structure, look at sql server stored procs and you'll know what I
> mean just hunks of sql everywhere it's a mess.
>
>
> ----- Original Message -----
> From: "Fredrick Bartlett" <palmtreefrb@stripped>
> To: <win32@stripped>
> Sent: Friday, January 02, 2004 11:08 PM
> Subject: Re: MySQL 5.0
>
>
> > This example (also from mysql doc's) does not work as well...
> > mysql> delimiter |
> > mysql> CREATE PROCEDURE simpleproc (OUT param11 INT)
> > -> SELECT COUNT(*) INTO param1 FROM t;
> > -> |
> > ERROR 1311 (42000): Undeclared variable: param1
> > mysql>
> >
> >
> > ----- Original Message -----
> > From: "robert_rowe" <robert_rowe@stripped>
> > To: <win32@stripped>
> > Sent: Friday, January 02, 2004 2:12 PM
> > Subject: Re: MySQL 5.0
> >
> >
> > >
> > > Follow this link to the appropriate chapter in the manual. Nothing
> should
> > be different just because it is on Win32.
> > >
> > > http://www.mysql.com/doc/en/Stored_Procedures.html
> > >
> > > --
> > > MySQL Windows Mailing List
> > > For list archives: http://lists.mysql.com/win32
> > > To unsubscribe:
> > http://lists.mysql.com/win32?unsub=1
> > >
> >
> >
> > --
> > MySQL Windows Mailing List
> > For list archives: http://lists.mysql.com/win32
> > To unsubscribe:
> http://lists.mysql.com/win32?unsub=1
> >
>
>
> --
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe:
http://lists.mysql.com/win32?unsub=1
>