Board index » delphi » IBX (TIBQuery,TIBDataSet) and macros

IBX (TIBQuery,TIBDataSet) and macros

Hello!

When the support will be entered property macros as in FIB OR RxLib?
You see it is very convenient.

property Macros: TParams;
Description
List of Macros (TParams see the VCL) defining the macros (see
MacroByname sample)

When you enter a query, TRxQuery creates a Macros array for the macros
of a dynamic SQL statement. Macros is a zero-based array of TParam
objects with an element for each macro (indicated by the leading
MacroChar character) in the query; that is, the first macro is
Macros[0], the second Macros[1], and so on. The number of macros is
specified by MacroCount.

Macros example
For example, suppose a TRxQuery component named rxQuery2 has the
following statement for its SQL property:

SELECT * FROM ITEMS ORDER BY %ORDER
and MacroChar = '%'.

An application could use Macros property and MacroByName method to
specify the value of the "ORDER" macro as follows:

rxQuery2.Close;
rxQuery2.MacroByName('ORDER').AsString := 'ITEMS.ID';
rxQuery2.Open;
rxQuery2.Close;
rxQuery2.MacroByName('ORDER').AsString := 'ITEMS.NAME';

--
    Best regards, Konstantin.

 

Re:IBX (TIBQuery,TIBDataSet) and macros


Konstantin

Quote
> When the support will be entered property macros as in FIB OR RxLib?
> You see it is very convenient.

I agree 100%. When working with BDE I used to use very often the RxQuery
component: great!!!

Macros give you a way to prepare totally parametrized queries (even for field's
names, or tables).
A method ExpandMacros is also available (e.g. when I want to duplicate a select
statement for printing purposes) which fill in an ExpandedSQL available as
property (I don't remember the real name).

I miss it!

Ciao,
    Max

Re:IBX (TIBQuery,TIBDataSet) and macros


    I think that IBO OnPrepareSQL event is better. If IBX will have some
similar feature will be good. The event permits before execute the SQL alter
it mantaining always the original SQL for the next times that you enter in
the event. By example you can look a checkbox and add a where clause or
other control and change the order or any thing that you think. You haven't
to be thinking in if you have a Where clause in the SQL and you have to put
AND or you haven't anything and you have to put the WHERE.

    Other fantastic thing about this system is that if you don't alter the
SELECT you haven't to fetch the metadata again although the SQL is changed
in the Where or Order Clause.

    I don't want to take the Jason job, he has done a lot of things for
Interbase community but it's a good idea and a good entry point to think
more things.

Re:IBX (TIBQuery,TIBDataSet) and macros


Quote
>     I don't want to take the Jason job, he has done a lot of things for
> Interbase community but it's a good idea and a good entry point to think
> more things.

I'm not comfortable with the thought of all the hard work I have put into
designing and implementing powerful, yet easy to use, features into my
components just to have them lifted out and placed into other things. IBO is
under Trustware not IPL or Freeware.

Since I make IBO free for all people using it for non-commercial stuff and
free for anyone making the slightest contributions to it I think the
features in IBO should be enjoyed in IBO. There's nothing stopping people
from using both IBO and IBX in the same applications. They can even share
the same connection handles just as can be done with the BDE.

If code and/or technology unique to IBO gets lifted into IBX the Trustware
licensing I use for it would then apply to portions of IBX. I would rightly
be able to claim people should submit a partial "Trustware" payment to cover
it for commercial use and I don't think Borland would want someone out there
in the community making such a claim. In fact, I'm pretty sure of it... <g>

Just some "off the cuff" thoughts on the matter...

Back to the salt mines...

Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

Re:IBX (TIBQuery,TIBDataSet) and macros


It currently is not on my plans for implementing, but I have added it to the
wish list.

Quote
Konstantin Butov wrote:

> Hello!

> When the support will be entered property macros as in FIB OR RxLib?
> You see it is very convenient.

> property Macros: TParams;
> Description
> List of Macros (TParams see the VCL) defining the macros (see
> MacroByname sample)

> When you enter a query, TRxQuery creates a Macros array for the macros
> of a dynamic SQL statement. Macros is a zero-based array of TParam
> objects with an element for each macro (indicated by the leading
> MacroChar character) in the query; that is, the first macro is
> Macros[0], the second Macros[1], and so on. The number of macros is
> specified by MacroCount.

> Macros example
> For example, suppose a TRxQuery component named rxQuery2 has the
> following statement for its SQL property:

> SELECT * FROM ITEMS ORDER BY %ORDER
> and MacroChar = '%'.

> An application could use Macros property and MacroByName method to
> specify the value of the "ORDER" macro as follows:

> rxQuery2.Close;
> rxQuery2.MacroByName('ORDER').AsString := 'ITEMS.ID';
> rxQuery2.Open;
> rxQuery2.Close;
> rxQuery2.MacroByName('ORDER').AsString := 'ITEMS.NAME';

> --
>     Best regards, Konstantin.

--
Jeff Overcash (TeamB)   | Talk about failure
(Please do not email    | To fall is not to fail
 me directly unless     | Failure isn't about falling down
 asked.  Thank You)     | Failure is staying down (Marillion)

Re:IBX (TIBQuery,TIBDataSet) and macros


Exactly, that's the beauty of choice!

Kind regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

Quote
"Konstantin Butov" <k...@sp.iae.nsk.su> wrote in message

news:3A25C64E.D2858799@sp.iae.nsk.su...
Quote

> What for to me to use the large libraries such as IBO

> When I need only one property

> And I have enough of it

> I not the supporter the large component, if am possible to do without
standard

> --
>     Best regards, Konstantin.

Re:IBX (TIBQuery,TIBDataSet) and macros


What for to me to use the large libraries such as IBO

When I need only one property

And I have enough of it

I not the supporter the large component, if am possible to do without standard

--
    Best regards, Konstantin.

Other Threads