Application Express :: Validation - PLSQL Function Returning Boolean Bug?
Mar 12, 2013
Application Express 4.1.1.00.23 ( plus all earlier versions that I've ever used)
When using the wizard to create a Validation of type "PLSQL Function returning Boolean", why is it mandatory to enter a value in the text field "Error Message" on the screen that follows? This message is never used as the message actually displayed comes from a PLSQL return statement.
I am using the below function to return a blob (CSV) content, this is working fine..But i need to modify this function to display headline for the report and fixed width column in CSV ( then user no need to expand the each and every column ).
create or replace function GET_BLOB ( p_query varchar2 ) return blob as
POSTCODE_TO_LAT_LNG_GM_API(postcode IN VARCHAR2, lat OUT NUMBER, p_long OUT NUMBER)
to convert a postcode into lat/long values. I then need to add them to the returned SQL statement so I used the string concat operator || with to_char but it comes up with this error when I try to apply the changes: Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic column'' checkbox below the region source to proceed without parsing.
ORA-00936: missing expressionh4.
h4. btw I'm using Oracle 11g release 11.2.0.3.0 and Apex version 4.1.1.00.23
CREATE OR REPLACE FUNCTION is_overdue (due_date IN DATE,paid_date IN DATE) RETURN BOOLEAN IS days_between NUMBER (2) := due_date - paid_date; BEGIN [code]......
When i try using this compilation, i am getting error for this program:
SQL> begin 2 dbms_output.put_line(is_overdue('07-nov-1987','01-aug-2012')); 3 end; 4 / dbms_output.put_line(is_overdue('07-nov-1987','01-aug-2012')); * ERROR at line 2: ORA-06550: line 2, column 7: PLS-00306: wrong number or types of arguments in call to 'PUT_LINE' ORA-06550: line 2, column 7: PL/SQL: Statement ignored
To get output for this program? Show me how to compile.
I have problems with calling procedure directly from webbrowser. I have a procedure test in test_pkg package. I granted execute on it to anonymous , added it to wwv_flow_epg_include_mod_local function and still have error 404.searched this forum and found this: Does listener use wwv_flow_epg_include_mod_local
So I granted to apex_public_user and created synonym for him to my package. And it starts working. But then I wanted to add next proceudre to my package the same way, and change my test procedure and it stop working again. Now I have 404 error again.
my employer wants me to create an application that will respect our accessibility rules. I know APEX 4.1.1 do it far better then APEX 3.2, but this is our current version.
Do you know any way to tweak how APEX 3.2 show the error messages on the fields after the validation have been executed ?We must show the error messages before the field's caption.
And, if I use the native validation process of 3.2, will it be upgraded to 4.1.1 when we do the move without any actions ?
i have a hidden region at the page top i want to show only after clicking my button which is running DA plsql code. This region is like a prompt message container/div at the top of the page so after few seconds like 10 secs i want to hide it again. I tried to use JQUERY but never hide it back, also i tried another TRUE CONDITION within my dynamic action but it doesnt reset it back the region is always shown...
I am trying to apply page validations on a tabular form. The form allows users to update data in a database table. I have created some validations such as "column x must not be null" etc and on submit, the error message appears and the relevant cells are highlighted in red. All ok so far.
However, for the primary key, I am relying on the table definitions in the Oracle database to not allow duplicate row entries. When a user tries to enter a duplicate row the error message appears but the relevant row / cells are not highlighted, just the row number is given. In a table with many rows this is a bit annoying.
Is there anyway to get the cells to highlight in red for such circumstances or do I need to create the primary keys within APEX itself?
I use apex 4.1..I have a tabular form a select like this
select "STRATEGYID", "STRATEGYID" STRATEGYID_DISPLAY, "STRATEGYNAME", "ISAVTIVE", "STRATEGYSTARTYEAR", "STRATEGYSTOPTYEAR", "STRATEGYTYPEID" from "#OWNER#"."STRATEGY" where ISAVTIVE = 1STRATEGYSTARTYEAR and STRATEGYSTOPTYEAR as a Select List contain a value of year
I select from LOV like this select y l, y v from (select extract(year from sysdate) + rownum - 1y from dual connect by rownum <= 51)and
I have to Validate STRATEGYSTARTYEAR must Less than STRATEGYSTOPTYEAR
Is it possible to create a validation for tabular form which will be fired only for created?
There is a possibility in APEX 4.1 to choose two types of "*Execution scope*" first is "*For created and Modified Rows*" and second is "*All Submitted Rows*".
I am writing a REGEXP_LIKE function to validate the email address.. below function works for most of the valid email address, but not working for below condition... not sure how it can be tweaked to work for below condition as well...
Character . (dot, period, full stop) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively (e.g. John..Doe@example.com).
Select 'X' from dual WHERE NOT REGEXP_LIKE('John.Doe@example.com','^(([a-zA-Z0-9_-])([a-zA-Z0-9_.''-]*)@([((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3}|((([a-zA-Z0-9-]+).)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])]))$')
For the customer ID 123 I want to return Z1, for customer 678 I want to return S2 and for customer ID 345 I want 11
Problem is that I'm new to the concept of looping. I know how to write a function that accepts customer_id as a value write a cursor and then check IF hierarchy = 1 the return FUNCTION_CODE IF hierarchy - 2 THEN ...
but I need something more universal as some of the customers may have hierarchy function 1 and that would be the top one for him but others might have function of hierarchy 10 as top and checking all of the possibilities using if would be just stupid. So how to write something universal ? And of course if function did not find any customer_id then return null.
I have the following function that I am using as a template for any function that executes a select statement and return a single value as an output.
The function is working but I wanted to take an expert opinion if it can be optimized.
CREATE OR REPLACE FUNCTION AFESD.F_AGR_GET_AGREEMENT_SERIAL (I_NUMBER0 IN NUMBER, S_SUB_NUMBER VARCHAR2 DEFAULT NULL, I_TYPE_ID NUMBER)
[Code]....
In addition I want to use the parameter S_SUB_NUMBER that can be NULL and add it to the select statement of the cursor, but I dont know how to do that in one statement.
CURSOR C_AGREEMENT IS SELECT AGREEMENT_SERIAL FROM VW_AGR_AGREEMENT WHERE NUMBER0 = I_NUMBER0 AND TYPE_ID = I_TYPE_ID -->and sub_number is null; -->and sumb_number = s_sub_number
I've seen several code samples that show how to return a REFCURSOR from a Stored Function, but when I try it with C# it gives me allways WRONG NUMBER OF ARGUMENTS or somehing like that.
I presently don't have my code in here, but it is something like this:
I'm trying to debug this function to get the desired results. See attachment for the function code and the test data insert script.
----Create Test Table CREATE TABLE VC_WORKINGDAYS ( WK_ID number NUMBER(10,0), WK_DATE DATE, );
-- Insert test Data INSERT INTO VC_WORKINGDAYS_1 VALUES (308, '25-MAR-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (316, '06-APR-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (324, '18-APR-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (332, '03-MAY-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (340, '13-MAY-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (348, '25-MAY-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (356, '06-JUN-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (364, '16-JUN-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (372, '28-JUN-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (380, '08-JUL-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (388, '20-JUL-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (396, '01-AUG-11'); INSERT INTO VC_WORKINGDAYS_1 VALUES (404, '11-AUG-11');
SQL ----- Result Should be WHY SELECT (VC_CALC_WD_DATE(LAST_DAY(TRUNC(SYSDATE)),1)) FROM DUAL 14/JUL/10 15/JUL/10 is 1 working day from today SELECT (VC_CALC_WD_DATE(LAST_DAY(TRUNC(SYSDATE)),2)) FROM DUAL 14/JUL/10 16/JUL/10 is 2 working days from today SELECT (VC_CALC_WD_DATE(LAST_DAY(TRUNC(SYSDATE)),3)) FROM DUAL 14/JUL/10 19/JUL/10 is 3 working days from today
Attached File(s)
create_Function.zip ( 6.39K ) Number of downloads: 1
DECLARE cnt number(10); BEGIN SELECT COUNT(*) INTO CNT FROM TBL_ADDRESS WHERE ADDRESS_ZIP IN (SELECT * FROM TABLE(MY_PACK.STR2TBL('46227'))); DBMS_OUTPUT.PUT_LINE (cnt); END;
MY_PACK.STR2TBL() is a function which takes '|' delimited string, extracts values and returns a table of zipcodes. The function works fine and returns 46227 but the count returned is 0 instead of 280(count returned by replacing inner select with '46227').
I am trying to run a dynamic select statement form a function and return the result into a variable, everything goes fine but the return is always null!
CREATE TABLE AFESD.MAJOR_ACCOUNT ( NUMBER0 NUMBER(2) NOT NULL, SHORT_NAME CHAR(35 BYTE) NOT NULL, FULL_NAME CHAR(50 BYTE) )
--Actually any table can do
CREATE OR REPLACE FUNCTION F_GEN_SELECT_INT (S_APP_USER IN VARCHAR2, I_MODULE_ID IN NUMBER, S_TABLE IN VARCHAR2, S_COLUMNS IN VARCHAR2) RETURN NUMBER AS I_RETURN NUMBER; S_SQL VARCHAR2(300); --S_DB_ERROR VARCHAR2(100);
[code]....
B.S. I didnt delete the commented lines to have your review comments.
I have a problem when trying to create a PLSQL function based on an XML extraction query.
I have three dummy tables:
SQL> get create_address 1 create table ADDRESS 2 ( 3 id NUMBER not null, 4 house_number NUMBER, 5 house_name VARCHAR2(20), 6 street_name VARCHAR2(30),
[code]....
And the following dummy data for these:
1 insert all 2 into ADDRESS (ID, HOUSE_NUMBER, HOUSE_NAME, STREET_NAME, CITY, COUNTY, POSTAREA, POSTSTREET) 3 values (1, 1, '', 'Tube Street', 'Norwich', 'Norfolk', 'NF12', '2DF') 4 into ADDRESS (ID, HOUSE_NUMBER, HOUSE_NAME, STREET_NAME, CITY, COUNTY, POSTAREA, POSTSTREET) 5 values (2, 5, '', 'Dave Street', 'Edlington', 'Kent', 'CT34', '8GH') 6 into ADDRESS (ID, HOUSE_NUMBER, HOUSE_NAME, STREET_NAME, CITY, COUNTY, POSTAREA, POSTSTREET)
[code]....
So far so good then. But, what I want to create is a function where I can pass in an id value and return the corresponding XML CLOB.
So I try, very simply, this:
SQL> get get_xml_data 1 create or replace function get_xml_data(p_id in number) return clob is 2 Result clob; 3 begin 4 select xmlroot(xmlelement("HomeData",
[code]....
And, alas, i'm greeted by this:
SQL> / Warning: Function created with compilation errors. SQL> sho err Errors for FUNCTION GET_XML_DATA: LINE/COL ERROR -------- ----------------------------------------------------------------- 4/5 PL/SQL: SQL Statement ignored 24/63 PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got - SQL>
I've tried to redo the query in several different ways but so far nothing.
i have ir report and one column value coming from function,when open the IR report its giving error..
IR report code SELECT CS_ID ,CS_NAME, Util_func(PASS_ID) as "ALERT_DAYS" from "CSD_MASTERS" Function code FUNCTION Util_func(PASS_ID NUMBER) RETURN number IS ALERT_DAYS NUMBER:=0; BEGIN [code]........
I want to build a custom authentication scheme which combines the funcionality of of SSO and a custom authentication function.
1. If the HTTP Header Variable REMOTE_USER is set, this user should be a valid logged on user. (Single Sign On functionality)
2. If the HTTP Header Variable is not set, the LOGIN-Page should appear. (local user Administration)
3. The user/password combination from the login page should be validated by my own authentication function I think I have to create a sentry-Function, which is a combination of the sentry-functions which are used in the schemes "custom" and "HTTP Header Variable". I tried to find an implementation of these functions in the APEX_040200 database scheme, but without success.
I have a tabular form with a few columns. THey are ID, date1, date2 and task_name. The task_name is a drop down list of tasks. Upon selecting a specific task, I want the date1 and/or date2 columns to become read only (voided out) so users cannot enter in data. I am working with a tabular form, so I figured I need a javascript function to handle the logic and to call the function in the html elements of the column in the apex environment. This will need to happen dynamically (on click) before the page is submitted. I am more lost/confused on syntax. I know I will need to know the actual column name (coo1, coo2, something like that) of my columns that I will be refering to when I use javascript.
I have a report which comes from a table-function. This produces hundreds of lines of output which the user would like to be able to select and then export just the subset of lines.Looking at the Forum's (this article and this one) this seems possible if you are working with a table where you can re-query the original dataset with just a specific rowset required however as the table-function is generating output on the fly it is hard to rerun the query to reselect the same output for redisplay. Also most of the reports are working with interactive reports - whilst this is just static output. Is there a way to redisplay the information which has already been shown in an filtered way with check boxes?Is there then a way to have hidden fields which are not shown when the check boxes are selected but which can be shown in the "filtered" view? I am using Apex 4.0 at the moment on an Oracle 10g instance.
I am not familiar with form with report in APEX. I have a lot of forms with reports that was created before, but they have only create buttons. Now I need to add edit and delete buttons. I wish I do not have to recreate forms with reports. But when I tried to add delete function by comparing a form with delete button created by APEX, but it does not work. the delete button does not react at all.
setting is as follows:
button style: template based button button template: Button button type: normal action: redirect to URL execute validation: NO URL target: javascript:apex.confirm(htmldb_delete_message,'DELETE'); database action: SQL delete action condition type: value of item / column in expression1 is not null expression1: P2172_ALIAS_ID
I also enable the delete in the process of :"Process Row of SOR_ALIAS"
If I set action of delete button as submit page, I can delete the row, but no standard popup warning,
I have just created the basic employee information form in which i upload the photograph of the employee. The photograph gets uploaded but it does not display properly. I have already referred the sample database application to display the image. Moreover, i have followed the same steps as it is used to display the product image in that application. Still i am unable to get result. I am getting following output:
1 - i want to ask few things as i m new to apex, i am using apex 4.1, and created 3 select list and a button in selecting of parameter,
1 select list : select area 2 select list: select product 3- select list - size of the product
i want to generate Ids for the following. for that i created query for INSERTING RECORD FROM ONE TABLE TO ANOTHER , generation the ids when button pressed "Generate" after selecting parameters,
Now where i call that QUERY on button ? because when i create button its gives me option to submit, defined dynamic action, etc, where i call the function name id_generation when button pressed?
2- second thing i created tabular " select user_id, product_name, product_type from product".
By default check box list are create delete submit button are created, first when i insert record it saves that was fine, e.g i entered 50 records and afterward i want to update only one record, e.g there is a record product name = box, if i change it to box small and click submit then it saves all the page means all 50 records,
I want to submit only that record that i changed, for that i use the logic that only those records should be updated which are checked but the user. how will i do this ?