A better way to treat the form as a table with the variable column type?

I wanted to make a column to return according to the status of a flag column as readonly. I have a column defined as follows in the report query.

Decode (sys_flag, 'Y', APEX_ITEM. DISPLAY_AND_SAVE 3, TYPE_CODE, APEX_ITEM. SELECT_LIST_FROM_LOV (3, TYPE_CODE, 'LOV_TYPE_CODE_LOV')) AS TYPE_CODE

To get the SRM process noting that column, I had to put this 'band of HTML code' to 'No', then the column attributes, I put:
"Expression HTML" to "#TYPE_CODE #
' Display under "to"text display (saves the State).

And then it took me to get new lines of work:
"Default of Type" to "Expression of PL/SQL.
'Default' to APEX_ITEM. SELECT_LIST_FROM_LOV (3, NVL(:P18_TYPE_CODE,'LOV_TYPE'), NULL, 'LOV_TYPE_CODE_LOV', ' NO')

This makes large, however submit that it seems that the checksum of line used by MRU included the raw HTML generated by the APEX_ITEM package and not just the value of the column. I worked around this by including an element hidden checksum and creating a process that replaces the checksum generated automatically with my custom.

Is there a better way to intercept this checksum, preferably before it is rendered on the page? I now hide the sum of hidden HTML control in the output HTML of another column, so it's a bit ugly. If not, is there an easier way to achieve what I'm looking for? I tried several combinations, and it seems to work better. It's just a shame there's no way to have a standard hidden column included in the SRM process.

Hello

I tried different possibilities and seems to run the following:

Create a report questioning in NORMAL SQL function to help:

SELECT
APEX_ITEM.HIDDEN(1,EMPNO) || APEX_ITEM.TEXT(2,ENAME) ename,
CASE WHEN DEPTNO = 10 THEN
 APEX_ITEM.HIDDEN(3, SAL) || SAL
ELSE
 APEX_ITEM.TEXT(3, SAL)
END SAL,
EMPNO,
DEPTNO || APEX_ITEM.MD5_CHECKSUM(ENAME, SAL) DETPNO
FROM EMP

Do not specify something special for column definitions.

Create a button that submits the page.

Create a PL/SQL process that runs "On submit - after calculations" and Validations, triggered by this button and using the following code:

BEGIN
APEX_ITEM.MULTI_ROW_UPDATE('#OWNER#:EMP:EMPNO,1:,|ENAME,2:SAL,3');
END;

I've done here: http://htmldb.oracle.com/pls/otn/f?p=55041:35

Any element with the value of DEPTNO 10 has the value SAL, read-only, as otherwise it's editable. This is done by creating a hidden input field for the actual value, followed by the text version OR by creating a single entry field. This ensures that we have the correct number of SAL elements on the page.

APEX_ITEM. MULTI_ROW_UPDATE is the "manual" version of the MRU that you would normally get with a form of table and works for above normal as sql based query reports. The format of this very strict is that you must always allow for two primary keys. See the text of presentation here: http://download.oracle.com/docs/cd/B28359_01/appdev.111/b32258/api.htm#CHDFDACC

Andy

Tags: Database

Similar Questions

  • Is there a better way to remove the toolbar "Frequently used tools" (which I've never used!) to open whenever I open Acrobat reader. rather than uninstall Acrobat and use another PDF reader?

    Is there a better way to eliminate the "frequently used tools.
    toolbar (which I've never used!) to open whenever I open Acrobat
    drive. rather than uninstall Acrobat and use another PDF reader?

    Hi jg49392310,

    You can disable the tool pane with Adobe Acrobat Reader DC was last updated, see this note cover hide the tools Panel in Acrobat and Acrobat Reader DC at all times.

    Kind regards

    Nicos

  • Looking for a better way to count the responses to the survey questions

    Hello all - I have created a survey for a site and now want to display the results to the admins of the site. I am trying to display the countdown - the number of times that a question has been answered in a certain way. I realize that I may need to build the investigation itself differently and how it stores data, but here is how it goes far.

    There are 10 questions, each with 4 options of radio button groups. The database table contains a column for each issue and stores the value of the selected option button. So it's pretty simple.

    Now on the results page, that it's the only way I can think to do, but there must be a better way. For each answer, I create a Recordset filtered on the issue and the value option, then display the total number of records. Which works great, but count each option, which means that 40 recordsets on the page - al simply determine "how many times was the Question 1, Option was selected and how many times has the Question 1, selected Option B and so on.»

    The only other thing I can think it maybe is a better way to count the occurrences of these values in the table is with PHP or in the SQL itself.  Or, perhaps, if the values themselves are entirely digital and follow a kind of model I can use a solution of math.

    Thoughts, solutions, and ideas are welcome!  Thank you.

    Your problem is a bad design. You should have a separate line for each answer, not to separate the columns. It also makes the very rigid investigation. A simple design would include a few tables - a master of the investigation that stores the questions and response table that contains a foreign key to the question number in the master, the answer, as well as any other details you need to capture. You might get more elaborate, but it's essential. Your result page and then just be a single recordset with a simple query with a group by clause.

    I urge you to review this before going any further.

  • Is there a better way to make the selection on this slider?

    Is there a better way to make the selection on this slider?
    I need to retrieve the test scores max (tesc_code SO1, S02, S03 etc... etc...)
    I get the results presented here, but I wonder if it's a better way to do this.
    The results should be back in the same cursor... e
    CURSOR c_sortest_SAT_scores(p_pidm IN saturn.sortest.sortest_pidm%TYPE,
    p_term in saradap.saradap_term_code_entry%TYPE)
    IS
    SELECT   s01.sortest_pidm       pidm_s01,
             s01.sortest_tesc_code  tesc_code_s01,
             s01.sortest_test_score score_s01,
             s02.sortest_pidm       pidm_s02,
             s02.sortest_tesc_code  tesc_code_s02,
             s02.sortest_test_score score_s02,
             s07.sortest_pidm       pidm_s07,
             s07.sortest_tesc_code  tesc_code_s07,
             s07.sortest_test_score score_s07,
             s08.sortest_pidm        pidm_s08,
             s08.sortest_tesc_code   tesc_code_s08,
             s08.sortest_test_score score_s08,
             s09.sortest_pidm        pidm_s09,
             s09.sortest_tesc_code   tesc_code_s09,
             s09.sortest_test_score  score_s09
      FROM   saturn.sortest s01,
             saturn.sortest s02,
             saturn.sortest s07,
             saturn.sortest s08,
             saturn.sortest s09
     WHERE       s01.sortest_tesc_code IN ('S01')
             AND s01.sortest_pidm = p_pidm
             AND s01.sortest_term_code_entry = p_term
             AND s01.sortest_test_score =
                   (SELECT   MAX (s01a.sortest_test_score)
                      FROM   saturn.sortest s01a
                     WHERE   S01.sortest_pidm = s01a.sortest_pidm
                             AND S01A.sortest_tesc_code IN ('S01'))
             AND s02.sortest_tesc_code IN ('S02')
             AND s02.sortest_pidm = p_pidm
             AND s02.sortest_term_code_entry = p_term
             AND s02.sortest_test_score =
                   (SELECT   MAX (S02A.sortest_test_score)
                      FROM   saturn.sortest s02a
                     WHERE   S02.sortest_pidm = s02a.sortest_pidm
                             AND S02A.sortest_tesc_code IN ('S02'))
             AND s07.sortest_tesc_code IN ('S07')
             AND s07.sortest_pidm = p_pidm 
             AND s07.sortest_term_code_entry = p_term
             AND s07.sortest_test_score =
                   (SELECT   MAX (S07A.sortest_test_score)
                      FROM   saturn.sortest S07A
                     WHERE   S07.sortest_pidm = S07A.sortest_pidm
                             AND S07A.sortest_tesc_code IN ('S07'))
             AND S08.sortest_tesc_code IN ('S08')
             AND S08.sortest_pidm = p_pidm 
             AND S08.sortest_term_code_entry = p_term
             AND S08.sortest_test_score =
                   (SELECT   MAX (S08A.sortest_test_score)
                      FROM   saturn.sortest S08A
                     WHERE   S08.sortest_pidm = S08A.sortest_pidm
                             AND S08A.sortest_tesc_code IN ('S08'))
                     AND S09.sortest_tesc_code IN ('S09')
             AND S09.sortest_pidm = p_pidm 
             AND S09.sortest_term_code_entry = p_term
             AND S09.sortest_test_score =
                   (SELECT   MAX (S09A.sortest_test_score)
                      FROM   saturn.sortest S09A
                     WHERE   S09.sortest_pidm = S09A.sortest_pidm
                             AND S09A.sortest_tesc_code IN ('S09'));

    Hello

    The problem is that you to act as a Cartesian product with all the tables (you will get: S01 * S02 * S08 * S09 lines!) Is it really what you want?
    I don't think...

    Wharton, you can do (with no Cartesian product) is:

    CURSOR c_sortest_SAT_scores(p_pidm IN saturn.sortest.sortest_pidm%TYPE,
    p_term in saradap.saradap_term_code_entry%TYPE)
    IS
    SELECT sortest_pidm pidm, sortest_tesc_code tesc_code,
           sortest_test_score score
      FROM sortest
     WHERE (sortest_tesc_code, sortest_test_score) IN (
              SELECT   sortest_tesc_code, MAX (sortest_test_score)
                  FROM sortest
                 WHERE sortest_tesc_code IN ('S01', 'S02', 'S07', 'S08', 'S09')
                   AND sortest_pidm = :p_pidm
                   AND sortest_term_code_entry = :p_term
              GROUP BY sortest_tesc_code)
       AND sortest_pidm = :p_pidm
       AND sortest_term_code_entry = :p_term
    

    However you absolutely need a Cartesian product, you can do:

    WITH allrows AS
         (SELECT sortest_pidm pidm, sortest_tesc_code tesc_code,
                 sortest_test_score score
            FROM sortest
           WHERE (sortest_tesc_code, sortest_test_score) IN (
                    SELECT   sortest_tesc_code, MAX (sortest_test_score)
                        FROM sortest
                       WHERE sortest_tesc_code IN
                                              ('S01', 'S02', 'S07', 'S08', 'S09')
                         AND sortest_pidm = :p_pidm
                         AND sortest_term_code_entry = :p_term
                    GROUP BY sortest_tesc_code)
             AND sortest_pidm = :p_pidm
             AND sortest_term_code_entry = :p_term)
    SELECT s01.pidm pidm_s01, s01.tesc_code tesc_code_s01, s01.score score_s01,
           s02.pidm pidm_s02, s02.tesc_code tesc_code_s02, s02.score score_s02,
           s07.pidm pidm_s07, s07.tesc_code tesc_code_s07, s07.score score_s07,
           s08.pidm pidm_s08, s08.tesc_code tesc_code_s08, s08.score score_s08,
           s09.pidm pidm_s09, s09.tesc_code tesc_code_s09, s09.score score_s09
      FROM allrows s01, allrows s02, allrows s07, allrows s08, allrows s09
     WHERE s01.tesc_code = 'S01'
       AND s02.tesc_code = 'S02'
       AND s07.tesc_code = 'S07'
       AND s08.tesc_code = 'S08'
       AND s09.tesc_code = 'S09'
    

    The lines will be stored in memory to a temporary table before that product happen (should be faster)...

  • Form on a Table with report - Auto number

    Hello

    Scenario:
    I want to create 'Form on a table with report' which would allow my users add records...

    Steps and questions
    I have created a table with a field named "TRACKING_NO" as a type of automatic numbering in MS Access and there is a primary key... I intended to use it to link the report to the form
    When I downloaded the array to Oracle, it changed the varchar2 type... can you please advice how to change back to automatic numbering...?
    and it'll work if my user adds a record to the table (using APEX built in option to create a record)...?

    Thanks in advance

    Hello
    That's what I'd do.
    1. download the MS Access table, lets call it TAB_A
    2. using SQL-workshop get the DDL (SQL statement) for this table.
    3. change names or data types as required
    4. create a new table with the DOF, lets call it TAB_O
    5 copy the contents of TAB_A to TAB_O (TAB_O IN INSERT for example (id, colx, coly) SELECT TO_NUMBER (tracking_no), col1, col2 FROM TAB_A ;))
    6. create a sequence that begins with the last PK + 1 table TAB_A
    7 Add a trigger to TAB_O to use this sequence to fill his PK

    Furthermore, work with APEX requires a good understanding of the Oracle SQL and PL/SQL, no matter what anyone says, even Oracle.

    Regards Garry

  • Is it possible the reel with the variable column size?

    Hi, I'm queue to a CSV file with the following script (the SELECT real is different but similar, Oracle 10.2.0.3.0):
    SET COLSEP ';'
    SET FEEDBACK OFF
    SET LINESIZE 2000
    SET PAGESIZE 0
    SET TERMOUT OFF
    SET TRIMSPOOL ON
    SET VERIFY OFF
    
    SPOOL test.csv REPLACE
    
    SELECT 'COLUMN1', 'COLUMN2', 'COLUMN3' FROM dual UNION ALL
    SELECT 'value1', NULL, NULL FROM dual UNION ALL
    SELECT 'value2', NULL, NULL FROM dual;
    
    SPOOL OFF
    
    EXIT SUCCESS COMMIT
    Which produces the following output:
    COLUMN1;COLUMN2;COLUMN3
    value1 ;       ;
    value2 ;       ;
    Is it possible to get the following with the variable column size result
    COLUMN1;COLUMN2;COLUMN3
    value1;;
    value2;;
    I tried SET NULL "but I see no difference. Thanks in advance!

    Markus

    Hello

    SQL * Plus you button the output so that each column has a fixed length, which is exactly what you don't want.

    To get around this, concatenate all your data in a column VARCHAR2 fat with delimiters.

    For example, instead of

    SELECT    empno
    ,       ename
    ,       hiredate
    FROM       scott.emp
    ;
    

    Do something like

    SELECT    empno
    || ';' || ename
    || ';' || TO_CHAR (hiredate, 'DD-Mon-YYYY')
    FROM       scott.emp
    ;
    
  • Is there a better way to generate the custom timed digital signals

    I'm trying to generate the digital output from the top and down with delays on different lines. Each daq assistant is activate single line on a port USB 6501. There more complex high and lows that I need to generate variable time difference between high and low. There is codebelow that does what I'm trying to achieve, but for a model executing high and low signal is much of your time to do it this way. I'm sure there is a better way to do it, I'm not an expert on labview so I only discovered its potential. Anyone can suggest a more effective and a quick way to do it. I would like to hgihly appreciate. Thank you!

    I've not shown in the code below, but using the DAQ assistant, I initialized lines at low logic level.


  • A better way to rearrange the sort in Pivot mode?

    Hello
    First question - is there a better way to do it?

    Background - have a simple pivot w / requirements to the Status column so that logic to not alphabetical company.
    Example, # Service req with status should be listed as affected, accepted, completed, closed, re-assigned.

    My solution has been to create a column iin table view, use a CASE to say one time statement accepted = 1, etc.. I then sorted CSA, hidden column in a table view and then rotate view I added the status column and hid the new CASE column. I get the results that I expected, but I was wondering if there was a better way to do it?

    Thanks - years

    As far as the presentation layer is concernd (i.e., in the responses) your way is the best I can think of. The only way you can sort a list of values outside the way that the system can determine automatically (for example, in alphabetical, chronological, order numerically, etc.) is to create your own definition. Without human intervention or custom rules, there is no way any system know that 'C' must come before the "S" (as in "Assigned" and "Accepted" or "O" should come before the 'L' as in 'Complete' and 'Closed').

    Because the system knows how to order numbers (e.g., 1,2,3, etc.), it makes sense to create your 'rule' (using your CASE statement) to assign each level of the State to 'correct' number in the sequence.

    That's what I'd do. The only addition I can add is that you can do to the RPD by adding a column 'command' to your table LOVs and expose that as a column in the presentation layer. Then you can use this column in sort order.

  • Best way to reach the 2 columns of table A of the same column in the Table B?

    Hello

    It is a simplified example of the query, I am writing.

    I have two tables - PIPELINE (which includes the CREDIT_RECEIVER and CREATOR columns) and EMPLOYEES (including E-MAIL and LOB columns).

    I want to write a query that joins the PIPELINE. CREDIT_RECEIVER with EMPLOYEES. E-MAIL to return the LOB as 'CREDIT_RECEIVER_LOB '.

    I also want this query to join PIPELINE. CREATOR of EMPLOYEES. E-MAIL to return the LOB as 'CREATOR_LOB '.

    Currently, I do a left outer join on EMPLOYEES. EMAIL = PIPELINE. CREDIT_RECEIVER to get the "CREDIT_RECEIVER_LOB" and by calling a function GET_LOB (PIPELINE. CREATOR) (as defined below) to get the "CREATOR_LOB".

    Query:

    Select PIPELINE.ID as ID,

    PIPELINE. CREDIT_RECEIVER as CREDIT_RECEIVER,

    PIPELINE. CREATOR as a CREATOR,

    EMPLOYEES. LOB as CREDIT_RECEIVER_LOB,

    GET_LOB (PIPELINE. CREATOR) as CREATOR_LOB

    PIPELINE

    JOIN EXTERNAL LEFT ON PIPELINE EMPLOYEES. CREDIT_RECEIVER = EMPLOYEES. E-mail

    Is there a better way to write this query? This request is so slow it will usually expire on me.



    Thank you


    Forrest

    Definition of GET_LOB

    create or replace function "GET_LOB"

    ()vemail in VARCHAR2()

    return VARCHAR2

    is

    Start

    DECLARE vlog VARCHAR2 (30) ;

    BEGIN

    SELECT LOB IN vlog DE EMPLOYEES E-mail = Vemail ;

    return vlog ;

    END ;

    end ;

    Select PIPELINE.ID as ID,

    PIPELINE. CREDIT_RECEIVER as CREDIT_RECEIVER,

    PIPELINE. CREATOR as a CREATOR,

    E1. LOB as CREDIT_RECEIVER_LOB,

    E2. LOB as CREATOR_LOB

    PIPELINE

    LEFT OUTER JOIN EMPLOYEES E1

    WE PIPELINE. CREDIT_RECEIVER = EMPLOYEES. E-mail

    LEFT OUTER JOIN EMPLOYEES E2

    WE PIPELINE. CREATOR = EMPLOYEES. E-mail

    ----

    Ramin Hashimzade

  • Form on a Table with report - change of the source table after created form

    Hi all

    I have a 'form on a Table' where the various fields have the "Source Type" = "column of the database. I have 2 Questions for this type of shape:

    1: in the field "Source value or expression", it is possible to change the name of the field in the Table. But I can't understand how view or even change the underlying Table (which had to be chosen at the beginning, when the form was created at the start).

    2: my question in section that relates to the first question would be, if it is possible to have multiple underlying tables in the same region. Or whether it would be necessary to create a second region or change the "Column of the database" type in a type of SQL query?

    Thank you and best regards,

    David

    To change the table, you need to change the process of the page. A process has been generated called:

    Extraction of line of

    Here, you can modify the table, but you also have to make in your shipment after processes. Who are probably named:

    ApplyMRD and ApplyMRU

    If you want a form to be based on more than one table, you can create a view and base your form on this point of view instead of on the table, or you need customized treatment.

  • Filters in the way different on the same column

    http://img848.imageshack.us/i/screenshotwjk.PNG/

    If you take a look at the screen at the time there is view pivot that has about 10 columns one of them is the type of scene that always contains two values Foster Care child and current CPS, my requirement is if I click on the month column values if the month value is in the category Foster Care child, then he must pass three id filters , id of the person and if she has the current CPS then it must pass two filters case id and month is it possible if say me. I will be very happy if you can help out me.

    Thank you

    Already answered.

    Filters in the way different in the same report

  • How to create a form on a table with 3 columns for a PK

    Hi all

    We have a table that has 3 columns that make up the primary key and I want to create a form based on this table; Let us on the 'create form Page' it is only 2 options that identifies the first and second columns of PK.

    Is there a way I could add the third column PK.

    Kind regards
    Mel

    Mel:

    I don't think you can use the form wizard to create the form for you in this case. You can create the form manually or modify the table to have a new column that will act as a substitute PK for the table. This column can be filled from a sequence and must have a Unique key limited defined against it.

    CITY

  • If it is possible to pass the variable of type table in sceduler.

    Hello

    need to schedule a task to call a procedure but procedure a array as a parameter.

    Let me know we can pass the type of object as a parameter in the Scheduler.

    procedure definition: procedure (number, varchar2, ch. pakage.table_type b)

    I don't think that you can do with a PL/SQL type in a package, but you can do it with a SQL type, as shown below.

    Scott@orcl12c > test_tab CREATE TABLE

    2 (col1 NUMBER,

    VARCHAR2 (30) 3 col2.

    col3 4 VARCHAR2 (30))

    5.

    Table created.

    Scott@orcl12c > CREATE or REPLACE TYPE table_type AS TABLE OF VARCHAR2 (30);

    2.

    Type of creation.

    Scott@orcl12c > test_proc CREATE OR REPLACE PROCEDURE

    2 (a NUMBER;

    3B VARCHAR2,

    4 c. table_type)

    5 AS

    6 BEGIN

    7 BECAUSE I have 1... c.COUNT LOOP

    8 INSERT INTO test_tab (col1, col2, col3) VALUES (a, b, c (i));

    9 END OF THE LOOP;

    10 END test_proc;

    11.

    Created procedure.

    Scott@orcl12c > SHOW ERRORS

    No errors.

    Scott@orcl12c > START

    2 DBMS_SCHEDULER. CREATE_JOB

    3 (job_name-online 'test_job',

    job_type 4-online "procedure_stockee."

    5 job_action-online 'test_proc. "

    6 number_of_arguments-online 3);

    7 DBMS_SCHEDULER. SET_JOB_ARGUMENT_VALUE

    8 (job_name-online 'test_job',

    argument_position 9-online 1.

    argument_value 10-10 online);

    11 DBMS_SCHEDULER. SET_JOB_ARGUMENT_VALUE

    12 (job_name-online 'test_job',

    13 argument_position-online 2

    14 argument_value-online 'test');

    15 DBMS_SCHEDULER. SET_JOB_ANYDATA_VALUE

    16 ("test_job", 3, sys.anydata.convertCollection (table_type ("Oracle", "database")));

    17 DBMS_SCHEDULER. SELECT ("test_job");

    18 END;

    19.

    PL/SQL procedure successfully completed.

    Scott@orcl12c > DBMS_LOCK EXEC. SLEEP (5)

    PL/SQL procedure successfully completed.

    Scott@orcl12c > SELECT * FROM test_tab

    2.

    COL1 COL2 COL3

    ---------- ------------------------------ ------------------------------

    10 test Oracle

    test 10 database

    2 selected lines.

  • How to check the account of a column value is less than the other value of column in a table with a single column

    Hello

    Please let me know how to query the table and get the records that are less than the other column.

    ID item_id item_type

    3     1           r1

    2 4 r2

    1 5 r3

    6 5 r4

    I need to get all the lines in which item_id < id

    o/p

    ID item_id item_type

    3     1           r1

    6 5 r4

    SELECT ID, ITEM_ID, ITEM_TYPE

    Of

    WHERE ITEM_ID<>

  • bind the variable column of v$ sqlarea

    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for HPUX: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    select to_char(sql_fulltext), bind_data from v$sqlarea where sql_id = '5fwm73ndv5pjp';
    TO_CHAR(SQL_FULLTEXT)                    BIND_DATA
    select vgal.GAFS_DISPLAY_LINE_CD
    from view_gafs_account_line vgal
     where vgal.ACCOUNT_ID =  :p1 and
     vgal.ACCOUNT_LINE_SEQ_CD =  :p2 and 
    vgal.ACCOUNT_TYPE_ID =  :p3 and 
    vgal.PROGRAM_SUMMARY_ID =  :p4     
    I'm not horribly v$ sqlarea. but there were some questions about the application executes a query and get
    no row is returned.

    I find the query in v$ sqlarea but I would like to know what are bind variables, but this column is null.

    This means that the query has been run with null for all bind variables?
    or bind variables not seized for any reason are any?

    v$ sql_bind_capture I bind the value of the variable

    SELECT
       a.sql_text,
       b.name,
       b.position,
       b.datatype_string,
       b.value_string
    FROM
    
      v$sql_bind_capture b,
    
      v$sqlarea          a
    
    WHERE
    
       b.sql_id = 'dpf3w96us2797'
    
    AND
       b.sql_id = a.sql_id;
    

Maybe you are looking for