ZQuery.MacroByName()
Moderators: gto, EgonHugeist
ZQuery.MacroByName()
In a "very old" version of Zeos we had the property "Macros" and we could use "MacroByName()" ...
There is some way to do that in Zeos 6.6.5 ?
Thanks
There is some way to do that in Zeos 6.6.5 ?
Thanks
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
No idea what the functionality of this property was. That's long before my zeoslib time, I'm afraid.
If you explain the function we could see
- if there's something similar
- if it would be right to re-implement
Of course, if you still have the right version where it existed, that could be very helpful.
Mark
If you explain the function we could see
- if there's something similar
- if it would be right to re-implement
Of course, if you still have the right version where it existed, that could be very helpful.
Mark
I'm using the version '50300' as zeos.inc. Now I'm tring to update to the newest one. I know that I could reformulate all the querys to use "query.sql[X] := something", but all the system is implemented using macros and params. An example:
SQL
CODE
if true the result query will be:
else, just:
I think that explains the use of macros.
Rodrigo
SQL
Code: Select all
SELECT *
FROM people
WHERE age > 30
%macro
Code: Select all
if z then
query.MacroByName('macro').AsString := 'AND gender = ''M'''
else
query.MacroByName('macro').AsString := '';
Code: Select all
SELECT *
FROM people
WHERE age > 30
and gender = 'M'
Code: Select all
SELECT *
FROM people
WHERE age > 30
Rodrigo
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Thanks. That explains the use of macro's very well.
Now, I have some little problems.
The main one is time. Just take it as a fact I can't spend time building new stuff at the moment. Just merging patches and getting/keeping the current stuff working is enough for me.
The second problem (compared to the original implementation that I don't know) might be the way to implement it in the current design. If you do it : keep it in the components layer. It might be a relatively easy job when you add a FRawSQL field to the TZReadOnly Query component and use it to set the FSQL property using Setter functions for a MacroParameters Array.
Would you think about adding the functionality? It's certainly not the same as using parameters. Parameters usually don't allow changes to the structure of the query. Your macro's would also allow new parts being added to the query.
Mark
Now, I have some little problems.
The main one is time. Just take it as a fact I can't spend time building new stuff at the moment. Just merging patches and getting/keeping the current stuff working is enough for me.
The second problem (compared to the original implementation that I don't know) might be the way to implement it in the current design. If you do it : keep it in the components layer. It might be a relatively easy job when you add a FRawSQL field to the TZReadOnly Query component and use it to set the FSQL property using Setter functions for a MacroParameters Array.
Would you think about adding the functionality? It's certainly not the same as using parameters. Parameters usually don't allow changes to the structure of the query. Your macro's would also allow new parts being added to the query.
Mark
-
- Fresh Boarder
- Posts: 20
- Joined: 21.11.2005, 10:13
- Location: Pieštany
- Contact:
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Rodrigo,
You can send your changes to zeoslib at gmail dot com.
You're talking about 'other changes' you did. You'll have to explain them too when you want those applied as well.
So please, provide different patches for different changes. Normally the base version I'm working on is Testing branch, but when you provide patches against trunk or even 6.6-Patches that will do as well.
When you become more active and want SVN access I can arrange that, but you'll have to 'prove' your intensions first. Too much people have asked for it and when they got it they didn't use it.
Mark
Mark
You can send your changes to zeoslib at gmail dot com.
You're talking about 'other changes' you did. You'll have to explain them too when you want those applied as well.
So please, provide different patches for different changes. Normally the base version I'm working on is Testing branch, but when you provide patches against trunk or even 6.6-Patches that will do as well.
When you become more active and want SVN access I can arrange that, but you'll have to 'prove' your intensions first. Too much people have asked for it and when they got it they didn't use it.
Mark
Mark
Re: ZQuery.MacroByName()
Hi Mark,
I know that is long time ago but I'm wondering if this functionality was implemented later on.
Did Rodrigo committed the actual code?
I'm converting an huge application from Delphi 6 +MySQL 4.01 + ZeosDB 5 with this feature and is heavy used to Delphi 6 + MySQL 5.6 + ZeosDB 6.6.6.
Any information will be very useful.
Thanks
I know that is long time ago but I'm wondering if this functionality was implemented later on.
Did Rodrigo committed the actual code?
I'm converting an huge application from Delphi 6 +MySQL 4.01 + ZeosDB 5 with this feature and is heavy used to Delphi 6 + MySQL 5.6 + ZeosDB 6.6.6.
Any information will be very useful.
Thanks
Odimar Tomazeli