Mapping stored procedure out parameter

Posts   
 
    
ronnieb
User
Posts: 21
Joined: 23-Sep-2010
# Posted on: 03-Nov-2010 21:38:56   

Hello,

I have a procedure within an Oracle package that returns a type which matches the rowtype of a table which I have an entity for:

TYPE user_preference_rec_type is table of User_Preference%rowtype;

PROCEDURE GetUserPreference ( p_UserID USERS.Login%TYPE , p_Pref_Name PIDI_USER_PREFERENCE.PREFERENCE_NAME%TYPE, p_recordset OUT user_preference_rec_type );

Now, since the User_Preference table is an entity in my model, I'd like to be able to project the output onto that entity.

But in the designer, when I try to refresh from the database, even though I check off that SP, it won't come into the Catalog explorer and I don't see any reference to it within the log.

Once I have the data in my entity, I'd like to be able to modify it and save changes back to the database.

Thanks,

Ronnie

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Nov-2010 10:30:09   

Just to confirm I understand you correctly. The SP returns a resultSet, right?

I'm not sure what you mean by "I check off that SP"?

ronnieb
User
Posts: 21
Joined: 23-Sep-2010
# Posted on: 04-Nov-2010 12:37:17   

No, it doesn't return a result set, just a record type that's the same structure as the user_preference table.

When I go into the designer, and do a refresh model from database, I see my stored procedure, I click the check box, the next screen comes up which tells me it's going to execute the procedures and I check it off there as well.

But the Refresh Results are not showing any reference to that stored procedure and it's not showing up in the catalog explorer.

Are record types supported as out parameters from stored procedures?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 04-Nov-2010 14:15:54   

Are record types supported as out parameters from stored procedures?

No, just cursors and simple types. You can map the resultsets of cursors to typedviews, but not (yet) to entities. In a future 3.x version we've planned to map resultsets to entities, but it's not decided which version. You return a row, which isn't planned, just resultsets.

You could (but it's a bit problematic I think) add output parameters to the proc and use that, then project it into a class or existing entity. There's no way to map proc output parameters to an entity though.

Frans Bouma | Lead developer LLBLGen Pro
ronnieb
User
Posts: 21
Joined: 23-Sep-2010
# Posted on: 04-Nov-2010 15:34:57   

Okay, thanks.