select * from table(function())

Posts   
 
    
Sticky
User
Posts: 21
Joined: 02-Sep-2008
# Posted on: 16-Sep-2008 12:37:41   

Hi.

What do I need to do to create the above statement with llblgen using adapter?

This is the entire statement I need :

SELECT *
   FROM TABLE(HEST.hent_afdelinger_op_ned((select code from cdmud where cdmud.id = (select cdmuser.primdept from cdmuser where uname = 'JKO'))))

I tried something with DbFunctionCall but that gives me just select HEST.hent_afdelinger_op_ned.

Thanks

/Kasper

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 16-Sep-2008 12:51:36   

Please check Generated code - Derived tables and dynamic relations, which is available in v.2.6

Sticky
User
Posts: 21
Joined: 02-Sep-2008
# Posted on: 29-Sep-2008 16:07:44   

Hi again

I have checked the link you provided, and I still can't figure out - how do I call a function that returns an array.

this

select * from table(p$crm.crm$cdmuser_pgo.hent_afdeling_op_ned('string param'))

I have tried

OracleCommand getForrOmr1 = new OracleCommand("select * from table(p$crm.crm$cdmuser_pgo.hent_afdelinger_op_ned('" + rekvirent[0][4] + "'))");
            IRetrievalQuery retrComm = new RetrievalQuery(getForrOmr1);
            [b]string afdeling = (string)adapter.ExecuteScalarQuery(retrComm);[/b]

the sql executes fine, but the sql returns a table when I execute it manually, but here it always just returns a string.

I tried using ExecuteMultiDataTableQuery at some point, but it needs some FieldPersistenceInfo that I did not know how to create.

Thanks Kasper

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39863
Joined: 17-Aug-2003
# Posted on: 29-Sep-2008 17:17:01   

What exactly does the 'table()' function do or what do you want it to do for you? Create a table from a name ? (this to give you an example of code which is supported)

That aside, if I think it does what it does, it's not supported, targets for queries have to be explicitly named.

Frans Bouma | Lead developer LLBLGen Pro
Sticky
User
Posts: 21
Joined: 02-Sep-2008
# Posted on: 30-Sep-2008 09:40:51   

The table function is creating a table from the array that is returned by the function p$crm.crm$cdmuser_pgo.hent_afdelinger_op_ned(), the table function is an Oracle feature.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39863
Joined: 17-Aug-2003
# Posted on: 30-Sep-2008 10:16:39   

In that case, that's not supported: the target of a query has to result in table/view fields. So either use a proc with a projection to fetch this, or try to create a view which returns the result of the TABLE function, and then map an entity on the view.

Frans Bouma | Lead developer LLBLGen Pro