Query string too long

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
christensen
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 13.05.2010, 11:31

Query string too long

Post by christensen »

Hi,

I wan to make a select query with more than 255 characters but i get error.
Error: Constant strings can't be longer than 255 chars
How can solve this?

I'm running Windows 7 Ultimate 32-bit, Lazarus 0.9.30, FPC 2.4.4, Zeoslib 6.6.6, Firebird 2.1.3.

Here is a part from my code:

Code: Select all

frmsetting.qryList.Close;
frmsetting.qryList.SQL.Clear;
frmsetting.qryList.SQL.Add('select n_client as "Client Name", phone_no as "Phone No.", address as "Address", ...... , from tb_client where ID_CLIENT='''+select_idM+''' ');
frmsetting.qryList.Open;
Thanks
mrLion
Senior Boarder
Senior Boarder
Posts: 71
Joined: 20.03.2010, 10:17

Post by mrLion »

christensen, use multistring SQL.

.....SQL.Add("..... string 1.......");
.....SQL.Add("..... string 2.......");

.......
jeremicm
Senior Boarder
Senior Boarder
Posts: 61
Joined: 18.10.2006, 17:07
Contact:

Post by jeremicm »

Also instead of

Code: Select all

where ID_CLIENT='''+select_idM+''' 
use

Code: Select all

where ID_CLIENT= :ClientID
frmsetting.qryList.ParamByName('ClientID').Value := select_idM;
christensen
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 13.05.2010, 11:31

Post by christensen »

thanks to both of you
Post Reply