How to implement place holder columns in data template

Hi,
I have a requirement where I have to mimic the functionality of place holder columns in RDF using Data Templates in XML Publisher.
How can I call a pl/sql function at element level when we try to group records in the data template.
To make it simple , let us say I have a requirement to retrieve the address of an employee(address line 1,address line 2, city,country)
In RDF what I do is define 4 place holder columns to capture address attributes, and in a formula column I set values to these attributes. How do I implement this in XML Publisher data template.
When I tried to implement the above requirement using test variables, I was able to execute a pl/sql function after the group tag, but not within the group tag.
I got the result for calc_values3 , but didn;t get anythng for calc_values1 and 2
Data Template:
<dataTemplate name="XXLCPAY142R" description="online payslip" defaultPackage="XXLCPAY_ONLINEPAYSLIP_PKG" version="1.0">
<parameters>
<parameter name="P_ASSIGNMENT_ACTION_ID" dataType="number" />
</parameters>
<dataQuery>
<sqlStatement name="Q_PAYMENT_RUN">
<![CDATA[
SELECT PAAPRV.assignment_action_id assignment_action_id
,PAAPRV.payroll_action_id payroll_action_id
,PAAPRV.run_assignment_action_id run_assignment_action_id
,PAAPRV.run_payroll_action_id run_payroll_action_id
,PAAPRV.person_id person_id
,PAAPRV.full_name full_name
,PAAPRV.last_name surname
,PAAPRV.assignment_id assignment_id
,PAAPRV.business_group_id business_group_id
,PAAPRV.assignment_number assignment_number
,PAAPRV.registered_employer legal_employer
,PAAPRV.abn abn
,PAAPRV.grade grade
,PAAPRV.payroll_id payroll_id
,PAAPRV.time_period_id time_period_id
,PAAPRV.period_start_date period_start_date
,PAAPRV.period_end_date period_end_date
,TO_CHAR(PAAPRV.period_start_date,'DD-Mon-YYYY') period_start_display
,TO_CHAR(PAAPRV.period_end_date,'DD-Mon-YYYY') period_end_display
,PAAPRV.period_number || ' ' || TO_CHAR(PAAPRV.period_end_date,'YYYY') period_number
,TO_CHAR(PTP.regular_payment_date,'DD-Mon-YYYY') pay_date
,PAAPRV.date_earned date_earned
,PAAF.ass_attribute2 legacy_position
,HR_GENERAL.DECODE_LOOKUP('EMPLOYEE_CATG',PAAF.employee_category) paypoint
,PPB.name salary_basis
,PAAF.people_group_id people_group_id
,PAAF.collective_agreement_id cagr_id
FROM pay_au_asg_payment_runs_v PAAPRV
,per_time_periods PTP
,per_all_assignments_f PAAF
,per_pay_bases PPB
WHERE PAAPRV.time_period_id = PTP.time_period_id
AND PAAPRV.assignment_id = PAAF.assignment_id
AND PAAF.pay_basis_id = PPB.pay_basis_id
AND PAAPRV.date_earned BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
AND PAAPRV.assignment_action_id = :P_ASSIGNMENT_ACTION_ID
]]>
</sqlStatement>
<sqlStatement name="Q_EARNINGS_DEDUCTIONS">
<![CDATA[
SELECT PAI.locking_action_id assignment_action_id_elements
     ,PRR.assignment_action_id assignment_action_id_run_ele
     ,PRR.run_result_id run_result_id
     ,PPA.effective_date effective_date_run
     ,PAAF.pay_basis_id pay_basis_id
     ,PETF.element_type_id element_type_id_ele
     ,NVL(PETF.reporting_name
     ,PETF.element_name) element_name_ear_ded
     ,PIVF.input_value_id input_value_id
     ,PEC.classification_name classification_name
     ,PRRV.result_value amount_elements
     ,DECODE( PEC.classification_name
     , 'Earnings' , 1
     ,'Pre Tax Deductions' , 2
     ,'Involuntary Deductions' , 3
     ,'Voluntary Deductions' , 3 ) sort_order_elements
     ,CASE NVL(PETF.reporting_name
     ,PETF.element_name)
     WHEN 'Salary' THEN 1
     ELSE 2
     END sort_order_name
     ,DECODE( PEC.classification_name
     ,'Earnings',1
     ,0
     ) earnings_count
     ,DECODE( PEC.classification_name
     ,'Earnings',0
     ,1
     ) deductions_count     
     FROM pay_action_interlocks PAI
     ,pay_assignment_actions PAA
     ,pay_payroll_actions PPA
     ,per_all_assignments_f PAAF
     ,pay_run_results PRR
     ,pay_run_result_values PRRV
     ,pay_input_values_f PIVF
     ,pay_element_types_f PETF
     ,pay_element_classifications PEC
     WHERE PAI.locked_action_id = PAA.assignment_action_id
     AND PAA.payroll_action_id = PPA.payroll_action_id
     AND PAA.assignment_id = PAAF.assignment_id
     AND PAA.assignment_action_id = PRR.assignment_action_id
     AND PRR.run_result_id = PRRV.run_result_id
     AND PRRV.input_value_id = PIVF.input_value_id
     AND PRR.element_type_id = PETF.element_type_id
     AND PETF.classification_id = PEC.classification_id
     AND PPA.effective_date BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
     AND PPA.effective_date BETWEEN PETF.effective_start_date AND PETF.effective_end_date
     AND PPA.effective_date BETWEEN PIVF.effective_start_date AND PIVF.effective_end_date
     AND PPA.action_type IN ( 'R','Q' )
     AND PRR.status IN ('P','PA')
     AND PEC.classification_name IN ( 'Earnings'
     ,'Pre Tax Deductions'
     ,'Involuntary Deductions'
     ,'Voluntary Deductions')
     AND PIVF.name = 'Pay Value'
     AND PAI.locking_action_id = :assignment_action_id
     ORDER BY sort_order_elements ASC, sort_order_name ASC
]]>
</sqlStatement>
</dataQuery>
<dataTrigger name="beforeReport" source="XXLCPAY_ONLINEPAYSLIP_PKG.BEFORE_REPORT" />
<dataStructure>
<group name="G_PAYMENT_RUN" source="Q_PAYMENT_RUN">
<element name="assignment_action_id" value="assignment_action_id"/>
<element name="payroll_action_id" value="payroll_action_id"/>
<element name="run_assignment_action_id" value="run_assignment_action_id"/>
<element name="run_payroll_action_id" value="run_payroll_action_id"/>
<element name="person_id" value="person_id"/>
<element name="full_name" value="full_name"/>
<element name="surname" value="surname"/>
<element name="assignment_id" value="assignment_id"/>
<element name="business_group_id" value="business_group_id"/>
<element name="assignment_number" value="assignment_number"/>
<element name="legal_employer" value="legal_employer"/>
<element name="abn" value="abn"/>
<element name="grade" value="grade"/>
<element name="payroll_id" value="payroll_id"/>
<element name="time_period_id" value="time_period_id"/>
<element name="period_start_date" value="period_start_date"/>
<element name="period_end_date" value="period_end_date"/>
<element name="period_start_display" value="period_start_display"/>
<element name="period_end_display" value="period_end_display"/>
<element name="period_number" value="period_number"/>
<element name="pay_date" value="pay_date"/>
<element name="date_earned" value="date_earned"/>
<element name="legacy_position" value="legacy_position"/>
<element name="paypoint" value="paypoint"/>
<element name="salary_basis" value="salary_basis"/>
<element name="people_group_id" value="people_group_id"/>
<element name="cagr_id" value="cagr_id"/>
<group name="G_EARNINGS_DEDUCTIONS" source="Q_EARNINGS_DEDUCTIONS">
<element name="assignment_action_id_elements" value="assignment_action_id_elements"/>
<element name="assignment_action_id_run_ele" value="assignment_action_id_run_ele"/>
<element name="run_result_id" value="run_result_id"/>
<element name="effective_date_run" value="effective_date_run"/>
<element name="pay_basis_id" value="pay_basis_id"/>
<element name="element_type_id" value="element_type_id"/>
<element name="element_name_ear_ded" value="element_name_ear_ded"/>
<element name="input_value_id" value="input_value_id"/>
<element name="classification_name" value="classification_name"/>
<element name="amount_elements" value="amount_elements"/>
<element name="sort_order_elements" value="sort_order_elements"/>
<element name="sort_order_name " value="sort_order_name "/>
<element name="earnings_count" value="earnings_count"/>
<element name="deductions_count" value="deductions_count"/>
<element name="calc_values" value="XXLCPAY_ONLINEPAYSLIP_PKG.CALC_VALUES(67772)"/>
<element name="calc_values1" value="XXLCPAY_ONLINEPAYSLIP_PKG.RETURN_TEST"/>
<element name="calc_values2" dataType="number" value="XXLCPAY_ONLINEPAYSLIP_PKG.P_TEST" function="XXLCPAY_ONLINEPAYSLIP_PKG.P_TEST"/>
</group>
</group>
<element name="calc_values3" dataType="number" value="XXLCPAY_ONLINEPAYSLIP_PKG.P_TEST"/>
</dataStructure>
</dataTemplate>
CREATE OR REPLACE PACKAGE XXLCPAY_ONLINEPAYSLIP_PKG
AS
P_TEST NUMBER;
P_ASSIGNMENT_ACTION_ID NUMBER;
FUNCTION BEFORE_REPORT RETURN BOOLEAN;
FUNCTION RETURN_TEST RETURN NUMBER;
FUNCTION RETURN_TEST1 RETURN NUMBER;
FUNCTION RETURN_TEST2 RETURN NUMBER;
FUNCTION CALC_VALUES(element_type_id number) RETURN NUMBER;
END XXLCPAY_ONLINEPAYSLIP_PKG;
CREATE OR REPLACE PACKAGE BODY XXLCPAY_ONLINEPAYSLIP_PKG
AS
P_TEST1 NUMBER;
P_TEST2 NUMBER;
FUNCTION BEFORE_REPORT RETURN BOOLEAN
IS
BEGIN
P_TEST := 2;
FND_FILE.PUT_LINE(FND_FILE.LOG,'From Before Report');
RETURN(TRUE);
END BEFORE_REPORT;
FUNCTION RETURN_TEST RETURN NUMBER
IS
BEGIN
FND_FILE.PUT_LINE(FND_FILE.LOG,'Call 1');
RETURN(P_TEST);
END RETURN_TEST;
FUNCTION CALC_VALUES(element_type_id number) RETURN NUMBER
IS
BEGIN
FND_FILE.PUT_LINE(FND_FILE.LOG,'Call 2');
p_test1 := null;
p_test2 := null;
if ( element_type_id = 67772 ) then
P_TEST1 := 5;
P_TEST2 := 7;
elsif (element_type_id = 67804 ) then
P_TEST1 := 9;
P_TEST2 := 11;
end if;
RETURN(1);
END CALC_VALUES;
FUNCTION RETURN_TEST1 RETURN NUMBER
IS
BEGIN
RETURN(P_TEST1);
END RETURN_TEST1;
FUNCTION RETURN_TEST2 RETURN NUMBER
IS
BEGIN
RETURN(P_TEST2);
END RETURN_TEST2;
END XXLCPAY_ONLINEPAYSLIP_PKG;
/

For this, you need to have a master query and child query.
1) In your master query you will have to identify one unique column and call a pl/sql pkg function which calculates all values for your place holder columns and inserts rows into a pl/sql table with the index as your unique column
ex: Master query returns
empnum name amount
1 scott 250
2 bob 350
and your calculated value is 10 percent of the amount
your pl/sql pkg should insert records into the pl/sql table like r(1):= 250*0.1 = 25 r(2):= 350*0.1 = 35
2) The child query will get executed for each row of you rmaster query, so you should be able to read the values based on which master records row it is executing for
Please bear in mind that you have to make sure that the report is not executed by two different people at the same time, else you have to consider session or any other unique identifier in addition to your master records unique identifier.
Cheers,
Girish.

Similar Messages

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • About place holder columns in reports

    hi gurus,
    i want to know about
    place holder columns,
    lexical parameters,
    matrix reports
    in reports with some common examples
    can any one guide me to do this..
    any help is highly appreciated..
    please reply...

    hi
    this is forms forum plz post your thread on Report forum. hope you will get prompt answer...
    sarah

  • Formula Columns in Data Template

    Hi,
    Is it posiible to have formula columns in data template apart from summary columns.please suggest.
    Regards

    You can put those formula-logic in sql query.
    summation/avg functions can be used directly in element.

  • How to implement parent entity for core data

    Hi there.
    I am starting a document-based Core Data application (Cocoa) and developed the following data model;
    The 'invoice' entity is a parent entity of 'items', because ideally I would want there to be many items for each invoice. I guess my first point here is - is what I am trying to do going to be achieved using this method?
    If so, I have been trying several ways in Interface Builder to sort out how to implement this structure with cocoa bindings. I have made a Core Data app before, just with one entity. So this time, I have two separate instances of NSArrayController's connected to tables with relevant columns. I can add new 'invoice' entities fine, but I can't get corresponding 'items' to add.
    I tried setting the Managed Object Context of the 'item' NSArrayController to this;
    I thought this would resolve the issue, but I still have found no resolution to the problem.
    If anyone done something similar to this, I'd appreciate any help
    Thanks in advance,
    Ricky.

    Second, when you create a Core Data Document Based application, XCode generates the MyDocument class, derivating from NSPersistentDocument. This class is dedicated to maintain the Managed Object Model and the Managed Object Context of each document of your application.
    There is only one Context and generally one Model for each Document.
    In Interface Builder, the Managed Object Context must be bound to the managedObjectContext of the MyDocument instance: it's the File's owner of the myDocument.xib Nib file.
    It's not the case in your Nib File where the Managed Object Context is bound to the invoiceID of the Invoice Controller.
    It's difficult to help you without an overall knowledge of your application, perhaps could you create an InvoiceItem Controller and bind its Content Set to the relationship of your invoice.

  • How do you determine a column's data type?

    Let's say I have a DB Table out there and I have NO WAY of knowing that column 1 is a CHAR, column 2 is a SMALLINT or whatever. I can write sql to select * from table and see everything, but how do I know what each column's data type is?

    I found it. Thanks, and for any other people who need the solution, here is what I found on another thread:
    int type;               try {                    type = i_metaData.getColumnType(column+1);               }               catch (SQLException e) {                    return super.getColumnClass(column);               } switch(type) {               case Types.CHAR:               case Types.VARCHAR:               case Types.LONGVARCHAR:                    return String.class;               case Types.BIT:                    return Boolean.class;               case Types.TINYINT:               case Types.SMALLINT:               case Types.INTEGER:                    return Integer.class;               case Types.BIGINT:                    return Long.class;               case Types.FLOAT:               case Types.DOUBLE:                    return Double.class;               case Types.DATE:                    return java.sql.Date.class;               case Types.TIMESTAMP: //Date Time                    return java.sql.Date.class;               case Types.DECIMAL: // Currency,Decimal                    return Float.class;               default:                    return Object.class;        } }

  • How to not make Tables, Column and Data Available in Excel

    Goal:
    Not displaying the dimension table and its data in excel
    Problem:
    I was enable to deny access for the user roles in SSAS about denying access the data from the column but the next thing is that I do not know how dimension table and column not to be available in the excel.
    Information:
    *The datasource is SSAS
    *I have made three user to have access to two tables only.

    Hi Sakura,
    According to your description, you want the Manager role can see all dimension table and its data column. And the Employee role can't view all table, column and data, right? Currently we don't have a direct option to complete hide the dimensions or attributes
    to some roles. However you can use workarounds below.
    Using cube perspectives and hide the cube dimension attribute then set the perspectives to role.
    Perspectives
    Use this workaround discussed in the similar thread below.
    Dimension attribute security to hide or unhide an attribute
    based on certain condition
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Syntax of formula column in data template

    Hi All,
    I am trying to generate XML output from Data Template. But I am struggling with how to implement formula column. I am using this syntax. But it is not working. Please anybody send me working formula column syntax.
    <element name="PO_NUMBER" value="PO_NUMBER" />
    <function name="CF_DUMMY" dataType="number" >
    <textSource>
    <! [CDATA [
    function CF_DUMMY return number is
    begin
    return 3;
    end;
    ]]>
    </textSource>
    </function>
    </group>

    The call is done directly in the query.
    In your Template header you can reference the database package to use this for example for triggers in your template:
    <dataTemplate .... defaultPackage="myPackage" ...>
    Then your Query looks like
    <sqlStatement name="Q_2">
    <![CDATA[select empno,ename,myPackage.cf_myformula(sal, comm) as Income from emp WHERE deptno=:abeilung]]>
    </sqlStatement>
    In your dataStructure Section you than can reference the formula like any other column
    <element name="INCOME" dataType="number" value="INCOME"/>
    Additionaly you can have triggers like before report trigger, where the logic is in the same database package:
    <dataTrigger name="beforeReport" source="myPackage.beforeRepLogic"/>
    Regards
    Rainer

  • Blob Column in Data Template

    Below is simple Example I tried and output doesnot look right.
    Note: My Blob Database Column is "LOGO".
    Sample Data Template:
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <dataTemplate name="Employee_Listing" description="List of
    Employees">
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT EMPNO,ENAME,JOB,LOGO from
    EMP]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_EMP" source="Q1">
    <element name="EMPLOYEE_NUMBER" value="EMPNO" />
    <element name="NAME" value="ENAME"/>
    <element name="JOB" value="JOB" />
    <element name="LOGO" value="LOGO" />
    </group>
    </dataStructure>
    </dataTemplate>
    Sample Ouput Created
    <?xml version="1.0" encoding="UTF-8"?>
    <EMPLOYEE_LISTING>
    <LIST_G_EMP>
    <G_EMP>
    <EMPLOYEE_NUMBER>999</EMPLOYEE_NUMBER>
    <NAME>PILLAI</NAME>
    <JOB>MGR</JOB>
    <LOGO/>
    </G_EMP>
    </LIST_G_EMP>
    </EMPLOYEE_LISTING>
    My Question is :
    Does output should have only a TAG for Blob Column or it should have image data
    which can be rendered through Template using fo:instream tags.
    Am I hitting any bug which is preventing retrieving Blob data through XML data template

    I need to get data out of a BLOB column from a table in an Oracle 8i database and into a file that I can put into a MS Word template. The data in the BLOB column came from a MS Word document. What is the best way to proceed? We have a LOB datatype sample which shows how to save a blob from the DB to a local file at http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.htm
    I'd save it to a temp file and then using word add it. You could also spawn wscript.exe to run a Windows VB Script to automate word from the java application.
    Rob

  • How to remove an XML file from Data Template in Data Definition Screen

    Hi,
    Issue: I have uploaded the file in Data definition in Data Template.
    How to remove it.
    Also what does each file type mean?
    XML Schema
    Data Template
    Preview file
    Bursting control File
    I have an XML file and XSL file. I need to have an output in XML.
    So I installed my XML file in data template in data definition.
    And XSL file in Templates.
    Am I correct?
    11.0.10.2
    Regards,
    Avijit

    Issue: I have uploaded the file in Data definition in Data Template.
    How to remove it.You cannot remove it but you can end-date it.
    Also what does each file type mean?
    XML Schema
    Data Template
    Preview file
    Bursting control FileThis is explained in "Oracle XML Publisher Administration and Developer's Guide Release 12" manual -- http://docs.oracle.com/cd/B34956_01/current/acrobat/120xdoig.pdf
    I have an XML file and XSL file. I need to have an output in XML.
    So I installed my XML file in data template in data definition.
    And XSL file in Templates.
    Am I correct?Correct -- See Chapter 2 "Creating the Template" and Chapter 5 "Data Templates and Chapter" in the same doc referenced above for details.
    Thanks,
    Hussein

  • How to set the value of a data template parameter at runtime?

    I went through the document and found one line "A parameter is a variable whose value can be set at runtime.". But there is no further description or example about this feature.
    Can anyone tell how to do or show me a example?
    Thanks in advance

    Hi,
    define in the report-definition a parameter (for example p_deptno). This results in an entry in the xdo-file:
    <parameter id="p_deptno"> ....
    Define the same parameter in the Data Template ....
         <parameters>
    <parameter name="p_deptno" datatype="number"/>
    </parameters>
    and use this parameter in your Query:
    <sqlStatement name="QueryDept">
    <![CDATA[SELECT DEPTNO,DNAME,LOC FROM DEPT WHERE DEPTNO = :p_depnto]]>
    </sqlStatement>
    Regards
    Rainer

  • How do I compare two columns of data in Numbers to find the unique results?

    Hello all,
    I'm looking for a way to compare the data from two columns so I can find the unique results and display that data in a third column. To be specific, here's what I'm doing.
    Column A is a list of email addresses for people I have already written. Column B is a list of email addresses for people I would like to contact. I am not sure if there are email address from Column A in Column B, but there may be and if there are, I must find out so that I don't send a second email to these recipients. How can I have Numbers look at both columns and tell me which email addresses in Column B are not in Column A?
    Thanks for the help!!!

    gfmp123,
    Here's an alternate use of MATCH to find duplicates. I hope you find one of the two solutions, Wayne's or this one, useful for your case.
    The expression in Column C is:
    =IFERROR("Dup in Row "&MATCH(B, A,0), "")
    Regards,
    Jerry

  • How do I display my columns, like "date added" in the new iTunes?

    I updated iTunes. I like to play the music I most recently added first. I had this all sorted into neat columns in the old iTunes and now I cannot seem to sort by "date added" or "date modified".

    If you don't see anything when you connect your ipod it's meybe something wrong with the USB cable, If you have another you can try that.
    try to shut down or restart your ipod and then connect it.

  • How to implement a table of ordered data ?

    This is surely a very common question of database design.
    Let us say that I am doing a web picture gallery, where I want the pictures to appear in a specific order. I am keeping the reference of the image files in a table, and I specifically want to be able to add a new picture between any two consecutive existing pictures. Nice to have would be a fast way to move a picture to another place, and support for concurrent access.
    After some tries, my best solution seemed to be something like the following, but I suspect that it is still sub-optimal :
    CREATE TABLE pics(
    picid NUMBER PRIMARY KEY,
    filename VARCHAR2(50),
    ordernum NUMBER(38,10) UNIQUE
    CREATE SEQUENCE pics_picid_seq;
    CREATE SEQUENCE pics_ordernum_seq;
    And I populate the table by using both sequences when I add the picture at the end of the list, or by calculating the ordernum as the average between the ordernums of the two pictures between which I want to insert the new picture (saying that the -1th picture has order 0).
    Two drawbacks of this implementation :
    - It looks like from two concurrent inserts at the same place, one will fail to the unique constraint.
    - If a very very large number of pics can be inserted or moved, I may have to create a trigger locking the table and recalculating the ordernums (well that is probably the case only for huge examples).
    So what is the best solution here if concurrency support is most important ? What if insert/update speed is most important ? What if "select order by" speed is most important ? Any other criteria ?

    I don't expect rows to be stored in any perticular order Ooops! early Monday morning misreading of your original post. My apologies.
    In your solution, isn't the full table update an issue when inserting pictures at place 1 ?Well , your solution will produce a duplicate ORDERNUM in that instance, or any other instance (hint, to make averaging work you'll need to store fractions).
    Yes, my eary monday morning solution may suffer poor performance if you have lots of pictures and you re-organise them a lot. It will produce prettier values for ORDERNUM, which may be helpful if you need to display it to users, but this is probably not sufficient to save my implementation.
    But if you are using averages of sequences it will be even more important to use a table API. The pictures in the twenty-fifth and twenty-sixth positions might have ORDERNUM values of 19.5 and 20 respectively or - sequence caching being what it is - 134 and 137. This may be hard for users to understand. You will need to translate offset from 1 into ORDERNUM (I guess by using ROWNUM, which is not without pitfalls).
    Will transactions ensure that the picture of user B won't get inserted one place before where it should ? Concurrency is a big issue. Potentially, any user inserting a single picture is affecting the whole collection. (There's also the situation where no new pictures get added but the entire collection is re-ordered). We could make an argument that the whole table ought to be locked before anything gets done. However, full table locks are usually undesirable.
    One way around this is to make the users specify the picture IDs they want the new picture to appear between, rather than place. This has the advantage of being independent of prior changes, unless the prior change also inserted a picture between 25 and 26, in which case it should fail.
    I suppose there probably is a canonical design solution out there, I hope someone else knows where to find it.
    Cheers, APC

  • How to implement 'Quick Select' column in a query result table?

    Hi,
    I have a requirement in OAF to design a search page with 'Quick select' column.
    One of the column in the query result table should be a quick select.
    Once user clicks on the quick select column, we have to navigate back to the previous page with the row value selected.
    Can anyone help me in this.
    Thanks.

    Also refer the search exercise in the toolbox tutorials.
    you can implement the quick search in the same way as update and delete buttons.
    --Prasanna                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • Does Apple TV work with Sony Grand WEGA TV

    I have a Sony Grand WEGA KDF42WE655 TV and would like to purchase Apple TV, but want to make sure it works with the TV first.  Does anyone have a TV like this and does Apple TV connect to it?  Thank you.

  • DTW - Journal Enrty Header- Fixed Exchage rate

    Hi Friends, The field "Fixed Exchange Rate" check box in JE. Is it POSSIBLE or NOT POSSIBLE  to update the value  OJDT (OrgCurr and TransRate) using the DTW. Regards, Rakesh N

  • Display Problem:  black stuff suddenly looks red

    Everything black (objects/graphics/print/cursor) suddenly has a "red tinge" to it. Black parts of graphics almost "glow red.." I don't remember changing any settings, but how can I get rid of the red and back to pure black with no red aura around it.

  • Strange behaviour in SET_REPORT_OBJECT_PROPERTY

    Hi, I need to run a report from a Form. The Report Parameter are stored in a table and with this parameters I want to set the report properties Now if I use this statement (this is an example): SET_REPORT_OBJECT_PROPERTY(rep_id, REPORT_DESFORMAT, MYT

  • Smartform Printing issue

    Hi All, I have created a smartform and when i try to print it prints in Landscape format, but the form Output has 'Portrait' format and uses DINA4 page format. I have verified my default printer settings and has a page format as 'Letter' , I have cha