Matrix Form Layout

I need to generate a Form with a layout like an Oracle Reports matrix report. The values for each column and row are known, and the user would enter the data (tyically one value) in each cell. Each cell of course gets its two parent FK's from the values in its column and row headers.
I have done this in in Designer 2.1.2/Forms 5 using a temp table with columns like ROW_VALUE, COL1, VALUE1, COL2, VALUE2, etc. and form triggers to populate the temp table from the underlying normalized data during queries, and to go the other way on inserts/updates/deletes.
In Designer/Forms 9i/10g (to which we are upgrading), can we generate a Form with a multirecord block in which the records go across/down like a matrix report?
Thanks

Anton,
the transposed matrixe is nightmare. I suggest you to use standard non transposed matrix and fill the columns based on sql query like
select 'Name', ''
union
select 'Title' , ''
and create logic for storing the datas to the table. There is limitation, that you cannot bind the fields of matrix to the db fields, but the matrix will look better than with transposed matrix.

Similar Messages

  • SRM PO form layout issue

    Dear All,
    Does standard class and method (Layou driver program ) support custom adobe form in SRM 7.0 (PO layout)?
    Kindly let me know your experience.
    Thanks.
    Rrgards,
    Preethi.

    Thanks Kris for your reply! Using Matrix layout yes its possible to make fine adjustment, but I would like to go by Form layout only as its a new tool for SAP in EhP2 as well much better in use as per as performance is concerned. Only thing is I am doing some mistake that the right alignment for labels are not coming rather its coming only as left alighned. Surely I am doing some mistake which I am not able to trace.
    Please advice. Thanks Som.

  • How to build a BIG TREE with Tree-Form layout

    Hi,
    I do have a self-referenced table with our org structure - 15 000 positions.
    I do want to create a tree with this structure.
    Requirements :
    a, to have a tree-form layout
    b, to have search capabilities
    I have tried to use several combinations (maybe all)
    - from using only one View object and create recursive tree - doesn't even run
    - to use two View objects, first as top level nodes, the other as the rest - it runs
    but I can search only top level, and what is worse, by clicking on the node for showing additional information (tree-form layout) I'm waiting for ages for seeing the info
    (it seems that all records are loaded one by one into AS)
    Could you provide some ideas how to deal with this ?
    Thanks.

    I am sorry, this is beyond the scope of this forum.
    As with any functionality not directly provided by JHeadstart, you can build it yourself using the ADF design time tools in JDeveloper. Please use the JDeveloper forum for help on this first step.
    Then, to keep your pages generatable you can move these customizations to custom templates. We are happy to help you with this last step, should you have problems there.
    Steven Davelaar,
    JHeadstart Team.

  • How to hide 'SAVE' button in adobe form layout

    Hi  Friends,
    I have a requirement to hide 'SAVE' button in adobe form layout .They dont want to save the form .
    Is there any way to achieve this .I have gone through scn ,but couldnt find the proper solution
    Thanks and Regards,
    Subeesh Kannottil

    Hi Subeesh,
    Are you talking about restricting the User from Saving the Adobe Form Output. 
    Regards,
    Sivanand Ala

  • Can i set the content of input text in a form layout in the uix page center

    Hi
    i have a simple question, how can i set the content of an input text in a form layout in the .uix page center?
    i saw in the page properties but i didn't found.
    thank you for your help.
    Edited by: Islem on 19 déc. 2008 00:22

    Sirrick,
    If I understand your question correctly, you want to programmatically set how many array elements (clusters) to show. You can do this with the Array properties: Number of Rows and Number of Columns. Please see the attached VI.
    Zvezdana S.
    National Instruments
    Attachments:
    Array_Elements.vi ‏20 KB

  • Create a new class in pe51 form layout

    Hi experts,
                   I want to create a new form  layout in pe51 for payroll register. In standard form class maximum columns is 132 but i want
    more than 300 columns for payroll register. so its possible to to create new zform class in pe51. If its possible pls guide me.
    Thanks in advance.
    Thanks & Regards
    G.Vendhan

    Hi, I am working on the same thing and created a form in PE51 using Form class CKT0 which gives me 255 columns.  I am however having problems with finding some of the fields I need.
    Thanks.
    N

  • How to right align a read only numeric field in a panel form layout

    Hi, does anyone know how to right align a read only numeric field in a panel form layout? I am using: Style Class = AFFieldNumberMarker, but it only seems to work if the field is disabled. Disabling the field gives it a difference appearance that does not look right on our forms. These are calculated fields, which cannot be modified, so read only is necessary.
    I have looked online for some answers, and it seems that others are having similar issues.
    I have tried different combinations for the properties, but so far I cannot get it to work.
    Thanks
    Judy
    I am using JDEV 11.1.1.5

    Sorry for the delay in my response. Here is the code
    <af:inputText value="#{bindings.TotalAirlineCostEst.inputValue}"
    label="#{bindings.TotalAirlineCostEst.hints.label}"
    required="#{bindings.TotalAirlineCostEst.hints.mandatory}"
    columns="#{bindings.TotalAirlineCostEst.hints.displayWidth}"
    maximumLength="#{bindings.TotalAirlineCostEst.hints.precision}"
    shortDesc="#{bindings.TotalAirlineCostEst.hints.tooltip}"
    id="it20" readOnly="false"
    disabled="true"
    styleClass="AFFieldNumberMarker">
    <f:validator binding="#{bindings.TotalAirlineCostEst.validator}"/>
    <af:convertNumber groupingUsed="true"
    pattern="#{bindings.TotalAirlineCostEst.format}"
    type="number"
    maxFractionDigits="0"/>
    </af:inputText>
    thank you,
    Judy

  • SOFFICEINTEGRATION143 Error in ISR when trying opening adobe form layout

    Hi,
    I'm running into SOFFICEINTEGRATION143 error when trying to open any adobe form layout in the ISR secenario definition. Can anyone let me know why I'm getting this error and what the solution is?
    FYI, I'm using SAP gui version 640 Final Release, File Version 6404.4.14.2987, build 781208, Patch level 14
    I do have Adobe LifeCycle Designer 7.1, Reader 8 and MSOffice 2002.
    Thanks in advance.
    Giri.

    Hi, Giri. Did you solve your problem?
    I think I m having similar problem. I installed Sap Gui 7.1, SAP interactive form and Adobe LiveCycle Designer ES.
    I was able to open abode form layout in the transaction SFP. However, after I upgraded my Adobe to 7.0.9. (previous version is 7.x.x). I get the error SOFFICEINTEGRATION143 when try open again.
    I uninstalled Adobe 7.0.9 and installed Adobe 8.1 but it still get the same error.
    Can anyone help?
    Thanks in advance.

  • Adobe form layout version retrival

    Hi Experts,
    I have a problem in opening the adobe form layout.I am facing an error message error while opening the document.I checked in the production system same problem there also.
    it is possbile to retrevive the older version of layout?
    Adobe life cylce designer is installed properly. But i am able to open the layout of another adobe form in another development system.
    Please suggest me on this.
    Regards,
    Jayant.

    Hi,
    ADS needs to be configured properly,
    this is the part of BASIS team.
    regards
    Ramchander rao.K

  • Issue with Adobe Form Layout

    Hi,
    I have an issue with the Adobe Form Layout.Although I have added a field in the Context Menu of the Form Builder but the context has not been added to the Data View.
    Could you please help me to understand how to include the parameters and structures that we define in the context and add them to the Data View in layout?As far as I know, it is done automatically.But in this case I don't understand what the problem is.
    Please help me.
    Thanks,
    Sandeep.
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jul 14, 2009 4:10 PM

    it is normally done automatically. Do ANY of your fields show in your DATA VIEW? Or, are you just missing the new one?
    If you're only missing the new one, make sure your Context has the field defined correctly and generated.. Then make sure you have updated the mapping in your View Context and generated that.
    After those 2 things, your field should now show.
    You cannot, as far as I know, define an attribute as any sort of TABLE - we have a common structure that has several Table Types in it. When we import that structure, we have to delete those attributes and create Nodes to mimick those tables.
    If you've accidentally included a Table type as an attribute, you won't see any fields in your Data View.
    EDIT: by the way, there's an Adobe Interactive Forms Forum where you should ask these kinds of questions.
    Edited by: robert phelan on Apr 2, 2009 8:51 PM

  • Opening a Word document in a form layout html region

    Hi all,
    In an Interactive Report I use
    select '<img src="#WORKSPACE_IMAGES#'||package.f_get_document_type ( doc.id )||'" title="Document" width=20 height=20>'
    ) document
    from table
    to show an icon that eventually downloads (and shows) a word document.
    Now I have a form layout html region and I want to have the same icon\link to show a document.The document however is not in the same table as the rest of the page is based on.
    How can I show the document on this page?
    Kind Regards,
    Maurice
    Environment = Apex 4.0 database 11G
    Edited by: maurice.niezen on Aug 31, 2010 2:10 AM

    One way, create a hidden item, and return the value into it from your package (by having a computation that calls the function package.f_get_document_type(:P1_DOC_ID) . Let's say it's called :P1_DOC_TYPE
    There's a new item type in Apex 4, which is Display Image.
    When you get to settings in the item creation wizard, specify what the image is based on. From there, you can set it to be 'Image URL stored in Page item Value. Then on the source page, you can just specify the URL, #WORKSPACE_IMAGES#&P1_DOC_TYPE.

  • Master-detail page with form layout -- insert only -- not in create mode

    JDeveloper 10.1.3.1 with JHeadstart
    I have the following master-detail structure in JHeadstart:
    Group 1, Table a, Layout: table-form
    Group 2, Table b, Layout: table-form
    Group 3, Table c, Layout: form
    Group 4, Table d, Layout: form (on same page as master table c)
    Table a, b and c are updatable (insert, update and delete).
    I have problems with the last page, tables c and d, master-datail both in form layout.
    The master-table (c) is not an insert-only table, the detail table needs to be an insert-only form on the same page as the master table c.
    Settings Table d:
    Advanced search and quick search: none
    Autoquery: disabled
    Single row insert allowed (other options in Operations disabled)
    In my view object I have used the settings in the JDeveloper guide 8.1.2 ('no rows...' in tab Tuning).
    I run my application in JDeveloper (with the option run in my ViewController-project, which means that I am not running my detail page directly in JDeveloper??) and when I open this last page, the detail form is not in create mode (I see no rows found and a create rows button).
    I have read several threads in this forum, but I do not know how to solve this problem.

    This does not work.
    In my first post I made an mistake in describing my application, it is not a table-form, but a tree-form application:
    Group 1, Table a, Layout: tree-form
    Group 2, Table b, Layout: tree-form
    Group 3, Table c, Layout: tree-form
    Group 4, Table d, Layout: form (on same page as master table c)
    If I override the executeQueryForCollection method in the ViewObjectImpl of table d I get a message ('JBO-27122: SQL-fout tijdens voorbereiding van statement' and 'java.sql.SQLException: OALL8 is in an inconsistent state').
    while clicking on the tree (with table b and c). It seems that the QueryForCollection method is being executed to early.

  • Question regarding Form layout in Flex

    Hi guyz. Today had a look at form layout
    <mx:Form id="form">
            <mx:FormItem label="horizontal:">
                <mx:Text text="test"/>
            </mx:FormItem>
    </mx:Form>
    gives the output in the format 'label' - 'textbox'. But i want to change the orientation like
    label
    checkbox
    How can i do that. Please explain in detail.
    Thanks and Regards,
    Karthik Jayaraman

    savmoy wrote:
     Since php files are run on the server side, can I assume that my JavaScript validations (which are part of  a php file) will be done on the server side as well, and therefore are secure?
    No. The PHP server processes the PHP only, and then sends the output to the browser, which is where the JavaScript will be executed.

  • How to customise ADF form layout

    Hi,
    I've an oracle form in the below format, how can I create similar form layout using adf form components?
    Field
    Field
    Field
    Field
    Field
    Field
    Box for photograph
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Button
    Button
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Field
    Thanks

    Hi Arun,
    here it is...
    <af:panelGridLayout id="pgl1">
                        <af:gridRow marginTop="5px" height="auto" id="gr1">
                            <af:gridCell marginStart="5px" width="20pt" id="gc1" marginEnd="1px">
                                <af:inputText value="#{bindings.EmployeeId.inputValue}"
                                              label="#{bindings.EmployeeId.hints.label}"
                                              required="#{bindings.EmployeeId.hints.mandatory}"
                                              columns="#{bindings.EmployeeId.hints.displayWidth}"
                                              maximumLength="#{bindings.EmployeeId.hints.precision}"
                                              shortDesc="#{bindings.EmployeeId.hints.tooltip}" id="it1">
                                    <f:validator binding="#{bindings.EmployeeId.validator}"/>
                                    <af:convertNumber groupingUsed="false" pattern="#{bindings.EmployeeId.format}"/>
                                </af:inputText>
                                <af:inputText value="#{bindings.JobId.inputValue}" label="#{bindings.JobId.hints.label}"
                                              required="#{bindings.JobId.hints.mandatory}"
                                              columns="#{bindings.JobId.hints.displayWidth}"
                                              maximumLength="#{bindings.JobId.hints.precision}"
                                              shortDesc="#{bindings.JobId.hints.tooltip}" id="it6">
                                    <f:validator binding="#{bindings.JobId.validator}"/>
                                </af:inputText>
                            </af:gridCell>
                            <af:gridCell marginStart="5px" marginEnd="5px" width="20pt" id="gc2">
                                <af:inputText value="#{bindings.FirstName.inputValue}"
                                              label="#{bindings.FirstName.hints.label}"
                                              required="#{bindings.FirstName.hints.mandatory}"
                                              columns="#{bindings.FirstName.hints.displayWidth}"
                                              maximumLength="#{bindings.FirstName.hints.precision}"
                                              shortDesc="#{bindings.FirstName.hints.tooltip}" id="it2">
                                    <f:validator binding="#{bindings.FirstName.validator}"/>
                                </af:inputText>
                                <af:inputText value="#{bindings.LastName.inputValue}"
                                              label="#{bindings.LastName.hints.label}"
                                              required="#{bindings.LastName.hints.mandatory}"
                                              columns="#{bindings.LastName.hints.displayWidth}"
                                              maximumLength="#{bindings.LastName.hints.precision}"
                                              shortDesc="#{bindings.LastName.hints.tooltip}" id="it3">
                                    <f:validator binding="#{bindings.LastName.validator}"/>
                                </af:inputText>
                                <af:inputText value="#{bindings.Email.inputValue}" label="#{bindings.Email.hints.label}"
                                              required="#{bindings.Email.hints.mandatory}"
                                              columns="#{bindings.Email.hints.displayWidth}"
                                              maximumLength="#{bindings.Email.hints.precision}"
                                              shortDesc="#{bindings.Email.hints.tooltip}" id="it4">
                                    <f:validator binding="#{bindings.Email.validator}"/>
                                </af:inputText>
                                <af:inputText value="#{bindings.PhoneNumber.inputValue}"
                                              label="#{bindings.PhoneNumber.hints.label}"
                                              required="#{bindings.PhoneNumber.hints.mandatory}"
                                              columns="#{bindings.PhoneNumber.hints.displayWidth}"
                                              maximumLength="#{bindings.PhoneNumber.hints.precision}"
                                              shortDesc="#{bindings.PhoneNumber.hints.tooltip}" id="it5">
                                    <f:validator binding="#{bindings.PhoneNumber.validator}"/>
                                </af:inputText>
                            </af:gridCell>
                            <af:gridCell id="gc7">
                                <af:inputDate value="#{bindings.HireDate.inputValue}"
                                              label="#{bindings.HireDate.hints.label}"
                                              required="#{bindings.HireDate.hints.mandatory}"
                                              columns="#{bindings.HireDate.hints.displayWidth}"
                                              shortDesc="#{bindings.HireDate.hints.tooltip}" id="id1">
                                    <f:validator binding="#{bindings.HireDate.validator}"/>
                                    <af:convertDateTime pattern="#{bindings.HireDate.format}"/>
                                </af:inputDate>
                            </af:gridCell>
                        </af:gridRow>
                        <af:gridRow marginTop="5px" height="auto" id="gr2">
                            <af:gridCell marginStart="5px" width="50%" id="gc3"/>
                            <af:gridCell marginStart="5px" marginEnd="5px" width="50%" id="gc4"/>
                        </af:gridRow>
                        <af:gridRow marginTop="5px" marginBottom="5px" height="auto" id="gr3">
                            <af:gridCell marginStart="5px" width="50%" id="gc5"/>
                            <af:gridCell marginStart="5px" marginEnd="5px" width="50%" id="gc6"/>
                        </af:gridRow>
                    </af:panelGridLayout>
    I can create 3 rows 3 columns output but when I run it, the columns col2 and col3 are merging into col1.
    thanks

  • Plz help me...to display in  matrix  form

    Hi sir..
    i want to get this report in matrix form...plz i don't have any idea about matrix form...
    Right now iam getting like Below format::
    emp_name cat_name     type_name      theme_name                levels_skilllevel
    rubin      FE MODELLING SKILLS      A2-Assembly - connectors      N
    rubin      FE MODELLING      SKILLS           A2-Assembly - welding                N
    rubin      FE MODELLING      SKILLS           A2-Batch meshing                I
    rubin      FE MODELLING      SKILLS           A2-CFD meshing                     None
    rubin      FE MODELLING      SKILLS           A2-I order Hex meshing                None
    rubin      FE MODELLING      SKILLS           A2-I order Tet meshing                None
    rubin      FE MODELLING      SKILLS           A2-II order Hex meshing           None
    rubin      FE MODELLING      SKILLS           A2-II order Tet meshing           None
    rubin      FE MODELLING      SKILLS           A2-Macros                     None     
    rubin      FE MODELLING      SKILLS           A2-Mid-plane shell meshing           None
    rubin      FE MODELLING      SKILLS           A2-Moldflow meshing                None
    rubin      FE MODELLING      SKILLS           A2-Morphing                     B
    rubin      FE MODELLING      SKILLS           SKILL2                          None
    rubin      POST PROCESSING AUTO[SUB]SYS      AUTO-36                N
    rubin      POST PROCESSING AUTO[SUB]SYS      AUTO-6                     B
    rubin      POST PROCESSING AUTO[SUB]SYS      AUTO3                     I
    rubin      POST PROCESSING AUTO[SUB]SYS      TERMINAL                P
    freddy      FE MODELLING      SKILLS           A2-Assembly - welding                B
    freddy      FE MODELLING      SKILLS           A2-Batch meshing                P
    freddy      FE MODELLING      SKILLS           A2-Macros                     P
    freddy      FE MODELLING      SKILLS           A2-Morphing                     I
    freddy      THERMAL      SKILLS           SKILL-15                          None
    freddy      THERMAL      SKILLS           SKILL-41                          B
    freddy      THERMAL      SKILLS           SKILL-42                          I
    freddy      THERMAL      SKILLS           SKILL-45                          P
    freddy      THERMAL      SKILLS           SKILL-47                          N
    freddy      THERMAL      SKILLS           SKILL-57                          None
    -->     .....check the below one...
    -->Example:see emp_name rubin->cat_name     -> type_name ->theme_name->levels_skilllevel is 'N'
         see emp_name freddy->cat_name-> type_name ->theme_name->levels_skilllevel is 'B'
    cat_name     type_name           theme_name                rubin      freddy
    FE MODELLING      SKILLS      A2-Assembly - connectors      N     B     
    I have written the below query To get it as Above::
    SELECT ae.emp_name, am.cat_name, am.type_name, am.theme_name, am.levels_skilllevel
    FROM alt_employee ae, (
    SELECT *
    FROM alt_category ac, alt_type at, alt_theme atm, alt_levels al, alt_employee ae
    WHERE ac.cat_id
    IN (
    SELECT cat_id
    FROM alt_category
    ) AND ac.cat_id = atm.theme_catid
    AND atm.theme_typeid = at.type_id
    AND atm.theme_id = al.levels_theme_id
    AND al.levels_skilllevel
    IN ('B', 'N', 'I', 'P', 'None')
    GROUP BY cat_name, type_name, theme_name, levels_skilllevel
    )am
    WHERE ae.emp_id = am.levels_employee_id
    Regards
    Narendra

    My solution was a pivot function.
    Using that function will give you something like:
    SQL> select * from table( pivot(
      2  'select cat.cat_name
      3       , type.type_name
      4       , theme.theme_name
      5       , emp.emp_name
      6       , levels.levels_skilllevel
      7  from alt_theme theme
      8     , alt_category cat
      9     , alt_type type
    10     , alt_levels levels
    11     , alt_employee emp
    12  where cat.cat_id (+) = theme.theme_catid
    13  and   type.type_id = theme.theme_typeid
    14  and   levels.levels_theme_id = theme.theme_id
    15  and   emp.emp_id = levels.levels_employee_id
    16  '
    17   ) );
    CAT_NAME TYPE_NAME       THEME_NAME                freddy    ruby
    FE       MODELLING       A2-Assembly - welding     B         B
    FE       MODELLING       A2-Assembly - connectors            N
             THERMAL SKILLS  SKILL-41                  B         I
             THERMAL SKILLS  SKILL-42                  N         P
    SQL> Anton
    create or replace type PivotImpl as object
      ret_type anytype,      -- The return type of the table function
      stmt varchar2(32767),
      cur integer,
      static function ODCITableDescribe( rtype out anytype, p_stmt in varchar2, p_agg in varchar2 := 'max' )
      return number,
      static function ODCITablePrepare( sctx out PivotImpl, ti in sys.ODCITabFuncInfo, p_stmt in varchar2, p_agg in varchar2 := 'max' )
      return number,
      static function ODCITableStart( sctx in out PivotImpl, p_stmt in varchar2, p_agg in varchar2 := 'max' )
      return number,
      member function ODCITableFetch( self in out PivotImpl, nrows in number, outset out anydataset )
      return number,
      member function ODCITableClose( self in PivotImpl )
      return number
    create or replace type body PivotImpl
    as
      static function ODCITableDescribe( rtype out anytype, p_stmt in varchar2, p_agg in varchar2 := 'max' )
      return number
      is
        atyp anytype;
        cur integer;
        numcols number;
        desc_tab dbms_sql.desc_tab2;
        rc sys_refcursor;
        t_c2 varchar2(32767);
      begin
        cur := dbms_sql.open_cursor;
        dbms_sql.parse( cur, p_stmt, dbms_sql.native );
        dbms_sql.describe_columns2( cur, numcols, desc_tab );
        dbms_sql.close_cursor( cur );
        anytype.begincreate( dbms_types.typecode_object, atyp );
        for i in 1 .. numcols - 2
        loop
          atyp.addattr( desc_tab( i ).col_name
                      , case desc_tab( i ).col_type
                          when 1   then dbms_types.typecode_varchar2
                          when 2   then dbms_types.typecode_number
                          when 9   then dbms_types.typecode_varchar2
                          when 11  then dbms_types.typecode_varchar2  -- show rowid as varchar2
                          when 12  then dbms_types.typecode_date
                          when 208 then dbms_types.typecode_urowid
                          when 96  then dbms_types.typecode_char
                          when 180 then dbms_types.typecode_timestamp
                          when 181 then dbms_types.typecode_timestamp_tz
                          when 231 then dbms_types.typecode_timestamp_ltz
                          when 182 then dbms_types.typecode_interval_ym
                          when 183 then dbms_types.typecode_interval_ds
                        end
                      , desc_tab( i ).col_precision
                      , desc_tab( i ).col_scale
                      , case desc_tab( i ).col_type
                          when 11 then 18  -- for rowid col_max_len = 16, and 18 characters are shown
                          else desc_tab( i ).col_max_len
                        end
                      , desc_tab( i ).col_charsetid
                      , desc_tab( i ).col_charsetform
        end loop;
        open rc for 'select distinct ' || desc_tab( numcols - 1 ).col_name || '
                              from( ' || p_stmt || ' )
                              order by 1';
        loop
          fetch rc into t_c2;
          exit when rc%notfound;
          atyp.addattr( t_c2
                      , case desc_tab( numcols ).col_type
                          when 1   then dbms_types.typecode_varchar2
                          when 2   then dbms_types.typecode_number
                          when 9   then dbms_types.typecode_varchar2
                          when 11  then dbms_types.typecode_varchar2  -- show rowid as varchar2
                          when 12  then dbms_types.typecode_date
                          when 208 then dbms_types.typecode_urowid
                          when 96  then dbms_types.typecode_char
                          when 180 then dbms_types.typecode_timestamp
                          when 181 then dbms_types.typecode_timestamp_tz
                          when 231 then dbms_types.typecode_timestamp_ltz
                          when 182 then dbms_types.typecode_interval_ym
                          when 183 then dbms_types.typecode_interval_ds
                        end
                      , desc_tab( numcols ).col_precision
                      , desc_tab( numcols ).col_scale
                      , case desc_tab( numcols ).col_type
                          when 11 then 18  -- for rowid col_max_len = 16, and 18 characters are shown
                          else desc_tab( numcols ).col_max_len
                        end
                      , desc_tab( numcols ).col_charsetid
                      , desc_tab( numcols ).col_charsetform
        end loop;
        close rc;
        atyp.endcreate;
        anytype.begincreate( dbms_types.typecode_table, rtype );
        rtype.SetInfo( null, null, null, null, null, atyp, dbms_types.typecode_object, 0 );
        rtype.endcreate();
        return odciconst.success;
      exception
        when others then
          return odciconst.error;
      end;
      static function ODCITablePrepare( sctx out PivotImpl, ti in sys.ODCITabFuncInfo, p_stmt in varchar2, p_agg in varchar2 := 'max' )
      return number
      is
        prec     pls_integer;
        scale    pls_integer;
        len      pls_integer;
        csid     pls_integer;
        csfrm    pls_integer;
        elem_typ anytype;
        aname    varchar2(30);
        tc       pls_integer;
      begin
        tc := ti.RetType.GetAttrElemInfo( 1, prec, scale, len, csid, csfrm, elem_typ, aname );
        sctx := PivotImpl( elem_typ, p_stmt, null );
        return odciconst.success;
      end;
      static function ODCITableStart( sctx in out PivotImpl, p_stmt in varchar2, p_agg in varchar2 := 'max' )
      return number
      is
        cur         integer;
        numcols     number;
        desc_tab    dbms_sql.desc_tab2;
        t_stmt      varchar2(32767);
        t_stmt_end  varchar2(32767);
        type_code   pls_integer;
        prec        pls_integer;
        scale       pls_integer;
        len         pls_integer;
        csid        pls_integer;
        csfrm       pls_integer;
        schema_name varchar2(30);
        type_name   varchar2(30);
        version     varchar2(30);
        attr_count  pls_integer;
        attr_type   anytype;
        attr_name   varchar2(100);
        dummy2      integer;
      begin
        cur := dbms_sql.open_cursor;
        dbms_sql.parse( cur, p_stmt, dbms_sql.native );
        dbms_sql.describe_columns2( cur, numcols, desc_tab );
        dbms_sql.close_cursor( cur );
        for i in 1 .. numcols - 2
        loop
          t_stmt := t_stmt || ', "' || desc_tab( i ).col_name || '"';
        end loop;
        t_stmt := substr( t_stmt, 2 );
        t_stmt_end := t_stmt;
        type_code := sctx.ret_type.getinfo( prec
                                          , scale
                                          , len
                                          , csid
                                          , csfrm
                                          , schema_name
                                          , type_name
                                          , version
                                          , attr_count
        for i in numcols - 1 .. attr_count
        loop
          type_code := sctx.ret_type.getattreleminfo( i
                                                     , prec
                                                     , scale
                                                     , len
                                                     , csid
                                                     , csfrm
                                                     , attr_type
                                                     , attr_name
          t_stmt := t_stmt || ', ' || p_agg || '( decode( ' || desc_tab( numcols - 1 ).col_name || ', ''' || attr_name || ''', ' || desc_tab( numcols ).col_name || ' ) )';
        end loop;
        t_stmt := 'select' || t_stmt || ' from ( ' || sctx.stmt || ' ) group by' || t_stmt_end;
        sctx.cur := dbms_sql.open_cursor;
        dbms_sql.parse( sctx.cur, t_stmt, dbms_sql.native );
        for i in 1 .. attr_count
        loop
          type_code := sctx.ret_type.getattreleminfo( i
                                                    , prec
                                                    , scale
                                                    , len
                                                    , csid
                                                    , csfrm
                                                    , attr_type
                                                    , attr_name
          case type_code
            when dbms_types.typecode_char          then dbms_sql.define_column( sctx.cur, i, 'x', 32767 );
            when dbms_types.typecode_varchar2      then dbms_sql.define_column( sctx.cur, i, 'x', 32767 );
            when dbms_types.typecode_number        then dbms_sql.define_column( sctx.cur, i, cast( null as number ) );
            when dbms_types.typecode_date          then dbms_sql.define_column( sctx.cur, i, cast( null as date ) );
            when dbms_types.typecode_urowid        then dbms_sql.define_column( sctx.cur, i, cast( null as urowid ) );
            when dbms_types.typecode_timestamp     then dbms_sql.define_column( sctx.cur, i, cast( null as timestamp ) );
            when dbms_types.typecode_timestamp_tz  then dbms_sql.define_column( sctx.cur, i, cast( null as timestamp with time zone ) );
            when dbms_types.typecode_timestamp_ltz then dbms_sql.define_column( sctx.cur, i, cast( null as timestamp with local time zone ) );
            when dbms_types.typecode_interval_ym   then dbms_sql.define_column( sctx.cur, i, cast( null as interval year to month ) );
            when dbms_types.typecode_interval_ds   then dbms_sql.define_column( sctx.cur, i, cast( null as interval day to second ) );
          end case;
        end loop;
        dummy2 := dbms_sql.execute( sctx.cur );
        return odciconst.success;
      end;
      member function ODCITableFetch( self in out PivotImpl, nrows in number, outset out anydataset )
      return number
      is
        c1_col_type pls_integer;
        type_code   pls_integer;
        prec        pls_integer;
        scale       pls_integer;
        len         pls_integer;
        csid        pls_integer;
        csfrm       pls_integer;
        schema_name varchar2(30);
        type_name   varchar2(30);
        version     varchar2(30);
        attr_count  pls_integer;
        attr_type   anytype;
        attr_name   varchar2(100);
        v1     varchar2(32767);
        n1     number;
        d1     date;
        ur1    urowid;
        ids1   interval day to second;
        iym1   interval year to month;
        ts1    timestamp;
        tstz1  timestamp with time zone;
        tsltz1 timestamp with local time zone;
      begin
        outset := null;
        if nrows < 1
        then
    -- is this possible???
          return odciconst.success;
        end if;
        if dbms_sql.fetch_rows( self.cur ) = 0
        then
          return odciconst.success;
        end if;
        type_code := self.ret_type.getinfo( prec
                                          , scale
                                          , len
                                          , csid
                                          , csfrm
                                          , schema_name
                                          , type_name
                                          , version
                                          , attr_count
        anydataset.begincreate( dbms_types.typecode_object, self.ret_type, outset );
        outset.addinstance;
        outset.piecewise();
        for i in 1 .. attr_count
        loop
          type_code := self.ret_type.getattreleminfo( i
                                                     , prec
                                                     , scale
                                                     , len
                                                     , csid
                                                     , csfrm
                                                     , attr_type
                                                     , attr_name
            case type_code
              when dbms_types.typecode_char then
                dbms_sql.column_value( self.cur, i, v1 );
                outset.setchar( v1 );
              when dbms_types.typecode_varchar2 then
                dbms_sql.column_value( self.cur, i, v1 );
                outset.setvarchar2( v1 );
              when dbms_types.typecode_number then
                dbms_sql.column_value( self.cur, i, n1 );
                outset.setnumber( n1 );
              when dbms_types.typecode_date then
                dbms_sql.column_value( self.cur, i, d1 );
                outset.setdate( d1 );
              when dbms_types.typecode_urowid then
                dbms_sql.column_value( self.cur, i, ur1 );
                outset.seturowid( ur1 );
              when dbms_types.typecode_interval_ds then
                dbms_sql.column_value( self.cur, i, ids1 );
                outset.setintervalds( ids1 );
              when dbms_types.typecode_interval_ym then
                dbms_sql.column_value( self.cur, i, iym1 );
                outset.setintervalym( iym1 );
              when dbms_types.typecode_timestamp then
                dbms_sql.column_value( self.cur, i, ts1 );
                outset.settimestamp( ts1 );
              when dbms_types.typecode_timestamp_tz then
                dbms_sql.column_value( self.cur, i, tstz1 );
                outset.settimestamptz( tstz1 );
              when dbms_types.typecode_timestamp_ltz then
                dbms_sql.column_value( self.cur, i, tsltz1 );
                outset.settimestampltz( tsltz1 );
            end case;
        end loop;
        outset.endcreate;
        return odciconst.success;
      end;
      member function ODCITableClose( self in PivotImpl )
      return number
      is
        c integer;
        t_id user_objects.object_id%type;
      begin
        c := self.cur;
        dbms_sql.close_cursor( c );
        select object_id
        into t_id
        from user_objects
        where object_name = 'PIVOTIMPL'
        and   object_type = 'TYPE BODY';
    -- invalidating of the type body forces that ODCITableDescribe is executed for every call to the pivot function
    -- and we do need that to make sure that any new columns are picked up (= new values for the pivoting column)
        dbms_utility.invalidate( t_id );
        return odciconst.success;
      end;
    end;
    create or replace
    function pivot( p_stmt in varchar2, p_agg in varchar2 := 'max' )
    return anydataset pipelined using PivotImpl;
    /

Maybe you are looking for

  • Using the Model Facade Pattern in a Java EE 5 Web application

    Hi, Yutaka and I did a Tech tip http://java.sun.com/mailers/techtips/enterprise/2006/TechTips_Nov06.html#2 on using a model facade pattern in Java EE 5 web-only applications recently. We got some questions about it, and these were some of the questio

  • Conversion of string 20080315 to 2008-03-15

    Hi all, I have a string in this format 20080315 , but i want it to get displayed as 2008-03-15, how to fit this "-" in between this string using string function ? Few more examples below YYYYMMDDhhmmss   should get displyed like this "YYYY-MM-DDThh:m

  • Xi Alerts - Can a  field in the payload be a part of the alert message?

    Hi All,           I have a requirement in my alert configuration wherein a specific field in the message  payload needs to appear in the Alert message. In the std configuration I see field containers for std things like message ID, services etc... bu

  • ****Invoice Price different from Contract price...

    Experts, Can SAP flag or reject invoice if invoice price does not match the contract price ? Regards Albert

  • Recover calendar data from iCloud / mobile me

    I converted mobileme to iCloud after updating iphones and ipads to ios5.  I have lost a large amount of calendar data as part of this process.  Is there a way to recover this either by reverting from iCloud back to mobile me (and how? ) or by restori