Given erroneous sometimes function return
Hi all.I have a very strange problem with a function. Situation is the following: I have an application that manages the process. Each process has a number of measures which is arranged in a matrix as put on the page. The user clicks on a stage to start/run.
Now in the list of running processes, I want to have an indication of how 'far', a process has reached so I created a function for this and which included in my processlist extraction.
gchs_user_process_steps is the table where the data user for the step in the process is
gchs_process_steps is the definition of what steps a process
gchs_steps is the definition of stages table
The function below is supposed to return last step user has clicked in the display matrix. level is used to store the column number and sortorder is the line number of any step user has clicked.
CREATE or REPLACE FUNCTION FN_REACHEDSTEP (NUMBER p_user_process_id)
RETURN VARCHAR IS
RET varchar (30);
ret_id INTEGER.
ret_num INTEGER.
BEGIN
RET: = ";
ret_id: = 0;
ret_num: = 0;
BEGIN
SELECT substr (step_name, 1, 30), step_id, reached IN ret, ret_id, ret_num
DE)
SELECT a.*, rownum rnum
DE)
SELECT s.name AS step_name, ps.id AS step_id, max ((ps.tier*1000) + ps.sortorder) REACHED
Senior gchs_user_process_steps, ps gchs_process_steps, gchs_steps s
WHERE the ups.gchs_process_step_id = ps.id AND
PS.gchs_step_id = s.ID AND
UPS.gchs_user_process_id = p_user_process_id
GROUP BY s.name, ps.id
ORDER BY 3 DESC) a
WHERE rownum < = 1).
WHERE rnum > = 1;
EXCEPTION
WHILE OTHERS THEN
RET: = ";
END;
RETURN ret;
EXCEPTION
WHILE OTHERS THEN
RET: = ";
RETURN ret;
END FN_REACHEDSTEP;
/
Now the problem is that the function sometimes returns an incorrect value. The name of the step that is returned is not one that I get if I run the SQL by itself.
In doing so one
SELECT substr (step_name, 1, 30), step_id, reached IN ret, ret_id, ret_num
DE)
SELECT a.*, rownum rnum
DE)
SELECT s.name AS step_name, ps.id AS step_id, max ((ps.tier*1000) + ps.sortorder) REACHED
Senior gchs_user_process_steps, ps gchs_process_steps, gchs_steps s
WHERE the ups.gchs_process_step_id = ps.id AND
PS.gchs_step_id = s.ID AND
UPS.gchs_user_process_id = 21680
GROUP BY s.name, ps.id
ORDER BY 3 DESC) a
WHERE rownum < = 1).
WHERE rnum > = 1;
and one
Select fn_ReachedStep (21680) double;
sometimes return different values.
So the function fundamentally bad or is there no matter what cache or something that I missed that could contain the outputs 'old' function, or am I missing something else.
Grateful for clues.
I use 10.2.0.1.0 Oracle
Best regards
/ Tomas
Edit: Here is some data that uses the system.
gchs_steps
ID NAME
------ ------------
10000 step 1
10020 step 2
10021 step 3
10022 step 4
10023 step 5
10060 step 6
10140 step 7
...
gchs_process_steps
GCHS_STEP_ID TIER SORTORDER ID
------ ------------ ---- ---------
10000 10000 0 1
10001 10020 1 1
10002 10021 1 2
10003 10022 2 1
10020 10023 3 5
10060 10060 3 4
10080 10140 3 2
10040 10040 3 3
10100 10160 4 3
10220 10160 4 2
11640 11640 3 1
11660 11660 0 6
11661 11661 0 7
11600 11600 0 4
11620 11620 4 1
...
gchs_user_process_steps
ID GCHS_USER_PROCESS_ID GCHS_PROCESS_STEP_ID
------ -------------------- --------------------
...
35541 21680 10002
38441 21680 10020
38440 21680 10000
52062 21680 10060
...
Relationship beween table is
gchs_user_process_steps.gchs_process_step_id = gchs_process_steps.ID
and
gchs_process_steps.gchs_step_id = gchs_steps.ID
In doing so the only SQL always returns
SUBSTR (.) REACHED STEP_ID
---------- ------- ------
Step 5-10020-3005
but the execution of the function sometimes returns
FN_REACHEDSTEP (21680)
---------------------
Step 6
Also remove the rownum limited return and make a
SELECT s.name AS step_name, ps.id AS step_id, max ((ps.tier*1000) + ps.sortorder) REACHED
Senior gchs_user_process_steps, ps gchs_process_steps, gchs_steps s
WHERE the ups.gchs_process_step_id = ps.id AND
PS.gchs_step_id = s.ID AND
UPS.gchs_user_process_id = 21680
GROUP OF s.name, ps.id, ps.tier, ps.sortorder
ORDER BY DESC 3
give this result
STEP_ID REACHED STEP_NAME
--------- ------- -------
Step 5-10020-3005
Step 6 10060 3004
Step 3-10002-1002
Step 1-10000-1
Published by: user4935832 on 19-sep-2008 01:38
ORDER BY 3 DESC) a
WHERE rownum<= 1="">=>
WHERE rnum > = 1;
Just some thoughts.
1. you can substitute 'ORDER BY 3', "ORDER BY reached"
2. the rownum <=1 and="" rnum="">= 1 will return a single line... I don't understand the other.
Finally, the difference may be a return of duplicated by your MAX() function value.
If there are two lines (or more) with MAX even, Oracle can return an arbitrary line.
To get the same line, you must use an aggregate like MAX() KEEP (DENSE_RANK LAST...) function.
Here is a test for your query, obviously not tested:
SELECT max(substr(step_name,1,30)) keep (dense_rank last order by reached) as step_name,
max(step_id) keep (dense_rank last order by reached,step_name) as step_id,
max(reached) as reached
FROM (SELECT s.name AS step_name,
ps.id AS step_id,
max((ps.tier*1000)+ps.sortorder) AS reached
FROM gchs_user_process_steps ups,
gchs_process_steps ps,
gchs_steps s
WHERE ups.gchs_process_step_id=ps.id
AND ps.gchs_step_id=s.id
AND ups.gchs_user_process_id=21680
GROUP BY s.name,ps.id) a;
Nicolas.
=1>
Tags: Database
Similar Questions
-
ORA-06503: PL/SQL: function returned no value
Hi guys,.
I wrote a function that returns the number of quarter for a given date.
Here's the function
FUNCTION to CREATE or REPLACE fn_get_quarter
(p_date DATE)
RETURN NUMBER
AS
v_qtr NUMBER;
BEGIN
Select TO_CHAR (p_date, 'Q')
IN v_qtr
DOUBLE;
dbms_output.put_line (' it's quarter ' | v_qtr);
END;
It compiled without error.
Here is the test case that I wrote
DECLARE
p_date DATE: = TO_DATE('12/22/2009','MM/DD/YYYY');
v_qtr NUMBER;
BEGIN
v_qtr: = fn_get_quarter (p_date);
END;
When I run the present, I get the following error.
ORA-06503: PL/SQL: function returned no value
ORA-06512: at "GPS_FVO. FN_GET_QUARTER', line 13
ORA-06512: at line 7
But surprisingly, I get the result.
Please suggest and let me know how to get rid of this error and why I get this error.
Thanks in advance.
SamRETURN v_qtr;
should be added after DBMS_OUTPUT -
Capture of high speed using flex functions returns null vector
Hello
We have a controller 7350 and UMI-7774 drive a motor step by step through P70530 pilot. We use a single axis, axis 1, which is configured as a stepper motor with your comments and 10000 steps/rev. Our engine performs a profile displacement and during this move, you should read the position of the encoder with about 2000 Hz resolution. I can move the engine using MAX or flex functions, I can also read the encoder using the post MAX, but cannot perform high speed reading.
Issues related to the:
1. How can I configure read it for 2000 Hz at high speed?
Function flex_configure_buffer (boardID, bufferInEnc, axis, NIMC_HS_CAPTURE_READBACK, contMoveBufSize, totalPoints, NIMC_FALSE, requiredInterval, on actualInterval)
Returns the error-70078 (invalid parameter) when I pass a required interval less than 10ms.
2. How can I read data from buffer high speed?
Even when the buffers is configured with the interval of 10 ms, the flex_read_buffer_rtn (boardID, bufferInEnc, rear, out retVector) function returns no data (retVector = null).
Please find attached an example of solution of vs2008 demonstrating the problem.
Hello Stephen,
The problem is now solved, the problem was in the trigger condition.
It seems that the parameter requiredInterval in the function flex_configure_buffer() function call is ignored, because I get to any interval of 0.5 ms data even if the requiredInterval and the actualInterval are two 10ms.
Thanks for your help.
-
Original title: Error message-not invited
Trying to electronic. Error message: 'an internal support function returned an error.'
Hello
Which email client you are using?
If you are facing the issue in Microsoft Office, you can post your question in the Microsoft Office community & get help support professionals.
Hope the helps of information.
Please post back and we do know.
-
Function return undefined values
My function returns undefined values. It seems that the return of the function statement is executed before the database is queried and values are assigned to variables. If I do an alert within the loop for () I get the correct values from the database, but these values are not affected before excecuting the return statement function. How can I do this differently?
function getColumnNames(table){ var rs1, rs2, rs3, rs4, rs5; db.transaction(function (tx) { tx.executeSql("SELECT * FROM schema WHERE table_name=?",[table], function(ax, results){ var size = results.rows.length, i; var item; for (i = 0; i < size; i++){ item = results.rows.item(i); rs1 = item.col1; rs2 = item.col2; rs3 = item.col3; rs4 = item.col4; rs5 = item.col5; alert(rs1); //correct value is returned here } }); }); return [rs1, rs2, rs3, rs4, rs5]; }
Hey Fabian,.
You are quite correct that the return statement is executed before the database returns the results. There are ongoing asynchronous calls. You can set breakpoints in JavaScript code to see what is happening. You can correct the problem by using function callbacks. I edited your code below to use the callback functions - there might be a few typos, but the general approach should be wooded.
function getColumnNames(table, callback){ var rs1, rs2, rs3, rs4, rs5; db.transaction(function (tx) { tx.executeSql("SELECT * FROM schema WHERE table_name=?",[table], function(ax, results){ var size = results.rows.length, i; var item; for (i = 0; i < size; i++){ item = results.rows.item(i); rs1 = item.col1; rs2 = item.col2; rs3 = item.col3; rs4 = item.col4; rs5 = item.col5; alert(rs5); //correct values are being returned callback([rs1, rs2, rs3, rs4, rs5]); } }); }); } // example of how to call getColumnNames with callback getColumnNames('importantTable', function (result) { console.log(result); }); // alternative version function onCallback(result) { console.log(result); } getColumnNames('importantTable', onCallback);
I hope this helps.
See you soon,.
James
-
How the two function return values
Dear all,
Please explain, how the two values of function return?
give a simple example.
OK, a few examples...
First example, using a type of structured on the database object:
SQL > create or replace type tMyValues as an object (yr number, number, number of dy mn)
2.Type of creation.
SQL > create or replace function getMyValues return tMyValues is
2 number of y: = extraction (year sysdate);
number of 3 m: = extraction (sysdate months);
number of 4 d: = extract (day of sysdate);
5. start
6 return new tMyValues(y,m,d);
7 end;
8.The function is created.
SQL > set serverout on
SQL > declare
2 myValues tMyValues;
3. start
4 myValues: = getMyValues();
5 dbms_output.put_line (' year: ' | myValues.yr);
6 dbms_output.put_line (' month: ' | myValues.mn);
7 dbms_output.put_line (' date: ' | myValues.dy);
8 end;
9.
Year: 2015
Month: 4
Day: 1PL/SQL procedure successfully completed.
Second example, using an associative array within PL/SQL:
SQL > set serverout on
SQL > declare
2 type tMyValues is table of the index number to varchar2 (10);
3 myValues tMyValues;
4
5 function getMyValues return tMyValues is
6 retValues tMyValues;
7. start
8 retValues ('Year'): = extraction (year sysdate);
9 retValues ('Month'): = extraction (sysdate months);
10 retValues ('Day'): = extract (day of sysdate);
11 return retValues;
12 end;
13. begin
14 myValues: = getMyValues();
15 dbms_output.put_line (' year: ' | myValues ('Year'));
16 dbms_output.put_line (' month: ' | myValues ('Month'));
17 dbms_output.put_line (' date: ' | myValues ('Day'));
18 end;
19.
Year: 2015
Month: 4
Day: 1PL/SQL procedure successfully completed.
For the pipeline functions, see the example I wrote on the link provided by ReemaPuri (answer No. 3) that I don't need to re - write what I did before.
-
ORA-06503: PL/SQL: function returned no value ORA-06512:
Hi all
SQL > set serveroutput on
SQL > CREATE OR replace FUNCTION qty_value (p_item_id number)
2 RETURN NUMBER
3 EAST
4 v_qty_arrival NUMBER;
5 BEGIN
6. SELECT THE CASE SENSITIVE OPTION
7. WHAT (SUM (b.quantity) - SUM (b.quantity_received)) < = 0 THEN 0
8 ELSE (SUM (b.quantity) - SUM (b.quantity_received))
9 END Qty_Arrival
10 INTO v_qty_arrival
Po_lines_all 11 a,
po_line_locations_all 12 b
13 WHERE a.po_line_id = b.po_line_id
14 AND a.item_id = p_item_id;
15 EXCEPTION
16 THEN THAN OTHERS THEN
17 v_qty_arrival: = NULL;
18 RETURN v_qty_arrival;
19 END qty_value;
20.
The function is created.
SQL >
SQL > select xxc_qty_arrivale (214960) double
2.
Select xxc_qty_arrivale (214960) double
*
ERROR on line 1:
ORA-06503: PL/SQL: function returned no value
ORA-06512: at the 'APPS '. XXC_QTY_ARRIVALE', line 19
Back AFTER using the exception block is fine as long as your code actually REACHED the exception block.
When there are no errors, then your code will not enter the exception block, but you still NEED to return a value, since it is what functions a function wants to return a value, that's what the functions are made for.
Spot the differences between the following 3 functions. Understand how they work.
The first function has only a return in the exception block but runs correctly. Result: error, because the back is missing in the code block.
The second function has a return in the exception block and one in the block of code and runs correctly. Result: no error, because the return is not missing in the code block.
The third function has a return in the exception block and one in the block of code and is forced into an error. Result: no error, because the return of the exception handler is used (instead of retriggering of the error, which you would normally do).
SQL > create or replace function myfunc
2 return number
3 as
4 start
5 dbms_output.put_line ('in the section of code');
6 null;
7 exception
8 then than others
9. can
10 dbms_output.put_line (' in the exception handler ' |) SQLERRM);
11 --
12 return 0;
13 --
14 end;
15.
The function is created.
SQL > select double myfunc;
Select double myfunc
*
ERROR on line 1:
ORA-06503: PL/SQL: function returned no value
ORA-06512: at "GHPLUS. MYFUNC", line 14
In the section of code
SQL > create or replace function myfunc
2 return number
3 as
4 start
5 dbms_output.put_line ('in the section of code');
6 null;
7 --
8 return 1;
9 --
10 exceptional
11 so that others
12. can
13 dbms_output.put_line (' in the exception handler ' |) SQLERRM);
14 --
15 return 0;
16 --
end 17;
18.
The function is created.
SQL > select double myfunc;
MYFUNC
----------
1
1 selected line.
In the section of code
SQL > create or replace function myfunc
2 return number
3 as
n number 4;
5. start
6 dbms_output.put_line ('in the section of code');
7 n: = 1/0; -force an error (zero divisor) to join the exception handler
8 --
9 return 1;
10-
exception 11
12 so that others
13. can
14 dbms_output.put_line (' in the exception handler ' |) SQLERRM);
15 --
16 return 0;
17 --
18 end;
19.
The function is created.
SQL > select double myfunc;
MYFUNC
----------
0
1 selected line.
In the section of code
In the handler for exception ORA-01476: divisor is equal to zero
SQL >
-
Dynamic region of the body of the function return query did not work
APEX 4.1
Oracle 11g
I have a report of dynamic fields according to the value of the different type of zone set element is body of pl/sql function, return query, see the source code of the region below.
declare
v_sql varchar2 (2000);
Start
IF: P2_BY = 'MONTH' THEN
v_sql: = 'SELECT ' | : P2_TYPE | ', SUM (JAN) JAN, SUM (FEB) FEB, SUM (MAR) MAR, SUM (APR) APR, SUM (MAY) MAY, SUM (JUN) JUN, SUM (JUL) JUL, SUM (AUG) AUG, SUM (SEP) SEP, SUM (OCT) OCT, SUM (NOV) NOV, SUM (DEC) DEC OF THE RPT_HOTEL GROUP BY ' | : P2_TYPE;
ON THE OTHER
v_sql: = 'SELECT ' | : P2_TYPE | ', SUM (Y2011) 2011, SUM (Y2012) Y2012, SUM (Y2013) Y2013, SUM (Y2014) 2014 RPT_HOTEL GROUP BY ' | : P2_TYPE;
Return v_sql;
end;
But "Missing expression" error when Save source in the region.
I checked the sql statement is valid in the sql command, and: P2_TYPE get the correct value.
If the generic column name 'use' then get the correct report, but the column name is random.
Please help solve.
Thank you so mcuh
Hi fac586,
I couldn't thank you more. Of course, read you my code and found that the design of table is not reasonable. in fact I just design for the demonstration of the prototype, so do not consider architecture.
I mean, it is that the problem has disappeared when I create a new page like this one, don't know how it happened. in any case what I need has been achieved, thank you very much for what you have done.
Here I paste my code for reference, that someone might need.
declare v_sql varchar2(2000); v_time varchar2(50); v_for varchar2(30); begin IF :P4_TIME='MONTH' THEN v_time := 'to_char(lodging_date,''MM'') MONTH'; v_for := 'to_char(lodging_date,''MM'')'; ELSE v_time := 'to_char(lodging_date,''YYYY'') YEAR'; v_for := 'to_char(lodging_date,''YYYY'')'; END IF; IF :P4_MEASURE='NIGHTS' THEN v_sql := 'SELECT * from (SELECT ' || :P4_BY || ',VENDOR_NAME,' || v_time || ',count(entry_legacy_key) ROOM_NIGHTS FROM HOTEL_EXPENSE GROUP BY ' || :P4_BY || ',VENDOR_NAME,' || v_for || ') PIVOT (SUM(ROOM_NIGHTS) FOR '; ELSE v_sql := 'SELECT * from (SELECT ' || :P4_BY || ',VENDOR_NAME,' || v_time || ',SUM(APPROVED_AMOUNT) SPENDING FROM HOTEL_EXPENSE GROUP BY ' || :P4_BY || ',VENDOR_NAME,' || v_for || ') PIVOT (SUM(SPENDING) FOR '; END IF; IF :P4_TIME='MONTH' THEN v_sql := v_sql || ' MONTH IN (''01'',''02'',''03'',''04'',''05'',''06'',''07'',''08'',''09'',''10'',''11'',''12''))'; ELSE v_sql := v_sql || ' YEAR IN (''2011'',''2012'',''2013'',''2014''))'; END IF; return v_sql; end;
and checked
'Use generic column names (analysis of query during execution only)'
column of the report used PL/QL name
declare v_sql varchar2(2000); begin v_sql := :P4_BY || ':VENDOR_NAME'; IF :P4_TIME='MONTH' THEN v_sql := v_sql || ' :Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec'; ELSE v_sql := v_sql || ':2011:2012:2013:2014'; END IF; return v_sql; end;
-
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 youHELEN wrote:
APEX 4.2.2I 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 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
REDANo 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)
-
ORA 28817 PLSQL function returned an error. When the apex 4 2 instance access
Hello
I just upgraded from apex to apex 4.2 4.1. All is well except for this error I get when I try to access the parameter Instance on the App Admin (localhost/apex/apex_admin)
ORA-28817: PL/SQL function has returned an error
What could be the problem? How we solve this problem...
I'm working on the 2012 Win server machine... apex 4.2 with earphone 2 deployed on Glassfish 3.1.2 apex.
Best regards
FatehHello Faye,
We are already aware of this problem, even if it is not yet present on our Web page of problems known. The reason for this error is that the new facility replaces an instance to the scale encryption key. In the preferences of the instance which have been encrypted with the old value (the SMTP password and the password for the portfolio), the values are not valid after the upgrade and decryption causes this error. As a work around, you can use the apex_instance_admin package to replace the invalid passwords.
The following code shows how the decryption throws ORA-28817:
SYS@a411> select apex_instance_admin.get_parameter('SMTP_PASSWORD') from dual; select apex_instance_admin.get_parameter('SMTP_PASSWORD') from dual * ERROR at line 1: ORA-28817: PL/SQL function returned an error. ORA-06512: at "SYS.DBMS_CRYPTO_FFI", line 67 ORA-06512: at "SYS.DBMS_CRYPTO", line 44 ORA-06512: at "APEX_040200.WWV_FLOW_CRYPTO", line 89 ORA-06512: at "APEX_040200.WWV_FLOW_INSTANCE_ADMIN", line 239
You can fix this by entering new password:
SYS@a411> exec apex_instance_admin.set_parameter('SMTP_PASSWORD','my smtp password'); PL/SQL procedure successfully completed. SYS@a411> exec apex_instance_admin.set_parameter('WALLET_PWD','my wallet password'); PL/SQL procedure successfully completed. SYS@a411> select apex_instance_admin.get_parameter('SMTP_PASSWORD') from dual; APEX_INSTANCE_ADMIN.GET_PARAMETER('SMTP_PASSWORD') ---------------------------------------------------------------------------------------------- my smtp password 1 row selected.
Kind regards
Christian -
How to make FUNCTION returns several columns and several outputs line
Hi all
Kindly share your idea; Thanks in advance;
I have the demo of the Table.
DEMO table:
name identity
1 to 10
1-a11
1-a12
2-b10
2-b11
3 ccc
and the function is like:
create or replace function (number of p1) return varchar2 as
number of vid;
VNAME varchar2 (20);
Start
SELECT id, name in vid, vname from demo where id = p1;
return v1;
end;
/
This function returns the output for the id = 3;
BUT,
I need output like (input 1)
VNAME vid
1 to 10
1-a11
1-a12A function returns a single data type.
This type of data can be a type of atomic data (varchar2, number etc.) or it may be a type of data object to save, or even a type of collection data.
Where will you use this feature? In PL/SQL or SQL?
If you are wanting to use it in SQL, need you a pipeline for example function
SQL> CREATE OR REPLACE TYPE myemp AS OBJECT 2 ( empno number, 3 ename varchar2(10), 4 job varchar2(10), 5 mgr number, 6 hiredate date, 7 sal number, 8 comm number, 9 deptno number 10 ) 11 / Type created. SQL> CREATE OR REPLACE TYPE myrectable AS TABLE OF myemp 2 / Type created. SQL> CREATE OR REPLACE FUNCTION pipedata(p_min_row number, p_max_row number) RETURN myrectable PIPELINED IS 2 v_obj myemp := myemp(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); 3 BEGIN 4 FOR e IN (select * 5 from ( 6 select e.* 7 ,rownum rn 8 from (select * from emp order by empno) e 9 ) 10 where rn between p_min_row and p_max_row) 11 LOOP 12 v_obj.empno := e.empno; 13 v_obj.ename := e.ename; 14 v_obj.job := e.job; 15 v_obj.mgr := e.mgr; 16 v_obj.hiredate := e.hiredate; 17 v_obj.sal := e.sal; 18 v_obj.comm := e.comm; 19 v_obj.deptno := e.deptno; 20 PIPE ROW (v_obj); 21 END LOOP; 22 RETURN; 23 END; 24 / Function created. SQL> select * from table(pipedata(1,5)); EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ---------- 7369 SMITH CLERK 7902 17-DEC-1980 00:00:00 800 20 7499 ALLEN SALESMAN 7698 20-FEB-1981 00:00:00 1600 300 30 7521 WARD SALESMAN 7698 22-FEB-1981 00:00:00 1250 500 30 7566 JONES MANAGER 7839 02-APR-1981 00:00:00 2975 20 7654 MARTIN SALESMAN 7698 28-SEP-1981 00:00:00 1250 1400 30 SQL> select * from table(pipedata(6,10)); EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ---------- 7698 BLAKE MANAGER 7839 01-MAY-1981 00:00:00 2850 30 7782 CLARK MANAGER 7839 09-JUN-1981 00:00:00 2450 10 7788 SCOTT ANALYST 7566 19-APR-1987 00:00:00 3000 20 7839 KING PRESIDENT 17-NOV-1981 00:00:00 5000 10 7844 TURNER SALESMAN 7698 08-SEP-1981 00:00:00 1500 0 30 SQL> select * from table(pipedata(11,15)); EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ---------- 7876 ADAMS CLERK 7788 23-MAY-1987 00:00:00 1100 20 7900 JAMES CLERK 7698 03-DEC-1981 00:00:00 950 30 7902 FORD ANALYST 7566 03-DEC-1981 00:00:00 3000 20 7934 MILLER CLERK 7782 23-JAN-1982 00:00:00 1300 10 SQL>
If you use it in PL/SQL and then just filling a data type of collection and return that will make. Although you should question why you want to pass large amounts of data around like that first.
Explain your purpose and what you intend to do and we can recommend the best way.
{message: id = 9360002}
-
The page validation: function returning a Boolean
Hi guys,.
I'm doing a page validation simple to check an element in my presentation table if it is a number or not:
START
FOR i IN 1.. apex_application.g_f12. COUNTY
LOOP
IF LENGTH (TRIM (TRANSLATE (apex_application.g_f12 (i), "0123456789","" "))) is NOT null
THEN
RETURN FALSE;
END IF;
END LOOP;
END;
but I get this error message if g_f12 = AAA:
ORA-06502: PL/SQL: digital or value error: character of number conversion error
ERR-1021 error cannot run the validation of the "body of the function that returns a Boolean.
Ok
If g_f12 = A12 or a mixed alphanumeric it will work!
* (I tried this with the function returning the text and it works like a charm, but in this case I have to use the function returns boolean to allow me to translate the error message) *.
am I doing something wrong please help
Thank youHello
Well, now when I look at the error message, I think that the problem is quite obvious.
Kind regards
Jari-----
My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
Twitter: http://www.twitter.com/jariolai -
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 appreciatedA function like this return error text should work:
Return (FN_VALIDATE_HR1_REF (: P1_GCI,: P1_HR1_REF));
Is giving the error?
-
How to use the function @RETURN for poster messages Essbase in 11.1.2.1
Hello
I found the business support Essbase Hyperion Planning 11.1.2.1 @RETURN rule novelty.
If I create a simple BR for planning app like below:
"@RETURN ("test return message,"WARNING);
Validation returns error and BR can not be deployed.
One is how to use the function @RETURN br?
Thank you!He probably should be in a calco for example block
"Profit".
(
....
)It is more likely to be used with an IF ELSE command, you do not want to define the condition for the calculation, roughly what the feature is designed for output.
See you soon
John
http://John-Goodwin.blogspot.com/
Maybe you are looking for
-
How to enable the GPU acceleration in firefox (Linux)
I want to enable hardware acceleration in firefox linux x 64 build Mozilla Firefox 36.0.4 version of the drivers NVIDIA 331 That's what I have tride http://AskUbuntu.com/questions/491750/force-enable-hardware-acceleration-in-Firefox
-
Toshiba Satellite Pro 6000 upgrade 802. 802 11 b. 11 g?
Is it possible to improve a 6000 Pro 802 Satellite. 11 b to 802.11 g by replacing the LAN card Wireless WiFi?
-
Hi all... I use hp envy 4 1201tx ultrabook. I plan to upgrade my RAM memory. I have 4 gigs of RAM with maximum possible memory to 16 gigs. Can I contact HP for the upgrade. Still on warranty.
-
How many IRQS are available on cRIO 9074?
How IRQS are available on the cRIO 9074? I'm sure it's obvious somehwere for most people, but I can't seem to find it. -Joe
-
I want to show the element as above. What I did... taken from an xml file and add the element as but the divider after each item. I guess as you wish something in the xml file. and showing lsitview as below ListView { dataModel: XmlDataModel { source