Page 1 of 1

Fetch rows from OraQuery

Posted: Fri 10 Aug 2012 08:21
by sinys
OraQuery1.FetchAll := False;
OraQuery1.FetchRows := 25;
OraQuery1.Open;

How send command fetch next rows for OraQuery? (without OraQuery1.Next because they have blocked dbgrid fro user) Like MemTableEh1.FetchRecords(100) or MemTableEh1.FetchRecords(-1) (for fetch all records)

Re: Fetch rows from OraQuery

Posted: Fri 10 Aug 2012 10:57
by AlexP
hello,

To retrieve the next piece of data, you can use the MoveBy method

Code: Select all

OraQuery1.MoveBy(OraQuery1.FetchRows);

Re: Fetch rows from OraQuery

Posted: Fri 10 Aug 2012 12:04
by sinys
But this command move current recno and that change dbgrid state if then state in dsinsert/dsedit (it's problem for DisableControls - save recno - move - load recno - EnableControls) it will prevent the user.

Re: Fetch rows from OraQuery

Posted: Sat 11 Aug 2012 06:54
by sinys
1) Is there any way for local sorting in TOraQuery without fetch all records? (and without dbgrid functions)

2) I try using MemTableEh for local sorting but content your hack field types (ftBFile, ftLabel, ftOraTimeStamp, ftIntervalYM , ftIntervalDS, ftOraTimeStampTZ, ftOraTimeStampLTZ, ftNumber, ftXML) in TOraQuery prevents this.
How I can help MemTableEh understand this datatypes?

3)
for i := 0 to DBGridEh1.Columns.Count - 1 do
DBGridEh1.Columns.Field.DataType // return out of bound data type

Re: Fetch rows from OraQuery

Posted: Mon 13 Aug 2012 09:12
by AlexP
hello,

In TMemTableEh there is a data retrieving engine implemented different from the one that is implemented in our components, therefore there is no method similar to FetchRecords, with using of which the cursor doesn't move by the DataSet when retrieving the new data.

For filtering data we retrive all the records from the table, therefore it is impossible to use a filter without retrieving of all the data in our components.

To have an ability to work with such types, you should use Data Type Mapping, i.e. map our inner types to Delph types. You can find the detailed information and samples of Data Type Mapping in the help. For example, for ftOraTimeStamp you can use the following rule:

Code: Select all

OraQuery1.DataTypeMap.AddDBTypeRule(oraTimeStamp, ftTimeStamp);
or set this rule in the OraQuery dialog on the Data Type Mapping tab, specifying in the DataBase field the type and Field Type values of TimeStamp

Re: Fetch rows from OraQuery

Posted: Tue 14 Aug 2012 03:57
by sinys
I'm try

// raise error Unsupported field type: 41.
OraQuery1.DataTypeMap.AddDBTypeRule(ftIntervalDS, ftOraInterval);

// Unsupported database type: 100.
OraQuery1.DataTypeMap.AddDBTypeRule(ftBFile, ftBlob);

How to do right?

Re: Fetch rows from OraQuery

Posted: Tue 14 Aug 2012 05:41
by sinys
May be you add capability local sorting and filtering only for fetched rows?

Or may be it's possible if connect TVirtualTable? (but I have not found a way to)

Re: Fetch rows from OraQuery

Posted: Tue 14 Aug 2012 08:17
by sinys

Code: Select all

OraQuery1.DataTypeMap.AddDBTypeRule(oraBFile, ftBlob); // Unsupported field type: 15
OraQuery1.DataTypeMap.AddDBTypeRule(oraBFile, ftOraBlob); // Unsupported field type: 30

Code: Select all

OraQuery1.DataTypeMap.AddDBTypeRule(oraBFile, ftVarBytes);
OraQuery1.Open; // Unsupported data type mapping: "BFile" to "VarBytes"
How to do right?

Re: Fetch rows from OraQuery

Posted: Tue 14 Aug 2012 08:37
by sinys
Please show example for BFile and XML data types!

Re: Fetch rows from OraQuery

Posted: Tue 14 Aug 2012 12:28
by AlexP
hello,

In the AddDBTypeRule, the first parameter should be one of the following our inner field types:
oraChar, oraVarchar2, oraNChar, oraNVarchar2, oraNumber, oraBinaryFloat, oraBinaryDouble, oraDate, oraTimeStamp, oraTimeStampWithTimeZone,
oraTimeStampWithLocalTimeZone, oraBlob, oraClob, oraNClob, oraBFile, oraLong, oraRaw, oraLongRaw, oraRowID, oraURowID; that are declared in the OraDataTypeMap module.
The second parameter - one of the Delphi field types declared in the DB module in TFieldType.

If you are loading data from the DataSet in VirtualTable with the help of the Assign method, all the data from the DB will be loaded, independing on the settings of FetchAll of the used DataSet. Therefore sorting in VirtualTable will occur by all the data.

At the moment, mapping of such Oracle types as XMLTYPE and BFfile is not implemented, we review the possibility of adding such feature in one of the next versions.