#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    11
    Rep Power
    0

    Question Oracle 11g - Dynamic field reference


    I am working on an application that requires very dynamic access to data. Users will build queries through the interface and the queries will be stored in VARCHAR fields for later use.

    The function that later uses the query has no way of knowing the field names or data types used in the selection query.

    This isn't an issue in any program language that I have used before but in this case, we want to do this in a package within Oracle rather than an external application.

    I have no idea how to reference a field by its location or position in the query.

    We need to get the list of fields so we know what each field is named and we need to be able to get at its value dynamically as well. If possible, checking the data type would be helpful too but that is less important in this case.

    If we were doing this in say PHP, we could simply reference the query row and use a command like...

    foreach($myrow as $field=>$value)

    and this would walk through each field in the row giving us the field name and its value.

    We need to do this same type of thing in our package.

    Has anyone ever done anything like this?

    A simple code snippet would be greatly appreciated.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    11
    Rep Power
    0
    No clues yet?

    Is there something like an EVAL function?

    Something where I might be able to say...

    MyVar := EVAL("mycursor.myfield");


    I could make this work for me if something like this exists. I know "EVAL" itself doesn't but is there something that does the same function?

IMN logo majestic logo threadwatch logo seochat tools logo