specialized Queries

Posts   
 
    
kulki
User
Posts: 26
Joined: 20-Dec-2004
# Posted on: 20-Dec-2004 16:21:29   

Hi, I am new to LLBLGen so plz forgive me for any stupid questions. My major concern is that in case I find something which cannot be done properly by LLBLGen can I think integrate my framework such that I make a call to the Stored Procedure. I want to ensure that there are hooks in place for me code my SQL manually in case I need to.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Dec-2004 17:36:37   

You can call stored procedures yes, add a call to the proc in the designer. (i.e. add a retrieval or action procedure to your llblgen pro project)

Frans Bouma | Lead developer LLBLGen Pro
kulki
User
Posts: 26
Joined: 20-Dec-2004
# Posted on: 20-Dec-2004 23:32:19   

Otis wrote:

You can call stored procedures yes, add a call to the proc in the designer. (i.e. add a retrieval or action procedure to your llblgen pro project)

I did read in the documentation that I could do this. However I am not certain exactly how to do it. Can you provide me an example or extra docs on exactly how to directly invoke an stored proc. I can think of using this extra stored proc in case of some reporting or some complex search which joins multiple tables. Would you recommend that I use my own stored proc for such scenarios?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 21-Dec-2004 10:14:00   

kulki wrote:

Otis wrote:

You can call stored procedures yes, add a call to the proc in the designer. (i.e. add a retrieval or action procedure to your llblgen pro project)

I did read in the documentation that I could do this. However I am not certain exactly how to do it. Can you provide me an example or extra docs on exactly how to directly invoke an stored proc. I can think of using this extra stored proc in case of some reporting or some complex search which joins multiple tables. Would you recommend that I use my own stored proc for such scenarios?

In the documentation there is a section "Calling a stored procedure". Which part wasn't clear enough and should be more helpful?

Stored procedures are often not that helpful, unless you need a lot of processing on a lot of data, which would otherwise take a lot of time because a lot of data has to be read to a client outside the database. You can often use the dynamic list feature of llblgen pro with the aggregates and expressions to create lists you can use in reports. if you need functionality not yet available you can indeed fall back to the stored procedure approach.

Frans Bouma | Lead developer LLBLGen Pro
kulki
User
Posts: 26
Joined: 20-Dec-2004
# Posted on: 22-Dec-2004 00:45:29   

Otis wrote:

kulki wrote:

Otis wrote:

You can call stored procedures yes, add a call to the proc in the designer. (i.e. add a retrieval or action procedure to your llblgen pro project)

I did read in the documentation that I could do this. However I am not certain exactly how to do it. Can you provide me an example or extra docs on exactly how to directly invoke an stored proc. I can think of using this extra stored proc in case of some reporting or some complex search which joins multiple tables. Would you recommend that I use my own stored proc for such scenarios?

In the documentation there is a section "Calling a stored procedure". Which part wasn't clear enough and should be more helpful?

Stored procedures are often not that helpful, unless you need a lot of processing on a lot of data, which would otherwise take a lot of time because a lot of data has to be read to a client outside the database. You can often use the dynamic list feature of llblgen pro with the aggregates and expressions to create lists you can use in reports. if you need functionality not yet available you can indeed fall back to the stored procedure approach.

I guess what would be most helpful would be some actual code itself or just some code snippet. This tells me what the recommended way would be to handle such scenarios.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 22-Dec-2004 09:59:03   

It depends on the situation. For each approach there are examples in the documentation, but it depends on the situation what is best. doing everything in the database is only efficient if the processing logic is simple but the data is massive. If the processing logic is complex, the time spend in the query is largely taken by the execution of the interpreted SQL statements (except on DB2, where sql is compiled to C) and it could be more efficient to load the data into the client and do the processing there.

Frans Bouma | Lead developer LLBLGen Pro
kulki
User
Posts: 26
Joined: 20-Dec-2004
# Posted on: 23-Dec-2004 03:25:09   

Otis wrote:

It depends on the situation. For each approach there are examples in the documentation, but it depends on the situation what is best. doing everything in the database is only efficient if the processing logic is simple but the data is massive. If the processing logic is complex, the time spend in the query is largely taken by the execution of the interpreted SQL statements (except on DB2, where sql is compiled to C) and it could be more efficient to load the data into the client and do the processing there.

What documentation are you referring to? I only have two docs one which says LLBLGen Pro documentation and other which says LLBLGenProReference. Ami I missing something here?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 23-Dec-2004 09:22:38   

kulki wrote:

Otis wrote:

It depends on the situation. For each approach there are examples in the documentation, but it depends on the situation what is best. doing everything in the database is only efficient if the processing logic is simple but the data is massive. If the processing logic is complex, the time spend in the query is largely taken by the execution of the interpreted SQL statements (except on DB2, where sql is compiled to C) and it could be more efficient to load the data into the client and do the processing there.

What documentation are you referring to? I only have two docs one which says LLBLGen Pro documentation and other which says LLBLGenProReference. Ami I missing something here?

Not to sound rude or anything, but if I open the LLBLGen Pro documentation, I click open "Using the generated code" and then the template group I use (selfservicing or adapter) I see "Calling a stored procedure". wink

Please use the search tab in the documentation chm, it brings up topics you might have overlooked too, like the Best practises - How do I? section.

Frans Bouma | Lead developer LLBLGen Pro