comp.lang.ada
 help / color / mirror / Atom feed
From: tonyg <tonythegair@googlemail.com>
Subject: Re: mysql , gnade and function hanging
Date: Wed, 30 Jun 2010 05:53:54 -0700 (PDT)
Date: 2010-06-30T05:53:54-07:00	[thread overview]
Message-ID: <da31977b-8319-420c-a1e5-981dd52b2788@c33g2000yqm.googlegroups.com> (raw)
In-Reply-To: 87bpasiue9.fsf@ludovic-brenta.org

I've sanistised this source of the password and ip address

with GNU.DB.MySQL;
with GNU.DB;
use GNU.DB.MySQL;
use GNU.DB;
with Ada.Text_Io; use Ada.Text_Io;
with Ada.Strings.Unbounded;
use Ada.Strings.Unbounded;

procedure trymysql is

TheDatabase : MySQL.Object;
TheQuery    : MySQL.Query_Id;
TheField	: MYSQL.Field_Number;
begin
Initialize(TheDatabase);
User (TheDatabase, "heating");
Password (TheDatabase,"");
Connect (TheDatabase,"");
Select_DB (TheDatabase, "heating");

   TheQuery := Query (TheDatabase, "select * from userid ");
   TheField := Get_Field_Number (TheDatabase, TheQuery, "email");

   put_line ("Number of Rows :" &
Integer'Image(Nbr_of_Rows(TheDatabase,TheQuery)));

	put_line (" Field Number of Email field : " &
Integer'Image(TheField));


    Put_Line(Natural'image (Get_Field_Length(TheDatabase,TheQuery,
1)));
    Put_Line(Field_Type'image(Get_Field_Type(TheDatabase,TheQuery,
1)));

    Put_Line(To_String(String_Field (TheDatabase, TheQuery,
"email")));
end trymysql;




Out put is

tony@tony-laptop:~/snugbug/main/adastuff/heating/src$ ./trymysql
Number of Rows : 4
 Field Number of Email field :  1
 14

raised CONSTRAINT_ERROR : gnu-db-mysql.adb:883 invalid data
tony@tony-laptop:~/snugbug/main/adastuff/heating/src$


Other information is that the email field in the database table is a
VARCHAR(80) and a primary key



  reply	other threads:[~2010-06-30 12:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-30  8:34 mysql , gnade and function hanging tonyg
2010-06-30  9:00 ` Ludovic Brenta
2010-06-30  9:03 ` tonyg
2010-06-30  9:23   ` Ludovic Brenta
2010-06-30  9:29     ` tonyg
2010-06-30  9:40       ` tonyg
2010-06-30 12:20         ` Ludovic Brenta
2010-06-30 12:53           ` tonyg [this message]
2010-07-01  9:44             ` Ludovic Brenta
2010-07-01 10:19               ` tonyg
2010-07-01 13:38               ` J-P. Rosen
2010-07-02  8:45                 ` tonyg
     [not found]                   ` <zOmdnev0COPcfLPRnZ2dnUVZ_hMAAAAA@earthlink.com>
2010-07-03 10:07                     ` Dmitry A. Kazakov
2010-07-05  9:18                       ` tonyg
2010-07-01 11:38   ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox