List:MySQL on Win32« Previous MessageNext Message »
From:Melissa Dougherty Date:November 7 2005 2:48pm
Subject:Re: 5.0.15 Stored Procedures
View as plain text  
What is AFAIK....

I did get all the procedure to compile, all but the CALL statments.  The 
dynamic SQL is in a variable... now I need to run the variable.

Any suggestions for running the variable?

Melissa


----- Original Message ----- 
From: "Marek" <wmarek98@stripped>
To: "Melissa Dougherty" <melissa@stripped>
Sent: Friday, November 04, 2005 5:15 PM
Subject: Odp: 5.0.15 Stored Procedures


> Well
> First I repeat that AFAIK
> Next:
> 1.variables declared INSIDE stored procedures don't have this "@"
> 2.before you may call  any procedure it must be in the table with stored
> procedures ie  in "mysql.proc"
> 3. calling procedure you have to give parameters so for example -> call
> proc1(@a,@b...)
> 4.I'm not very sure if it is possible to create dynamic procedure  being
> inside another procedure but after creating a body of such  procedure  you
> have to insert it into this table (mysql.proc) and , after finishing - to
> delete from this table. It comes a question if such a "dynamic" procedure
> will be available for its "creator procedure". Try to write and create a
> simple procedure to know what must be a structure of this INSERT 
> statement.
> 5. As  FirstRec,Page,RecsPerPage are variables  and in mentioned 
> statements
> there is not any query ; so your format is correct. Only if in statement 
> you
> use a information from query you have to use select (with "into") . 
> Example:
> select max(year1) into CurrYear from TempItems
>
> Marek
>
>
>
>
> ----- Original Message -----
> From: Melissa Dougherty <melissa@stripped>
> To: <win32@stripped>; Marek <wmarek98@stripped>
> Sent: Friday, November 04, 2005 7:12 PM
> Subject: Re: 5.0.15 Stored Procedures
>
>
>> Would I do the same thing with the following statement.... I still 
>> getting
>> an error.
>>
>>  SET FirstRec = (Page - 1) * RecsPerPage  --   i.e.  SELECT  (Page - 1) *
>> RecsPerPage    INTO FirstRec ;
>>
>> Also, how do I exec the variable that holds the string?  If I do the CALL
>> SQL1; it says incorrect syntax.
>>
>> Thanks,
>>
>> Melissa
>>
>>
>> ----- Original Message -----
>> From: "Marek" <wmarek98@stripped>
>> To: <melissa@stripped>
>> Sent: Friday, November 04, 2005 10:24 AM
>> Subject: Re: 5.0.15 Stored Procedures
>>
>>
>> > In your stored procedure there is third problem:
>> > AFIK
>> > SET RecordCount = count(*) from TempItems
>> > will not work, replace it with
>> > select count(*) into RecordCount  from TempItems
>> > Marek
>> >
>> >
>>
> 

Thread
5.0.15 Stored ProceduresMelissa Dougherty4 Nov
  • Re: 5.0.15 Stored ProceduresSGreen4 Nov
Re: 5.0.15 Stored ProceduresMelissa Dougherty4 Nov
  • Re: 5.0.15 Stored ProceduresSGreen4 Nov
Re: 5.0.15 Stored ProceduresMelissa Dougherty7 Nov