Recent

Author Topic: In Zeos, the DbcResultSet is created only with open commando  (Read 6089 times)

Fantablup

  • Full Member
  • ***
  • Posts: 140
This is dumb, because you have to check the SQL text if it is a select statement.
Why not let it create a DbcResultSet in ExecSQL too if it has a result set.

Extra work for knowing if you should use Open or ExecSQL.

I wish you could use ExecSQL for both.
Because when you do not now the SQL text the user inputs, it is easier to use ExecSQL, so it works with selects and execute.

I saw earlier examples on this on Google. There they used ExecSQL for select too. But this does not work today in Zeos.

Maybe i can use Open on execute SQL's
« Last Edit: July 11, 2021, 12:15:17 am by Fantablup »

Fantablup

  • Full Member
  • ***
  • Posts: 140
Re: In Zeos, the DbcResultSet is created only with open commando
« Reply #1 on: July 11, 2021, 12:19:55 am »
Nop..
Impossible to use Open on sql that not returning results.

Fantablup

  • Full Member
  • ***
  • Posts: 140
Re: In Zeos, the DbcResultSet is created only with open commando
« Reply #2 on: July 11, 2021, 12:25:20 am »
This actually means i first have to create a statement, and execute it, and if it has a result set i can open it.
This means i have to open the data two times, instead of one.

I need to use the query component for sorting the result set. I can not use only the IZResultset, because it cannot sort on it's own.

Fantablup

  • Full Member
  • ***
  • Posts: 140
Re: In Zeos, the DbcResultSet is created only with open commando
« Reply #3 on: July 11, 2021, 06:13:02 am »
Worked all night trying to get the DbcResultSet working with ZQuery.
It is just impossible.
When going to the first record the DbcResultSet is not moving until it get to the tenth record count in the query.
The same happens from the last row too.

So, i cant use DbcResultSet to anything, or even the IZResultset. Because od the sorting i need.

I got another solution.
I use the DB_KEY instead for the update of each rows.
But this can be a big problem in other DB engines. They maybe not have this kind of DB_key.

Why the f''k doesn't the DbcResultSet row in the opened query move until it goes over 10 in the record count. And going back again it stops at row 10, and will not go lower.
I almost gave up everything tonight, and throwing it all away. After over two months of work.
One frustrated dude today.


Fantablup

  • Full Member
  • ***
  • Posts: 140
Re: In Zeos, the DbcResultSet is created only with open commando
« Reply #4 on: July 11, 2021, 10:16:54 am »
After the rest of the morning not getting it to work, i did something else.
I created a calculated field in the result query, and store the row number from the db, and not the recno. It is only the row number from the db that is valid.

I can not use any fetching of data with IZResultset or DBCResultset when sorting. So this is just no way.
The result sets will not work on undirectional results with sorting. It will not either match the row number to the query.

So, the IZResultset is just broken i would say.

I have to use the IZResultset together with the created calculated field from the query. That means also the result set is never sorted, but the query set is. And also have to work with two different result sets at the same time.

This was not good.
But this solution is working, and will work on any DB engine.

But spending all night and half of the day on this was not any fun.

The special result sets in Zeos is just not any good. Maybe i am missing something, but can't fix it. and super little info on the web.
« Last Edit: July 11, 2021, 10:19:36 am by Fantablup »

dseligo

  • Sr. Member
  • ****
  • Posts: 343
Re: In Zeos, the DbcResultSet is created only with open commando
« Reply #5 on: July 11, 2021, 05:10:38 pm »
Maybe you should ask in ZEOSlib forum: https://zeoslib.sourceforge.io/
IIRC, I also asked there if I had ZEOS issues.

marsupilami79

  • New Member
  • *
  • Posts: 12
Re: In Zeos, the DbcResultSet is created only with open commando
« Reply #6 on: July 11, 2021, 06:58:40 pm »
Hello Fantablup,

I can not use any fetching of data with IZResultset or DBCResultset when sorting. So this is just no way.
The result sets will not work on undirectional results with sorting. It will not either match the row number to the query.

So, the IZResultset is just broken i would say.
No, IZResultSet is just not meant for sorting outside of the database. Use TZQuery instead. A known issuw with doSmartOpen is that it opens the Query in any case. If there is no result set, no columns will be generated.

This is dumb, because you have to check the SQL text if it is a select statement.
Why not let it create a DbcResultSet in ExecSQL too if it has a result set.

Extra work for knowing if you should use Open or ExecSQL.

I wish you could use ExecSQL for both.
Because when you do not now the SQL text the user inputs, it is easier to use ExecSQL, so it works with selects and execute.

I saw earlier examples on this on Google. There they used ExecSQL for select too. But this does not work today in Zeos.

Maybe i can use Open on execute SQL's
Maybe you want to use doSmartOpen in TZQuerys Options property.

Addendum: Please ask on the Zeos forums if you need hep with Zeos ;)

Best regards,

Jan
« Last Edit: July 11, 2021, 07:01:11 pm by marsupilami79 »

Fantablup

  • Full Member
  • ***
  • Posts: 140
Re: In Zeos, the DbcResultSet is created only with open commando
« Reply #7 on: July 11, 2021, 08:45:40 pm »
Thanks Jan :)

I will ask them next time for sure.

I realize now that sorting is only possible in the ZQuery.
I only wish it also could get that transaction row number in it, but it seems impossible.

I am using the ZQuery now for the listing because of sorting and fetching new data, and getting the transaction row number from one IZResultset.

Fantablup

  • Full Member
  • ***
  • Posts: 140
Re: In Zeos, the DbcResultSet is created only with open commando
« Reply #8 on: July 13, 2021, 12:36:52 am »
Update.

Also the FetchRow property don't work when setting SortedFelds. It then fetch all rows in the table.

I tried setting FetchRow to 20, and without sorting, it say 20 record.
With sorting it say all records.

Time to ask in the Zeos forum. All these things is so difficult to get through.
« Last Edit: July 13, 2021, 12:38:33 am by Fantablup »

 

TinyPortal © 2005-2018