Query Building Basics

Posts   
 
    
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 29-Apr-2010 15:05:21   

Hi,

I am just trying to understand the basics of query building so that I can start off with it.

I just need help on following two queries as to how to write the same in llblgen so that I can start building complex queries

  1. SELECT SYSDATE FROM DUAL // no tables are invovled here

  2. SELECT COUNTRY.COUNTRYDESCRIPTION, STATE.STATEDESCRIPTION FROM COUNTRY, STATE WHERE (COUNTRY.COUNTRY_ID = STATE.COUNTRY_ID)

// two tables are involved here

I just want to understand how to write and execute these in LLBLGEN

  • Shekar
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 29-Apr-2010 22:26:51   

Hi Shekar,

shekar wrote:

  1. SELECT COUNTRY.COUNTRYDESCRIPTION, STATE.STATEDESCRIPTION FROM COUNTRY, STATE WHERE (COUNTRY.COUNTRY_ID = STATE.COUNTRY_ID)

First of all I recommend you read the Using entity collections section of the manual. That would give you an idea of what you can achieve with EntityCollections. Specially read The predicate system.

shekar wrote:

  1. SELECT SYSDATE FROM DUAL // no tables are invovled here

As this doesn't involve entities, it's recommended Calling a stored procedure. If you want such sysdate to update later your entity you can use a database function and then call it using DBFunctionCalls so you can update the entity directly when you save it.

Please back here if you need further assistance in building queries.

David Elizondo | LLBLGen Support Team