Validation on the column to sum as a column <>100%

Dear friends

I have created table to use in query

Select

"ROWID",.

"REQUEST_ID",.

"CALL_FROM_DATE,"

"CALL_TO_DATE,"

"TOTEL_CALL,"

"FILTER_PER,"

"USER_CNT_SAMPEL_PER,"

'NET_SAMPEL_COLLECT '.

from 'EBA_SB_EXT_SURV_REQ_CR_02' where REQUEST_ID =: P325_REQUEST_ID

I must apply the validation on USER_CNT_SAMPEL_PER column, I need if the sum of USER_CNT_SAMPEL_PER is not equal to 100, it must be the msg of error display "percentage of the sample of the user should be 100%.

I used the Expression PLSQL

SUM(:USER_CNT_SAMPEL_PER) = 100

and the msg of error SUM OF USER_CNT_SAMPEL_PER NOT EQUAL to 100.

But it does not work.

How can I do this

Thank you

create before the process validation and Informatics

declare

l_tot number: = 0;

Start

because me in 1.apex_application.g_f05.count

loop

l_tot: = l_tot + nvl (to_number (apex_application.g_f05 (i)), 0);

end loop;

: P324_CNT: = l_tot;

end;

and create process\

324_cnt = 100

sum of the user sample shoulde be 100.

Tags: Database

Similar Questions

  • Validation of the column

    Hello

    Could someone give me an example simple creation of validation on the form of tables (APEX 4.1) on column (column names is 'INN') which checks all new column values to not repeat.

    Thanks yo.

    Check this one: http://deneskubicek.blogspot.com/2010/02/preventing-duplicate-entries-in-tabular.html

  • Calculate the sum of the columns

    Hello!

    Am using jdeveloper 11.1.2.1

    I created a table VO based EO. I need to calculate the sum of the column named price.

    I use the expression PoView.sum ("Price"). In this PoView is the name of VO and the price is the name of the column.

    While spin AMModule I got an exception like

    PoView name not found in the given object.

    Hello

    You must use the name accessor EO or VO instead of the name of VO.
    See https://blogs.oracle.com/adf/entry/using_groovy_aggregate_functions_in (there are even the same error message in one of the comments of this blog)

    concerning
    Peter

  • sum of the column tank

    Hello

    I have this example
    IMP_RIC 
    000020.50
    000020.50
    000020.50
    000001.55
    000020.50
    000020.50
    
    stored in a char column datatype
    
    when I do 
    
    SELECT COUNT(*) , SUM(TO_NUMBER (IMP_RIC ) /100) 
    INTO N_RICETTE    , NETTO_ASL
    FROM TRC_AMB_SAN;
    I get the error ORA-01722: invalid number

    I have to decode semicolon before running the query

    Thanks for any help

    Christian Merci it works

    Rosario, this solution really works that if you are sure that all the values are stored (now and in the future) in the field of tank using the nls configuration specific to 100%.

    If there is a small probability that in the future may change something better something like this:

    SQL> with TRC_AMB_SAN
      2  as
      3  (
      4  select '000020.50' IMP_RIC  from dual union all
      5  select '000020.50' from dual union all
      6  select '000020,50' from dual union all
      7  select '000001,55' from dual union all
      8  select '000020.50' from dual union all
      9  select '000020.50' from dual
     10  )
     11  SELECT COUNT(*) , SUM(to_number(replace(IMP_RIC,'.',','),
     12                        '9999999d9999',
     13                        'nls_numeric_characters=,.')/100) somma
     14    FROM TRC_AMB_SAN
     15  ;
    
      COUNT(*)      SOMMA
    ---------- ----------
             6     1.0405
    

    In any case, the fundamental problem is that you cannot store numbers in the fields tank, is there any chance to change the data type of the column?

    Max
    http://oracleitalia.WordPress.com

  • How is the sum total of the column of this PivotTable?

    Hi experts, I am trying to sum two columns, the column called 'Hombre' and the column named "Total."

    Display a picture to explain better.

    ! http://img11.imageshack.us/img11/2240/caekg.PNG!

    It's the pdf output:

    ! http://img38.imageshack.us/img38/4240/cae2.PNG!

    I tried to write in the name columns "Hombre".

    <? $c45 / / M0/M0/T? >

    because the column name 'Mujer' I read this

    <? $c45 / / M0/M1/T? >


    I Don t know what means this code, $c45 I know it is the call to the variable

    M0-M0-T, but I Don t understand it.

    Thank you

    I understand your ignorance on how it works.

    
    
    And use following in total,
    
     == Hombre
     == Mujer
    

    http://winrichman.blogspot.com/2009/10/sum-total-column-in-BIP-pivot-table.html

  • Shows the columns having / sum not zero

    We have a report that HAV total of twenty columns.

    Whenever we run you report (dynamic query) random columns have sum = zero

    We want to show only eachtime the columns having the amount greater than zero.

    concerning

    Jean Marc

    Hi John,.

    OK - I've tested this here [http://htmldb.oracle.com/pls/otn/f?p=267:43]. The report on the left shows/hides the SAL and COMM columns according to totals. The report on the right shows the complete data. Change the Dept to see this implemented.

    There are other methods available, but that's what I did:

    The select dept list (item name is P43_DEPTNO) is simply a list of departments and a NULL option that returns 0 (zero).

    This report is a SQL statement of:

    SELECT EMPNO, ENAME, SAL, COMM
    FROM EMP
    WHERE :P43_DEPTNO = 0 OR :P43_DEPTNO = DEPTNO
    ORDER BY ENAME
    

    I have a region in the position after the header that uses "No. Template" and contains two pieces of Hidden - P43_SAL and P43_COMM.

    I have a calculation of element, running "Before Header", which sets P43_DEPTNO to 0 if it is NULL.

    I have a PL/SQL unconditional process, "to charge - before Header", which has the following code to the currently running process:

    DECLARE
     vSAL NUMBER;
     vCOMM NUMBER;
    BEGIN
     SELECT NVL(SUM(SAL),0), NVL(SUM(COMM),0)
     INTO vSAL, vCOMM
     FROM EMP
     WHERE :P43_DEPTNO = 0 OR :P43_DEPTNO = DEPTNO;
     :P43_SAL := vSAL;
     :P43_COMM := vCOMM;
    END;
    

    And, finally, on the SAL column in the report, I put the Condition Type for 'value of element in the Expression 1. = zero' and the Expression 1 is: P43_SAL. And even on the COMM, but the Expression 1 column: P43_COMM

    When the page is loaded, the process is executed and SAL and COMM totals are calculated and inserted in P43_SAL and P43_COMM. The report runs and conditions check the values of these two hidden items - if a is not null, then the column is displayed.

    Andy

  • Using the column in the Merge of Oracle statement and column name not valid

    Hello

    I have the database table called ecp_blobdata with the following description of the table:
    OBID VARCHAR2(24),
    ZBINDATA LONG,
    ZLEN INTEGER
    I implemented the following statement from Oracle FUSION to refresh this table:
    MERGE INTO ecp_blobdata ecbl
    
          USING rnlht1m4.zbindb@TCPROD bin
          ON (ecbl.obid = bin.obid)
          WHEN MATCHED THEN
               UPDATE SET
                      ecbl.obid = bin.obid,
                      ecbl.zbindata = bin.zbindata,
                      ecbl.zlen = bin.zlen
          WHEN NOT MATCHED THEN
               INSERT VALUES(ecbl.obid, ecbl.zbindata, ecbl.zlen);
               COMMIT;
    However, I get the following error message when I try to compile the package:
    Compilation errors for PACKAGE BODY BHALLAR.DATA_REFRESH
    
    Error: PL/SQL: ORA-38101: Invalid column in the INSERT VALUES Clause: "ECBL"."OBID"
    Line: 13
    Text: MERGE INTO ecp_blobdata ecbl
    
    Error: PL/SQL: SQL Statement ignored
    Line: 13
    Text: MERGE INTO ecp_blobdata ecbl
    The column defintely exists, but I don't know why he keeps complaining with the same error message? It's to do with the help of column which is zbindata or something else that I might not be looking at?

    Thank you.

    G ' Day

    Your syntax is incorrect.

    In the list of VALUES, you should refer to your table in the source columns, alias 'bin '.

    That is to say, precise cause number error message in the documentation:
    Cause: INSERT fact VALUES clause references columns in the destination table

    SW

  • Report Total - how does one sum without numbers in the column?

    Hi all

    I have a (classic) report with columns that will display a 1 if a condition is true.
    I replaced the 1 with a cheque .png image and of course, the columns no longer summary.

    Is anyway to keep the images in place and have a total at the end?

    Thank you


    Chris

    You can use a solution as shown here:

    http://HTMLDB.Oracle.com/pls/OTN/f?p=31517:153

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • LOV custom: Validation of the input value

    Hello, I am new in the OPS. Recently I tried to create a custom lov (column in a table), in an existing standard page.

    I need to validate the value inserted by the user.

    Validation, when I press the standard record button, works very well, but only for the last line clicked from the table.

    I need the validation of the row of the table.

    I'll elencate my approach to create. What Miss me to do?

    Tree of customization:

    columnHeaderID (column)

    -> myLovID (Lov input Message)

    -->--> the mappings of Lov

    ->->-> xxmap1ID (LovMap)

    ->->-> xxmaphelpID (LovMap) (*)

    -> myFormValueID (Form, Value) (*)

    -> column heading

    -->--> sortable header: nome colonna

    The question, I added, to allow the standard validation (in green):

    part of criteria (*) = myLovID

    box item attribute of the value returned by lov lov = name

    article = myFormValueID return

    use for validation = Y

    (*) view attribute = attribute of vo in the page, because I need to insert the value

    view instance = vo in the page, because I need to insert the value

    Thank you

    J


    I'll answer by myself: for the validation of all rows with the lov, I had to add a new attribute to vo in the controller of the main page and then set the mode of myFormValueID to this created attribute attribute.

    So I got the full validation.

  • SQL or PL/SQL to display several links of BLOB in the column of the IR

    I have a need in an IR or a standard report to provide a link to view/download several BLOBs. Basically I have a function that, for a given record, will focus on a relational table and get a list of all the associated files and it has a list of output HTML. List the files is great, however, I would like to take a step further and actually have the names of files as a link to view/download the actual file. Reading the API on GET_BLOB_FILE_SRC it doesn't look like it can do what I want, because it requires a valid page for the file element, and I have 0 - x files associated with a row with a given number of lines per page.

    Basically, what I have is...

    Select

    some_pk

    some_data01

    some_data02

    custom_function_get_files (some_pk)

    my table

    order that either;

    It produces something similar to...

    PK Data 1 Data 2 List of files
    1SomethingSomething
    • File01.txt
    • File02.txt
    • File03.txt
    2Datadata
    • Image.PNG
    3xxxxxx(NULL)

    .. and so on.

    Of course, if I did only 1 file I can format the column of type BLOB and APEX type takes care of everything. Any ideas or suggestions?

    I know I could create a list of files as a link to another page, passing the key document and that the 'view' file using this page. Even if it's a little more messy.

    d3bruts1d wrote:

    I have a need in an IR or a standard report to provide a link to view/download several BLOBs. Basically I have a function that, for a given record, will focus on a relational table and get a list of all the associated files and it has a list of output HTML. List the files is great, however, I would like to take a step further and actually have the names of files as a link to view/download the actual file. Reading the API on GET_BLOB_FILE_SRC it doesn't look like it can do what I want, because it requires a valid page for the file element, and I have 0 - x files associated with a row with a given number of lines per page.

    apex_util.get_blob_file_srcis indeed what you are looking for. The parameter item page is simply a shortcut used to get information about the BLOB of metadata associated with items to upload files and ARF process used to load the images. If these elements do not exist because the images are not loaded in this way, simply add the upload queue and ARF process that would be used to do this to a page, the conditions never set on them so that they are not displayed or executed and reference the element in the apex_util.get_blob_file_src call.

    The list of files can be generated in the query using SQL/XML to eliminate the need for a custom function:

    select
        t.some_pk
      , t.some_data01
      , t.some_data02
      , xmlserialize(
            content
            xmlelement(
                "ul"
              , xmlagg(
                    xmlelement(
                        "li"
                      , xmlelement(
                            "a"
                          , xmlattribute(apex_util.get_blob_file_src('P1_FILE', t.some_pk, null, 'attachment') "href")
                          , f.some_filename))
                    order by f.some_filename))) file_list
    from
        my_table t
          left outer join my_files f
            on t.some_pk = f.some_fk
    group by
        t.some_pk
      , t.some_data01
      , t.some_data02
    
  • Sort sort the columns number of lines n columns in the RTF PivotTable but hide them.

    Hello

    I'm trying to sort on the columns number of sort for lines n columns in the PivotTable but hide them. Any help appreciated.

    Attached model RTF, XML and output required. Thank you

    Please check your email that I have forwarded to update the model.

    by default, it performs a sort on the column, we used to pivot rows and columns. If we need custom sort, we must specify that column in the logic that was present in the C form field.

    by default, you are as below

    Custom sort

    {INDUSTRY_sort, o = a, t = n} « ; » MONTHS {Month_sort, o = a, t = n} '; SALES '; "' sum '? >

  • need to update the value of the column automatically (exists and the new value)

    Hello

    (1) I Segment1, Segment2, Segment3, Segment4, item_status (new column modified in the Temp table)

    Must update the form OFA and the DB Temp table item_status value in the column when I click APPLY to SAVE the Inserted records in the DB table and form and must register the mtl_system_items_b Segment1, Segment2, Segment3, Segment4 in which the condition

    Note: need to update automatically item_status for existing and new inserted records in the Table and the form

     Serializable[] param = {Segment1, Segment2, Segment3, Segment4
                       };
                       am.invokeMethod("InsertRecord", param);
                       row.setAttribute("SelectFlag", "N");
    

    Thank you

    Renon,

    When you write code, try to understand what makes each line. (If you don't understand all the lines, feel free to ask)

    row.setAttribute ("ItemStatus", row.getAttribute ("ItemStatus"));

    What do you think that the above line done? You try to get the value of the attribute and trying to put the same value. How is it, that will have an impact?

    You need to do 2 things.

    1. change the insertRecord method and the State of return of this method.

    Change the definition of the function:

    public String InsertRecord (String itemstyle, String itemcust, String itemsize, String itemcolor, String ordrno,

    String desc)

    Add a return statement at the end after validation.

    TR.Commit ();

    return the situation;

    }

    2 accept that status in CO and set the value to the attribute details VO.

    String status = (String)am.invokeMethod ("InsertRecord", param);

    row.setAttribute ("ItemStatus",status);

    I hope this helps.

    See you soon

    AJ

  • To get the name of the table the column

    Hi I have an Html5 app, and I get the dataset from the database and bind the data based on the column name. but the answer of the oracle db column names as attr_1, attr_2 and so on. Here is the code and the result after execution.

    create or replace PACKAGE SAYAM
    IS
           CURSOR cur
           IS
                  SELECT CAST(0 AS NUMBER(5, 0)) "COMPID" ,
                         CAST(0 AS NUMBER(4, 0)) "FINYEARID" ,
                         EMPLOYEEID,
                         CAST(0 AS NUMBER(5, 0))"MENUID" ,
                         CAST('' AS NVARCHAR2(10))"CALLBYPANEL",
                         EmployeeName
                  FROM  EmployeeInfo;
                 
    Type cur_tbl
    IS
           TABLE OF cur%rowtype;
          
    END SAYAM;
    
    

    DECLARE
           v_GlobalParam Xmltype:=Xmltype(
           '<QueryParam> 
    <CompID>1</CompID> 
    <FinYearID>1</FinYearID> 
    <MenuID>0</MenuID> 
    <EmployeeID>-1</EmployeeID> 
    <CallByPanel>APPWEB</CallByPanel>
    <EmployeeName>Ranjit</EmployeeName>
    </QueryParam>'
           );
           tableglobal SAYAM.cur_tbl;
           rc sys_refcursor;
    BEGIN
           SELECT XT.CompID,
                  XT.FinYearID,
                  XT.MenuID,
                  XT.EmployeeID,
                  XT.CallByPanel,
                  XT.EmployeName bulk collect
           INTO   tableglobal
           FROM   XMLTABLE('/QueryParam' PASSING v_GlobalParam COLUMNS
                  CompID NUMBER(5) PATH 'CompID' ,
                  FinYearID NUMBER(4) PATH 'FinYearID' ,
                  MenuID NUMBER(5) PATH 'MenuID' ,
                  EmployeeID NUMBER(5) PATH 'EmployeeID' ,
                  CallByPanel VARCHAR2(10) PATH 'CallByPanel',
                  EmployeeName Varchar2(200) Path 'EmployeeName' ) XT;
           OPEN rc FOR SELECT * FROM TABLE(tableglobal);
           SYS.DBMS_SQL.RETURN_RESULT(rc);
    END;
    
    
    

    Now, I get the below result-

    Capture.PNG

    but the goal that is required is as below with the valid column name

    Capture.PNG

    Please let me know if there is any action to get the column names.

    Thanks in advance.

    Apologies - I have managed to reproduce the original problem in 12.1.0.2.

    The problem with ATTR column names is that you use a local collection declared in a package.

    You need a SQL type.

    But does not change my position when it comes to a sensible direction to go.

    SQL> l
      1  create or replace type sayam_obj as object
      2  (compid      number(5,0)
      3  ,finyearid    number(4,0)
      4  ,employeeid  number
      5  ,menuid      number(5,0)
      6  ,callbypanel  nvarchar2(10)
      7* ,employeename varchar2(100));
    SQL> /
    
    Type created.
    
    SQL> create or replace type sayam_tbl as table of sayam_obj;
      2  /
    
    Type created.
    
    SQL> get test3.sql
      1    DECLARE
      2        v_GlobalParam Xmltype:=Xmltype(
      3        '
      4    1
      5    1
      6    0
      7    -1
      8    APPWEB
      9    Ranjit
    10    '
    11        );
    12        tableglobal sayam_tbl := sayam_tbl();
    13        rc sys_refcursor;
    14    BEGIN
    15        SELECT sayam_obj(XT.CompID,
    16              XT.FinYearID,
    17              XT.MenuID,
    18              XT.EmployeeID,
    19              XT.CallByPanel,
    20              XT.EmployeeName) bulk collect
    21        INTO  tableglobal
    22        FROM  XMLTABLE('/QueryParam' PASSING v_GlobalParam COLUMNS
    23              CompID NUMBER(5) PATH 'CompID' ,
    24              FinYearID NUMBER(4) PATH 'FinYearID' ,
    25              MenuID NUMBER(5) PATH 'MenuID' ,
    26              EmployeeID NUMBER(5) PATH 'EmployeeID' ,
    27              CallByPanel VARCHAR2(10) PATH 'CallByPanel',
    28              EmployeeName Varchar2(200) Path 'EmployeeName' ) XT;
    29        OPEN rc FOR SELECT * FROM TABLE(tableglobal);
    30        SYS.DBMS_SQL.RETURN_RESULT(rc);
    31*    END;
    SQL> @test3.sql
    
    PL/SQL procedure successfully completed.
    
    ResultSet #1
    
        COMPID  FINYEARID EMPLOYEEID    MENUID CALLBYPANE
    ---------- ---------- ---------- ---------- ----------
    EMPLOYEENAME
    --------------------------------------------------------------------------------
        1        1          0    -1 APPWEB
    Ranjit
    
  • retrieve the value column access via the variable name of the column

    I need to build a function of validation with this condition:

    The data model is like this:

    We have an array of items_general, with its id and data.

    Then we have specific tables, let's say... item_especific1, item_especific2 item_especificn. They have the same as the table of the item_general pk and fk against item_general

    Each element is in one of the tables item_specific and items_general.


    Now, the validation feature: I need to check for an element, if some special columns of the item_especificx table are null and will raise an error if this occurs.

    I got the name of especific_table and the list of names of particular column stored in another table.


    I guess I can browse this list of column table to build a clause concatening Dynamics 'and' | column_name | 'is nothing', but I'm not a big fan of the dynamic sql.


    Can you think of a better solution? Any way to access the value of the column by using the column name, as if it were a varchar2 key index?




    Nope, no filter.

    When you have a funky data like that model, you're destined to dynamic sql and other assortment of headaches.

  • How to avoid the total general of the classic report when the column break is installed in the Apex

    Hi all

    I develop application using Oracle Apex 4.2.0.

    I created the classic report Page.

    That I have summarized a column by selecting the check box check sum for the column.

    His shows the Grand Total.

    Then I chose the columns to break to the first column.

    His show the total groupwise and total as well as great as image below.

    dc.jpg

    My requirement is

    Need to hide total(Total:)) GroupWise or total general. I need to show any a total, not both.

    How to do this?

    Thank you

    Su.GI

    Su.GI wrote:

    Hi, thanks for your response.

    I use theme - productivity Application - issue 26

    -Standard model

    Report - report of Standart for classic report model.

    The above CSS code where I want to use in the page or report or model region.

    Specify a static region ID for the report area and put the following CSS rule in the CSS Inline property page:

    #static-region-id .uReportStandard tr:last-child td {
      display: none;
    }
    

    where static-region-id is the ID specified for the region.

Maybe you are looking for