[DUG] Importing Data
Wayne Roser
rr at kristin.school.nz
Wed Nov 7 07:46:58 NZDT 2007
I don't recognise
>i := TIntegerField ;
I'm guessing that you don't need it.
What does the line
Edit1.Text(Integer);
mean?
I wonder if you want:
while not PSQLQuery1.EOF do
begin
i := PSQLQuery1.FieldByName('Count').AsInteger ;
Edit1.Text := IntToStr(i);
NZ Borland Developers Group - Delphi List <delphi at delphi.org.nz> on Wednesday, 7 November 2007 at
6:29 a.m. +0000 wrote:
>Hi
>
>
>In my pursuit of learning at least some Delphi, I have this challenge for which I would appreciate
>some help.
>
>
>I am having a little difficulty with this part of an expression-
>
>
> while not PSQLQuery1.EOF do
>
> begin
>
> i := TIntegerField ;
>
> i:= PSQLQuery1.FieldByName('Count').AsInteger ;
>
> Edit1.Text(Integer);
>
>
>I am importing data from a PostgreSQL database and processing the information one row at a time.
>It works quite well as far as I have gone. I want to control the process by taking the count of
>the rows left unprocessed (greater than zero) before importing the next row.
>
>
>The full expression follows
>
>
>Bob Pawley
>
>
>var
>
>i : integer
>
>
> begin
>
> PSQLQuery1.Close;
>
> PSQLQuery1.SQL.Clear;
>
> PSQLQuery1.SQL.Add ('Select Count (Loop_ID)');
>
> PSQLQuery1.SQL.Add ('FROM P_ID.Loops, Project.Project');
>
> PSQLQuery1.SQL.Add ('Where P_ID.Loops.IDW_Loop_ID is null');
>
> PSQLQuery1.SQL.Add ('and P_ID.Loops.P_ID_ID = Project.Project.P_ID_ID');
>
> PSQLQuery1.SQL.Add ('and Project.Project.P_ID_Name = :P_ID_Name ') ;
>
> PSQLQuery1.ParamByName('P_ID_Name').AsString := DBEdit2.Text;
>
> PSQLQuery1.Prepare;
>
> PSQLQuery1.Open;
>
> PSQLQuery1.First ;
>
> while not PSQLQuery1.EOF do
>
> begin
>
> i := TIntegerField ;
>
> i.value:= PSQLQuery1.FieldByName('Count').AsInteger ;
>
> Edit1.Text(Integer);
>
> while i >0 do
>
>
> BitBtn1MouseUp2(Sender, Button, Shift, X, Y);
>
> PSQLQuery1.Next;
>
>
>
> end;
>
>_______________________________________________
>NZ Borland Developers Group - Delphi mailing list
>Post: delphi at delphi.org.nz
>Admin: http://delphi.org.nz/mailman/listinfo/delphi
>Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe
More information about the Delphi
mailing list