Query string too long

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

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

Query string too long

Postby christensen » 08.08.2011, 16:41

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

Postby mrLion » 08.08.2011, 20:44

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:

Postby jeremicm » 09.08.2011, 08:50

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

Postby christensen » 09.08.2011, 21:39

thanks to both of you


Return to “Firebird”

Who is online

Users browsing this forum: No registered users and 1 guest