Maximum number of fields (columns)

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Maximum number of fields (columns)

Post by mparak »

Hi guys,
I recently got a "Range Check error" when executing a simple "select * from tablename" and discovered that it was related to the number of columns in the resultset. It had nothing to do with the number of rows as I tried a table that had one row only. The minute I reduced the number of columns it worked fine. I am working with more than 255 fields (columns).
Is there any way to tweek the parameters to overcome this limitation.?
By the way I use the TZquery.
Regards
M
Last edited by mparak on 16.06.2011, 09:15, edited 1 time in total.
Mohammed Parak
CAD RETAIL
Durban South Africa
http://www.cad.co.za
jeremicm
Senior Boarder
Senior Boarder
Posts: 61
Joined: 18.10.2006, 17:07
Contact:

Post by jeremicm »

are you sure that select is problem? i often get that error on some longint calculations on my app start... sometimes it raises error, sometimes it's fine...
mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Post by mparak »

I have included a procedure that will prove my point.
If you try to open more than 255 fields it gives the error I mentioned.
If column count is below then all is well.


procedure TForm1.Prove_Max_columns_are_restricted;
var mSQL:Tzquery; i:Integer; Number_Columns:String;
begin
try try
Number_Columns=InputBox('Number of fields', 'number of fields', '255');
mSQL:=Tzquery.Create(application);
mSQL.Connection:=ZConnection1;
mSQL.SQL.Text:=' select current_date';
for i:=1 to strToInt(Number_Columns) do
Begin
mSQL.SQL.append(',0 Field_'+IntToStr(i));
End;
mSQL.Open;
ShowMessage(intToStr(mSQL.RecordCount));
finally mSQL.free; end;
except on e:Exception do showMessage(e.message) end;
end;
Mohammed Parak
CAD RETAIL
Durban South Africa
http://www.cad.co.za
Post Reply