Subject RE: [IBO] strange behavior of ParamByName
Author Riste Pejov
Such a dumb mistake :)
There was a stored proc that returned the file_id before, i bundled it in
one select, anyway ... Thanx

-----Original Message-----
From: Stuart Hunt [mailto:stuart.hunt@...]
Sent: Tuesday, January 21, 2003 2:41 PM
To: 'IBObjects@yahoogroups.com'
Subject: RE: [IBO] strange behavior of ParamByName


Riste,
by defining "p.file_id as kid" in your SQL, you're not defining kid as a
parameter,
you're defining it as an alias for the p.file_id field. To access this field
use:
ShowMessage(in_q->FieldByName("kid").AsString);
instead.
HTH,
Stuart Hunt

-----Original Message-----
From: Riste Pejov [mailto:ristep@...]
Sent: 21 January 2003 13:36
To: IBO
Subject: [IBO] strange behavior of ParamByName


in_q is of type TIB_Query
everything works fine ... but ...

in_q->SQL->Add("select p.ftp_path ftp_path,p.trans_type
ftp_type,p.filesize ftp_size,p.file_id as kid from");
in_q->SQL->Add("pending_files p left outer join transfered_files t");
in_q->SQL->Add("on p.file_id=t.file_id where (t.file_id is
null)AND(p.bank_id='"+bank_id+"')");;
in_q->Active=true;
in_q->First();
ShowMessage(in_q->ParamByName("kid")->AsString); //<<-- error

why ?