You are getting error because u r directly wrighting limit variable.
instead prepare the query using concat and then execute the query in
procedure.
Some thing of this sort will do
query=concat('insert into' variable1 , 'select * from table' ,
variable2);
set query1=query;
prepary query1 ;
execute query1;
On Sep 23, 3:14 pm, kali natham <
kalinat...@gmail.com> wrote:
> Hi,
> As i know mysql function do not have table type return , so i am creating
> temporary table to solve the issue.
> I am trying to create a procedure which will have two parameters and inside
> the procedure i am using those parameters. Parameter one is table name and
> parameter two is row limit value.
>
> But its giving error.
>
> Below is the code: in this tblname is table name and tbllimit is the row
> limit parameters.
>
> *DELIMITER $$
>
> CREATE
>
> PROCEDURE `httpdb`.`tbllim`(inout tblname varchar(100),inout tbllimit
> int)
>
> BEGIN
> create temporary table temtbl like tblname;
>
> insert into temtbl select * from tblname limit tbllimit;
>
> END$$*
>
> DELIMITER ;
>
> On Wed, Sep 23, 2009 at 12:16 PM, Suresh Kuna <
sureshkumar...@gmail.com>wrote:
>
>
>
>
>
> > Hi All,
> > I'am done with the exam and it is very easy just like below.
> > 1) giving grants
> > 2) revoke grants
> > 3) create table
> > 4) taking dump
> > 5) creating views etc
>
> > Thanks
> > Suresh Kuna
>
> > On Mon, Sep 21, 2009 at 12:29 PM, Balaji Kasangudi Srinivasan <
> >
balajikanna...@gmail.com> wrote:
>
> >> Very great,,,,need to search the book.
>
> >> On Mon, Sep 21, 2009 at 12:28 PM, suri <
sureshkumar...@gmail.com> wrote:
>
> >>> Hi All,
> >>> How's the preparation going on ?
>
> >>> Thanks
> >>> Suresh Kuna
>
> > --
> > Regards,
> > Suresh Kuna
>
> --
>
> Regards.
> Kalinatham- Hide quoted text -
>
> - Show quoted text -