function returning the text validation error

Hello

I have a page where I can insert/update user, organization, responsible.
Organization can be nullable.

A single user can both be responsible for an organization.

To check this responsible for validation, I made a function that returns the error of validation of text as follows:

BEGIN
FOR c IN (SELECT usr_spa
OF kpi_users
WHERE usr_org_id =: p22_usr_org_id
)
LOOP
IF upper(:p22_usr_spa) = upper('YES') and upper (c.usr_spa) = upper('YES')
THEN
RETURN 'user is already responsible for this organization' |'. ' ;
END IF;

END LOOP;

END;

The validation works fine.

But it won't when I want to insert a new user, without attributing it to an organization.
I get the following message:

ORA-01722: invalid number

Cannot run the validation of the "body of the function return text' ERR-1024.

Can someone please help me solve this problem?

Thank you

Hello

The user selects a body in a select list? If the default value is considered "null %"? If so, you could modify the test to the IF: P22_USR_ORG_ID <>'% "| 'null %' THEN

Andy

Tags: Database

Similar Questions

  • VALIDATION - function returns the error text

    I have a domain that occurs on about 12 pages, I need to post this field with some code

    I created a function on the database that performs this validation, I pass the field value to the function and it returns some text of error, or NULL if the value is correct

    I can't for the life of figure me out how to call the function of APEX

    I've tried everything

    FUNCTION RETURN ERROR TEXT, Expression SQL, PL/SQL Expression... nothing works!

    to call the function my comand is

    FN_VALIDATE_HR1_REF (: P1_GCI,: P1_HR1_REF);

    I want to return the error on the function text and display it in the banner of APEX error

    any help greatly appreciated

    A function like this return error text should work:

    Return (FN_VALIDATE_HR1_REF (: P1_GCI,: P1_HR1_REF));

    Is giving the error?

  • PLSQL text validation error return function

    Hello

    I use the PLSQL text validation error return function

    that works fine

    DECLARE

    v_error varchar (1000);

    BEGIN

    IF condition = 1 THEN

    v_error: =' < span style = "color: red;" make-weight: bold; ' > You can not update dates you are not allow to update the dates </span > ';

    END IF;

    Return v_error;

    END;

    can someone tell what I can use APEX to display the v_error message in one line on the region of html

    as I use displayed element so it is wrapping the text

    Selection_004.png

    Selection_005.png

    Hi ReemaPuri,

    Change the settings for the grid of the element of error message (which is only point display) from the rest of the elements in the region so that the error message is contained in a grid and other elements are in the new grid.

    Kind regards

    Kiran

  • How to catch the exact validation error message?

    Hi experts,

    I want to intercept the exact validation error message.
    If the validate operation fails then I get the following SOAP fault:

    < env:Fault xmlns:ns0 = "http://docs.oasis-open.org/wsbpel/2.0/process/executable" >
    ns0:invalidVariables < faultcode > < / faultcode >
    faultName < faultstring >: {{http://docs.oasis-open.org/wsbpel/2.0/process/executable} invalidVariables}
    messageType: {{http://schemas.oracle.com/bpel/extension} RuntimeFaultMessage} < / faultstring >
    < faultactor / >
    < detail >
    < exception / >
    < / details >
    < / env:Fault >

    However, in the Manager of the company (audit trail) I see the following message to the failure to validate the operation:

    Invalid data: the value of the variable 'req_ProcessAdjustmentOp' part 'bodyUPI' does not match the schema definition for this part of invalid text '?' in the element: 'date '. Invalid xml document is shown below:

    I would like to send this message to the service consumer because it contains more information about the error. How I do that? I've tried the function ora: getFaultAsString() but I had the original sin.

    Thank you
    Viktor

    The root cause of the problem is that, in the bpel fault lifted, the details of the fault are empty (i.e.) {summary}, {details} and

     are not populated for  element.
    This same issue was logged and tracked via Bug 12551111 - VALIDATE ACTIVITY DOES NOT POPULATE FAULT VARIABLE FROM CATCH - published on My Oracle Support.
    
    As per developments update in 12551111 :
    Failure content won't be set for standard faults according to BPEL specs. It will be available in the audit trail.
    
    This means that :
    1. {summary} , {detail} and 
    

    will be omitted for standard faults fault variables.
    2. given that the details of 'fault' are not met, "validation" of the variable of fault against the schema (RuntimeFault.wsdl) should fail.

    There is a demand for improvement already filed: Bug 12700279 - FAULT VARIABLE DETAILS ARE NOT POPULATED for STANDARD HOLES.
    Unfortunately, at the moment there is no workaround known solution for this.

    Best regards
    Oana

  • Simple HTTPService which returns the text

    I have made through Google and the documentation for it but still can't find what I want. Basically I have a php file that takes some of the entries, it treats and returns the text, I already know how to transfer the data to the flex php file, what I'm trying to do is get the text that returns the file and put it in a label in my flex application.

    So far, I have a function that the httpservice calls when the event "train", but so far, I still havn't found away to get the actual text that is returned, can someone tell me how to get this text the HTTPService?

    Just a note, I'm using the httpservice mxml form.

    The only thing is your text that is returned from php to be in xml format. Then, print your query result to XML first. And then parse through the xml in flex by using something like this:

    I created a script that analysis automatically any how MySql query that I throw at it as xml. There are some constraints you must follow while using it however.

    The caller script should have:
    $Query = a mysql query
    $queryName = 'name you give it. " This is also equal to the XMLRootName
    $tableName = 'name you give it. " This will correspond to the XMLResultSetName and doesn't really tell the table you are querying, but rather a generic name that you give the results table.
    $Result = mysql_query ($Query); the $Query is simply the veriable calling the actuall mysql query.
    include ('xmlParser.php'); place after the $Result statement.

    <-----------xmlParser.php------------>
    <>
    create the root node;
    $Return =""." \n"." \n » ;
    $Return. = «<$queryName>». » \n » ;

    treat a line at a time
    While ($row = {mysql_fetch_assoc ($Result))}

    Add node for each line
    $Return. = « <$tableName>». » \n » ;

    Add a child node for each field
    {foreach ($row as $fieldname-online $fieldvalue)

    $Return. = « <$fieldname>». "" $fieldvalue ". »«. » \n » ;

    } / / foreach

    $Return. = " «. » \n » ;
    } / / While

    $Return. = "«. » \n » ;

    ?>

    Then use the dataProvider to display resutls in Flex.

  • Function returning the query takes longer to run in Apex4.0

    Hi all

    I've created a report using the function returns the query. The function returns the query based on parameters that returns the dynamic columns. When I run the query in sql developer the query generates and returns the result in 3mins. But in the apex, it takes 35 minutes maximum to return.

    The query returns about 10000 lines.

    What a performance problem in the query or Apex? can someone help plz

    Concerning
    REDA

    No it's just the first tranche of 500. You can run it in good old SQL * more and the total time of the time (be patient however)

  • FIRST analytical functions returns the null line

    The following query returns a null line when there is no such thing as a line for the predicate. Is it a bug or expected behaviour. If so what is the meaning of the null row, is it not logical?



    SELECT NVL (max (ah.fyr_end_dt) KEEP (DENSE_RANK FIRST ORDER BY ah.as_of_dt DESC), ' RETURNED NULL')
    Of account_history ah
    WHERE
    Ah.acct_id = 999
    AND trunc (ah.as_of_dt) < = 31 December 08 '
    ;

    Hello

    user4900730 wrote:
    Moreover, in my example how I distinguish the case where a line really exists, but the column is null when there is no such thing as a line and the FIRST function returns the same value null? Hopefullly I should be able to do it in a single SQL and know the difference?

    COUNT (*) > 0, but COUNT (col_x) = 0, then there is a line, but col_x happened to be null.

    For example, the following query shows that there is 1 row in the group with the lowest name ("ADAMS"), but the column comm in all ranks of this group is null:

    SELECT     COUNT (*)    KEEP (DENSE_RANK FIRST ORDER BY ename)
                              AS total_cnt
    ,     COUNT (comm) KEEP (DENSE_RANK FIRST ORDER BY ename)
                              AS comm_cnt
    FROM     scott.emp
    ;
    

    Output:

     TOTAL_CNT   COMM_CNT
    ---------- ----------
             1          0
    

    The employee whose highest name ("WARD") has a number in the comm column.

  • Function that returns the text of the error - type of Validation

    Small question regarding creating a function that successfully compiles a validation without a text of the error control: what value the function returns to validation successful?

    I tried a null value, but it doesn't seem to work.

    Thank you.

    Hello

    How does it work?

    What return NULL validation function is passed. If it returns a character string, then the validation failed and string is displayed as the error message for validation

    BR, Jari

  • Why the HTTP become function returns the error code 63?

    I tried to use the get HTTP function to get the XML file is returned by the api Google MAPS distance-matrix. I got the right answer if I insert the url directly in the browser, but using the get HTTP function, it returns the error 63, why?

    This is my code (the VI is developed on LV2011).

    I guess, the VI GET for use with LabVIEW Web Service, only not to get of the Internet pages.

    Using the simplest way:

    Andrey.

  • change the text unit-error bounds 1128

    Hey everybody,

    I develop a VI that uses the native power of LabVIEW units to do all the conversions of my numbers.

    Here my question, once variables are defined for a control when editing can I change the text of unity to something not related to execution in order to prepare my indicator for a different signal? For example, lets say channel 1 is a temperature for Test1 so programmatically feray Cdeg conversion and back without problem for LabVIEW. For Test2, the same VI is used, but now the channel 1 is a pressure. Programmatically change my of feray indicator units now a unit of pressure psi, atm or bar? I am getting error 1128 "input unit is not compatible with the device current." even if the device is correct when it is entered at the time of publishing.  Any thoughts?

    Thank you
    Craig

    Hi Lucie,.

    No, you cannot change the type of unit when running. This will be fixed at compile time. You can modify other representations of the same physical property (as the Pa to the bar or some obscure lb/po2 of pressure).

    An old trick when using units:

    You can use '$1' as a control unit. Using a function to "Convert the unit" also set to "$1"you can then strip the unit." If your Subvi accepts any control unit connected-, but that does not solve your problem of perticular

  • RegExp return the text inside quotes

    I'm looking for a way to return only what is between the text in a column or a period if it is between two sets of quotes. There could be any number of occurrences in the text of the column.

    "ENC". "CHECKOUT_TIME" [DATE, 7], "ENC" "." " PAT_ENC_CSN_ID "[NO.22],"ENC"". "" CHECKIN_TIME "[DATE, 7].

    Becomes

    "ENC". "" CHECKOUT_TIME ""ENC ". "" PAT_ENC_CSN_ID ""ENC ". "" CHECKIN_TIME ".

    It's possible with a regular expression?

    Hello

    I don't know if this can be done with a single regular expression.

    Here's a way that uses two functions:

    SELECT str

    REGEXP_REPLACE (REGEXP_SUBSTR (str

    , '".*"'

    )

    , '("[^"]*"(\." [^"]*")?) [^"]*'

    , '\1'

    ) AS new_str

    FROM table_x

    ;

    REGEXP_SUBSTR eliminates materials without quotation marks before the first quotation mark and after the last quotation mark double.

  • make a function using the update query - error PLS-00103

    I get the following error message in my pl/sql developer every time, I try to create this function in my package
    PLS3-00103 encountered the symbol ";" when expecting one of the following return

    Please note, I'm trying to do is to get a user entered to perform an update for a specific row in a table called accountingtable that is located in the CDC schema. I don't want to make a comeback but in my update function.



    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    The package Specfication
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    FUNCTION update_price (needed_newprice in ccl.accountingtable.price%rowtype,
    partforupdate in ccl.accountingtable.part_id%rowtype,
    colourpart to ccl.accountingtable.colour_id%rowtype);

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    package body
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    FUNCTION update_price (needed_newprice in ccl.accountingtable.price%rowtype
    partforupdate in ccl.accountingtable.part_id%rowtype,
    colourpart to ccl.accountingtable.colour_id%rowtype);



    BEGIN
    Update accountingtable
    fixed price = (needed_newprice)
    where part_id = (partforupdate)
    and colour_id = (colourpart);

    END update_price;

    Thanks in advance for any help.

    Procedure update_price (needed_newprice in ccl.accountingtable.price%rowtype,
    partforupdate in ccl.accountingtable.part_id%rowtype,
    colourpart to ccl.accountingtable.colour_id%rowtype);

    No % rowtype. Use type %

    Procedure update_price (needed_newprice in ccl.accountingtable.price%type,
    partforupdate in ccl.accountingtable.part_id%type,
    colourpart to ccl.accountingtable.colour_id%type);

    is not respected in the body

    create or replace pacakage body test_board is

    procedure update_price (needed_newprice in ccl.accountingtable.price%rowtype---ici
    partforupdate in ccl.accountingtable.part_id%rowtype,
    colourpart to ccl.accountingtable.colour_id%rowtype) is

    Published by: user2679851 on June 2, 2010 14:01

  • How to show the component validation errors inline instead of in a popup note?

    Hello

    IM using jdeveloper v. 11.1.2.3.0

    I want to show validation errors for an inline element, and not in a pop-up note without counting as the component.

    I found that it is possible through the use of the af:message component.

    The af:message works very well as long as the component must be committed, is not within a taskflow in a region.

    If this is the case, it seems that the af:message component is ignored, and validation errors is still a time showed in a popup note.

    For an example, see the code below. This works very well on an ordinary jspx page. If the same code is implemented within a fragment of jsff in a taskflow and taskflow is then implemented as a region in a regular jspx page - the validation error is displayed in a pop-up note instead of inline.

    < af:message = "input1" ID = "message1" / >

    < af:inputText id = value of '1' entry validator = "< some binding value > ' ="< some binding validator >"/ >

    I solved the problem. Apparently there's a bug in the ADF, so that the attribute 'for' points to a component id wrong (client side). It simply puts the container of name in twice.

    The solution is to prepend ":" in front of the id of the component in the attribute 'for' during the use of the af:message within a fragment of a page in a region. See the example below.

    
    
    
  • Create a branch to function returns the URL - new tab

    APEX 4.2.2

    I have a branch of type creates a branch to the function return URL that returns a URL. The branch is triggered via a page element button. The branches of the page at the URL very well but the URL has nothing to do with the application, it is an external URL, so I want to open the link in a new browser tab. Using the link attributes, this is done by using target = "_blank" but I don't see a way to do that in this situation. Seems simple enough, what don't get me? Thank you

    HELEN wrote:
    APEX 4.2.2

    I have a branch of type creates a branch to the function return URL that returns a URL. The branch is triggered via a page element button. The branches of the page at the URL very well but the URL has nothing to do with the application, it is an external URL, so I want to open the link in a new browser tab. Using the link attributes, this is done by using target = "_blank" but I don't see a way to do that in this situation. Seems simple enough, what don't get me?

    Nothing. It is not possible to do this using a branch as the changing context of the browser should be initiated by the browser, not the server. Use JavaScript to do this automatically:

    window.open('', '_blank');
    

    I'd go with changing the direction if it branches to the original page, setting a value of ASK for use as a condition on dynamic action of The Execution of JavaScript Code that runs the window.open.

  • Function returning the tree used with the object type

    Hi guys!

    I'm fighting for some time now of a function that should return the tree structure of the employees. Let me clarify...
    I have a table say Manager and employees (two columns for an example)
    MANAGER_ID
    EMPLOYEE_ID

    Example:

    MAN_ID - 1; EMPLOYE_ID - 2;
    MAN_ID - 2; EMPLOYE_ID - 3;
    MAN_ID - 2; EMPLOYE_ID - 4;
    MAN_ID - 4; EMPLOYE_ID - 5

    The purpose of my function is back for a specified MAN_ID everyone in the tree...

    Example:

    RETURN_TREE (1) return {2,3,4,5};
    RETURN_TREE (2) returns {3,4,5};
    RETURN_TREE (4) returns {5};

    How to get there?

    With respect,

    PsmakR

    And use BULK COLLECT or the COLLECT function to build the collection:

    create type emp_table as table of number(6);
    /
    
    DECLARE
     v_emp_list emp_table;
    BEGIN
     select cast(collect(employee_id) as emp_table)
     into v_emp_list
     from employees
     connect by prior employee_id = manager_id
     start with manager_id = :p_man_id
    
     -- or
     /*
     select employee_id
     bulk collect into v_emp_list
     from employees
     connect by prior employee_id = manager_id
     start with manager_id = :p_man_id
     */
    END;
    /
    

Maybe you are looking for