This discussion is archived
2 Replies Latest reply: Jan 2, 2013 8:03 AM by fac586 RSS

Object Type as Application Level Variable

MarkWagoner Newbie
Currently Being Moderated
I probably already know the answer to this but thought I would see if anyone has gotten to work or developed some sort of work-around.

My question is, if I define an object type (create type ... as object ...) is it possible to hold a variable of this type as the session level? For example, if I am creating an order using multiple web pages, it would be much easier (and intuitive) to create and manipulate an order object than to hold the data in generic collections.

If that is not possible, is there some way to make a generic Apex collection appear more application specific? By this I mean some way to map the columns C001, C002, ... to more intuitive names such as CUST_NO and ORDER_DATE. I had considered possibly creating a view of the APEX_COLLECTIONS view which would rename the columns but then I would also have to create a bunch of instead of triggers if I wanted to update it as well.

Any thoughts or suggestions would be appreciated. Thanks,
Mark
  • 1. Re: Object Type as Application Level Variable
    jariola Guru
    Currently Being Moderated
    Hi,

    It might that instead of trigger do not work for view where you query APEX_COLLECTIONS.

    But you can create view to display data from APEX_COLLECTIONS and give generic columns meaningful alias.
    Then create own procedures where utilize APEX_COLLECTIONS package to make update/delete/insert.
    Give your procedures parameters meaningful names.

    Regards,
    Jari
    -----
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai
  • 2. Re: Object Type as Application Level Variable
    fac586 Guru
    Currently Being Moderated
    Mark Wagoner wrote:
    I probably already know the answer to this but thought I would see if anyone has gotten to work or developed some sort of work-around.

    My question is, if I define an object type (create type ... as object ...) is it possible to hold a variable of this type as the session level?
    No. APEX session variables are stringly typed (perhaps the biggest single drawback of the framework).
    If that is not possible, is there some way to make a generic Apex collection appear more application specific? By this I mean some way to map the columns C001, C002, ... to more intuitive names such as CUST_NO and ORDER_DATE. I had considered possibly creating a view of the APEX_COLLECTIONS view which would rename the columns but then I would also have to create a bunch of instead of triggers if I wanted to update it as well.
    jarola wrote:It might that instead of trigger do not work for view where you query APEX_COLLECTIONS.
    Confirmed: +{message:id=10391521}+

    Don't waste your time on it.
    But you can create view to display data from APEX_COLLECTIONS and give generic columns meaningful alias.
    Then create own procedures where utilize APEX_COLLECTIONS package to make update/delete/insert.
    That's the approach I'd use as well.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points