[Lazarus] Undefined symbol errors after adding TOpenDialog

John Repucci john.repucci at gmail.com
Sun Oct 17 05:14:39 CEST 2010


On 10/16/2010 03:24, Michael Van Canneyt wrote:
>
>
> On Fri, 15 Oct 2010, ABorka wrote:
>
>> On 10/15/2010 05:40, Leonardo M. Ramé wrote:
>>> On 2010-10-15 14:24:48 +0200, Michael Van Canneyt wrote:
>>>>> After removing the TSqlQuery and TSQLTransaction components from my
>>>>> app,
>>>>> a new question came to my mind, in the case of complex inserts/updates
>>>>> that involves more than one database table, is it possible to use
>>>>> transactions?.
>>>>
>>>> Hm. Not if you use the TSQLDBWebDataProvider. To do that, you would
>>>> have to use TSQLSuery and a regular TWebDataProvider, and hook into
>>>> the Before/after post events of the TSQLQuery.
>>>>
>>>> But I'm certainly open for suggestions for improvements.
>>>>
>>>> Michael.
>>>
>>> Well, It's not an issue at all, I could create a stored procedure in
>>> What do you think about this?
>>
>> But you can do these things already, I believe.
>> I had multiple tables and some simple access rights to different
>> people so my SQL statements had to be different for everyone to get
>> different records from the tables.
>>
>> What I did is, I started from the first demo example found in
>> fcl-web/examples/webdata/demo/
>>
>> and created ONE action called "CRUD" that handles all the crud request
>> from the extjs clients. However, I am passing some additional
>> parameters that specifies which table is to be used and what needs to
>> be done (Create, Read, Update, Delete). From the session I got who is
>> the user, so I was able to prepare the proper SQL statements myself.
>>
>
> Is there any chance to put this in a kind of component that does most of
> the boilerplate work ? I would imagine 2 events:
>
> OnGetConnection = Procedure (Sender : TObject; Var AConnection :
> TSQLConnection) of object;
> OnGetQuery = Procedure (Sender : TObject; UpdateKind : TUpdateKind; SQL
> : TStrings); of object;
>
> Michael.

Yes, theoretically it can be made a bit cleaner and easier by improving 
the webdata components, but there are a lot of additional parameters 
that can come in from Extjs.
For example, I am using Extjs grids and processing the following 
incoming parameters when creating my SQL statements:

table(s) to use /an id number what data is needed/
operation to perform /c, r, u, d/
start /starting record/
limit /number of records to return/
sort /sort by this field, this can be tricky for calculated fields/
dir /sort order if needed: ASC DESC/
fields /filter on these fields/
query /value(s) to look for in the filtered fields/

So creating the proper SQL statements definitely involves some work for 
the different Extjs client grids I use. The access rights for the users 
for the different database records also need to be taken into account.
Additionally, a separate SQL statement is needed to get the total number 
of records and properly replace it in the response that is returned to 
the Extjs client.
That is, because not all the records are returned, just the ones that 
fit into one grid page. With thousands plus records it is necessary, so 
the communication and response time is relatively fast.

AB





More information about the Lazarus mailing list