>  
>  
> hi guys..
> i am new to this mailing list...i am sujay from andale...
> 
> I have a problem in getting multiple records from my store procedure when
> I
> tried calling it using C API...
> 
> I included the flag CLIENT_MULTI_STATEMENTS..but it is still giving the
> same
> error..
> 
> 1296 :SELECT in a stored procedure must have INTO..
> 
> i am also including my code here..
> 
>       1 #include <stdio.h>
>       2 #include "/usr/include/mysql/mysql.h"
>       3
>       4 int main(int argc,char *argv[])
>       5 {
>       6 MYSQL mysql;
>       7 MYSQL_RES *result;
>       8 MYSQL_ROW row;
>       9
>      10 long int i;
>      11 if(!mysql_init(&mysql))
>      12 {
>      13        fprintf(stderr,"Initialization failed");
>      14       exit(1);
>      15 }
>      16
>      17
> if(!mysql_real_connect(&mysql,"localhost","root","","test",0,NULL,CLIENT_M
> UL
> TI_RESULTS))
>      18 {
>      19       fprintf(stderr,"%d
> :%s\n",mysql_errno(&mysql),mysql_error(&mysql));
>      20       exit(2);
>      21 }
>      22
>      23 if(mysql_query(&mysql,"call sujay1()")!=0)
>      24 {
>      25        fprintf(stderr,"%d
> :%s\n",mysql_errno(&mysql),mysql_error(&mysql));
>      26 }
>      27
>      28 else
>      29 {
>      30 result = mysql_store_result(&mysql);
>      31 i = mysql_num_rows(result);
>      32 printf("No of rows are %d\n",i);
>      33 //row = mysql_fetch_row(result);
>      34 while(row = mysql_fetch_row(result))
>      35 {
>      36 printf("%s      %s\n",row[0],row[1]);
>      37 }
>      38 mysql_free_result(result);
>      39 }
>      40
>      41 mysql_close(&mysql);
>      42 return 0;
>      43 }//end of main
> 
> The procedure sujay1() which i am using in  my program is
> 
>  create procedure sujay1()
>  begin
>       select name,species from pet;
>  end
> 
> 
> 
> Thanx
> sujay koduri
> (plez sent back the corrected one)
> I am using..
> 
> Red hat-9.0
> MySQL - 5.0
> 
> 

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

Reply via email to