Subject | RE: [IBO] strange behavior of ParamByName |
---|---|
Author | Stuart Hunt |
Post date | 2003-01-21T13:41:26Z |
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 ?
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
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 ?
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/