Pass the parameter to the function onRelease
Hello
Is it possible to pass parameters to mc.onRelease?
Thank you
aobs
No, but is not necessary. You can assign properties to your movieclip and get back them in your onRelease:
mc.clickedNum = 0;
{mc.onRelease = function ()}
this.clickedNum ++;
}
Tags: Adobe Animate
Similar Questions
-
Pass a parameter to a function to use AS the operator in
I'm trying to pass a parameter to a function that uses the LIKE '% name_in % ',.
I don't know how to use...
the setting is called "name_in".
Thanks in advance,
MHello
Mehrdad says:
I'm trying to pass a parameter to a function that uses the LIKE '% name_in % ',.
I don't know how to use...the setting is called "name_in".
Your code should say:
... LIKE '%' || name_in || '%'
If name_in is inside the single quotes, it will mean the 7 characters literals 'n', 'a', ', 'e', '_', 'i' and 'n'.
You want to refer to the variable named name_id, in order to keep the name of the variable outside of the quotation marks. -
Pass the parameter to the functions called from a dll
Hi all
I am interfacing a motor controller for PMC - 100 through the Protocol of Performax using labwindows.
I need to explicitly link the PerformaxCom.dll and call functions with him. I'm calling this function
BOOL fnPerformaxComOpen (DWORD IN dwDeviceNum, OUT HANDLE * pHandle);
Faithful:
If you want to link explicitly, you can consult this article: http://zone.ni.com/devzone/cda/tut/p/id/8503
It has a code snippet that shows passing two parameters to a DLL function.
But as for your statement that "I don't know how to pass parameter to him", in the example, you reference, you pass a parameter: it's just a constant string rather than a variable.
-
How to pass parameter in the function using the select statement?
Hello
I had a problem. I can't pass as parameter to the function by using the select statement. But it can pass as a parameter using the "code". How can I solve this problem?
For example,.
Select * from table (SplitFunction ('HS750020, HS750021')) < < < this work.
but
Select * from table (SplitFunction (select LOT_NO in the TRACER_SEARCH_SCHEDULE where JOB_ID = '36')) < < < do not work.
Thank you for trying to help him. Thank you.Select * from table (SplitFunction (select LOT_NO in the TRACER_SEARCH_SCHEDULE where JOB_ID = '36'))< do="" not="">
Try like this
select * from table(select splitfunction(lot_no) from tracer_search_schedule where job_id='36')
Just make sure that your subquery returns only 1 row.
-
How to pass the value entered for the parameter IN a function
Hello
I'm new to pl/sql programming.
The function below is used inside a package and the package is called in visual studio.
The function uses the input parameters 2.
Out what "in_report_parameter_id" value comes through the application of service job processor.
The second IN the parameter values are hard coded into the function.
I am not able to understand this.
If the values are hard coded, how to ensure that only the hard coded values are the right ones?
Please could someone explain?
I don't really have good idea on how to move the INPUT parameter to the function or procedure
Is there any nice document that could give me good understanding about what are the ways or types we could transmit values to the input in the subprogrammes parameter?
Thanks in advance.
Published by: user10641405 on November 19, 2009 08:16CREATE OR REPLACE FUNCTION get_class_text_str ( in_report_parameter_id IN NUMBER, in_which IN VARCHAR2 DEFAULT 'SELECT' ) RETURN VARCHAR2 IS end_text VARCHAR2 (50) := ''; my_class_text_str VARCHAR2(10000) := ''; my_class_value_str VARCHAR2(10000) := ''; CURSOR class_text(c_1_text VARCHAR2, c_2_text VARCHAR2) IS SELECT c_1_text || report_parameters.report_parameter_value || c_2_text || report_parameters.report_parameter_value || '" ' FROM report_parameters WHERE report_parameters.report_parameter_id = 3690 AND report_parameters.report_parameter_group = 'CLASS' AND report_parameters.report_parameter_name = 'CLASS' GROUP BY report_parameters.report_parameter_value ORDER BY CAST(report_parameters.report_parameter_value AS NUMBER); BEGIN IF (in_which = 'SUM') THEN OPEN class_text ( 'SUM(NVL("Class ', '", 0)) "Class ' ); ELSIF (in_which = 'PERC')THEN OPEN class_text ( 'ROUND((("Class ', '" / "Total") * 100), 2) "Class ' ); end_text := ', DECODE("Total", -1, 0, 100) "Total" '; ELSE OPEN class_text ( 'SUM(DECODE(bin_id, ', ', bin_value, 0)) "Class ' ); END IF; LOOP FETCH class_text INTO my_class_value_str; EXIT WHEN class_text%NOTFOUND; my_class_text_str := my_class_text_str || ', ' || my_class_value_str; END LOOP; CLOSE class_text; my_class_text_str := my_class_text_str || end_text; RETURN my_class_text_str; END get_class_text_str; /
Published by: user10641405 on November 19, 2009 08:30This is not a conception I would use, but should work if coded correctly. I would probably create a reference text cursor query and use a fetch of open and close.
You have 2 input parameters, in_report_parameter_id and in_which. I could not find where in_report_parameter_id has been used in the program, but the value passed to in_which is used in the logic of the FI to decide on opening the cursor. After the cursor is opened lines are to be read and possibly the cursor is closed.
The in_which values are compared to the are hard-coded. It is the programming interface to ensure that the values are the values and the measures taken are also correct. Your program is assuming that if the first 2 values are not met the third listed is the one you want.
To pass values of entry in a procedure you simply provide the values as a literal or something like variable in the call,
whatever := get_class_text_str(1,'SELECT');
-
The execution of a function in the procedure, passed as parameter string
Hello
He must create a function, pass the name of the function to a procedure, and then run this function in the procedure.
For example:
Hello from the FUNCTION to CREATE or REPLACE
RETURN NUMBER
IS
BEGIN
RETURN 23;
END;
/
CREATE OR REPLACE PROCEDURE pro_fun (v_fun VARCHAR2, v_cal OUT NUMBER)
IS
BEGIN
v_cal: = exec v_fun; <-error on this line
END;
/
Now my plsql block annonymous where I'm passing function as sting of procedure:
DECLARE
VARCHAR2 (30) v1.
NUMBER of v2;
BEGIN
v1: = "Hello";
pro_fun (v1, v2);
DBMS_OUTPUT. Put_line ('VALUE IS' | v2);
END;
/
pro_fun (v1, v2);
*
ERROR on line 6:
ORA-06550: line 6, column 1:
PLS-00905: object SCOTT.PRO_FUN is not valid
ORA-06550: line 6, column 1:
PL/SQL: Statement ignored
How below line of procedure must be written to perform this function.
v_cal: = exec v_fun;
Try something like this:
create or replace function forum_hello return number
is
Start
Back to 123;
end forum_hello;
/
create or replace procedure forum_call_function (function_name_in in varchar2)
is
number of l_returnvalue;
Start
run immediately "begin: l: = ' |" function_name_in |'; end;' using l_returnvalue;
dbms_output.put_line (l_returnvalue);
end;
/
exec forum_call_function ('forum_hello')
Sincere greetings,
Patrick Barel
-
How to pass parameter in the function extract (for XMLTYPE)
I have a table with XMLTYPE field xml_column PROBLEMXML. In this column, there are many deffinitions for the problem. There is no amount deffinitions max and there can be no definition at all. I need to return all the definitions of all the problems a string wirh separate definitions by '; '.
Query
SELECT extract (prob. Def,'/definitions/definition[1]/@var'). ';'|| excerpt (prob. Def,'/definitions/definition[2]/@var')
OF PROBLEMXML j.
XMLTABLE)
"/ problem.
PASSAGE j.xml_column
Probid VARCHAR COLUMNS (31) PATH ' / problem/@id',
Prob def XMLTYPE PATH ' / problem/definitions ")
where PROBLEM_ID = 1;
Returns exactly what I want one; m.
But
declare
my_variable varchar2 (2000): = null;
number of N1;
number of N2;
Start
N1: = 1;
N2: = 2;
SELECT extract (prob. Def,'/definitions/definition[N1]/@var'). '|'|| excerpt (prob. Def,'/definitions/definition[N2]/@var') in my_variable
OF ETL_PROBLEMXML_STG_T j.
XMLTABLE)
"/ problem.
PASSAGE j.xml_column
Probid VARCHAR COLUMNS (31) PATH ' / problem/@id',
Prob def XMLTYPE PATH ' / problem/definitions ")
where PROBLEM_ID = 1;
dbms_output.put_line ($my_var);
end;
Returns null.
Is there a way to switch the setting to extract the function?You have string literal death of n1 and n2. Note the change to select it.
DECLARE my_var VARCHAR2(2000) := NULL; n1 NUMBER; n2 NUMBER; BEGIN n1 := 1; n2 := 2; SELECT extract(prob.def, '/Definitions/Definition[' || n1 || ']/@var') || '|' || extract(prob.def, '/Definitions/Definition[' || n2 || ']/@var') INTO my_var FROM etl_problemxml_stg_t j, xmltable('/problem' passing j.xml_column columns probid VARCHAR(31) path '/problem/@id', def xmltype path '/problem/Definitions') prob WHERE problem_id = 1; dbms_output.put_line(my_var); END;
Published by: RPuttagunta on December 13, 2010 09:18
-
Passing parameter to the function header javascript problem
Hi - I'm trying to pass a string to a javascript function. The javascript function is called an onchange
event in the attributes of a page element HTML form elements. The call looks like this:
OnChange = 'lookupObjTypeID ("P3_OBJECTTYPE_NAME")'; (Yes, I want to pass the name of the element, not its value)
The JavaScript looks like this:
< script LANGUAGE = "JavaScript" src = "http://www.json.org/json.js" > < / script >
< script type = "text/javascript" >
function lookupObjTypeID (source_item_name) {}
Alert ("running javascript");
Alert (' name of the Source element: ' | source_item_name);
}
< /script >
The first alert prints the message; the second alert but the source_item_name is null.
Everything I've seen, this is the right syntax. What's not?
Thank you
CarolCarol
Is the in js concatenation operator ' + '. Then
Alert (' name of the Source element: "+ source_item_name);
should work.
CITY
-
How to pass the Visa Resource Name parameter to labview dll in labwindows/cvi
Hello world
I build a dll of labview, the prototype is: double getchannelpower (double f, uintptr_t * VISAResourceName);
I don't know how to go from VISAResourceName to this function.
Is it related to the ViPSession paremeter in function viOpen(REES ViSession, rn ViRsrc, ViAccessMode am, ViUInt32 ti,ViPSession vi)?
BRs,
lotusky
Hey, guys:
I figured out how to pass the parameter.
In labview, you must replace the control of visa with string control. In this way, the generated dll function at the entrance of the string type.
I hope this will help others!
lotusky
-
In passing the huge parameter to oracle procedure have a performance hit?
I have a script attached, in which I am trying process/XML parsing in a table (STAGE_TBL) in the XMLTYPE column and insert the data analyzed in another table (PROCESSED_DATA_TBL). The XML file can be huge up to 2MB, which translates into approximately 2000 + lines of analyzed data. The issue I see is when I pass an XML object to a procedure (STAGE_TBL_PROCESS) to analyze its takes about 10 seconds per XML, but rather than from XML if I directly pick up table in the procedure (STAGE_TBL_PROCESS) passing the ID to be about 0.15 seconds. According to the document while params are passed by reference, so why is this variation of performance?
Details of database Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64-bit version of PL/SQL Production 11.2.0.3.0 - Production "CORE 11.2.0.3.0 Production" TNS for Linux: Version 11.2.0.3.0 - Production NLSRTL Version 11.2.0.3.0 - Production
Note: I could not perform SQL_TRACE or DBMS_STATS as I don't have access to them.
/*
This one is taking .15 seconds to process an XML with about 2000 rp_sendRow elements
*/
DECLARE
CURSOR NewStage IS
SELECT *
FROM STAGE_TBL
WHERE status = 'N'
ORDER BY PUT_TIME ASC;
SUBTYPE rt_NewStage IS NewStage % rowtype;
ROW_COUNT INTEGER := 0; -- Return value from calling the procedure
READ_COUNT INTEGER := 0; -- Number of rows read from the stage table
INSERT_COUNT_TOTAL INTEGER := 0; -- Number of Inserts Inven records
ERROR_COUNT INTEGER := 0; -- Number of Inven inserts that did inserted more then 1 row in Inven
PROCESS_STATUS STATUS.MmsStatus;
STATUS_DESCRIPTION STATUS.MmsStatusReason;
ERRMSG VARCHAR2(500);
PROCEDURE STAGE_TBL_PROCESS (IDDATA IN RAW, PROCESS_STATUS OUT VARCHAR2, STATUS_DESCRIPTION OUT VARCHAR2, ROW_COUNT OUT NUMBER) AS
/*
This procedure is to parse the XML from STAGE_TBL and populate the data from XML to PROCESSED_DATA_TBL table
IN PARAMS
----------
IDDATA - ID from STAGE_TBL
xData - XMLType field from XML_DOCUMENT of STAGE_TBL
OUT PARAMS
-----------
PROCESS_STATUS - The STATUS of parsing and populating PROCESSED_DATA_TBL
STATUS_DESCRIPTION - The description of the STATUS of parsing and populating PROCESSED_DATA_TBL
ROW_COUNT - Number of rows inserted into PROCESSED_DATA_TBL
*/
BEGIN
INSERT ALL INTO PROCESSED_DATA_TBL
(PD_ID,
STORE,
SALES_NBR,
UNIT_COST,
ST_FLAG,
ST_DATE,
ST,
START_QTY,
START_VALUE,
START_ON_ORDER,
HAND,
ORDERED,
COMMITED,
SALES,
RECEIVE,
VALUED,
ID_1,
ID_2,
ID_3,
UNIT_PRICE,
EFFECTIVE_DATE,
STATUS,
STATUS_DATE,
STATUS_REASON)
VALUES (IDDATA
,store
,SalesNo
,UnitCost
,StWac
,StDt
,St
,StartQty
,StartValue
,StartOnOrder
,Hand
,Ordered
,COMMITED
,Sales
,Rec
,Valued
,Id1
,Id2
,Id3
,UnitPrice
,to_Date(EffectiveDate||' '||EffectiveTime, 'YYYY-MM-DD HH24:MI:SS')
,'N'
,SYSDATE
,'XML PROCESS INSERT')
WITH T AS
( SELECT STG.XML_DOCUMENT FROM STAGE_TBL STG WHERE STG.ID = IDDATA)
-- This is to parse and fetch the data from XML
SELECT E.* FROM T, XMLTABLE('rp_send/rp_sendRow' PASSING T.XML_DOCUMENT COLUMNS
store VARCHAR(20) PATH 'store'
,SalesNo VARCHAR(20) PATH 'sales'
,UnitCost NUMBER PATH 'cost'
,StWac VARCHAR(20) PATH 'flag'
,StDt DATE PATH 'st-dt'
,St NUMBER PATH 'st'
,StartQty NUMBER PATH 'qty'
,StartValue NUMBER PATH 'value'
,StartOnOrder NUMBER PATH 'start-on-order'
,Hand NUMBER PATH 'hand'
,Ordered NUMBER PATH 'order'
,Commited NUMBER PATH 'commit'
,Sales NUMBER PATH 'sales'
,Rec NUMBER PATH 'rec'
,Valued NUMBER PATH 'val'
,Id1 VARCHAR(30) PATH 'id-1'
,Id2 VARCHAR(30) PATH 'id-2'
,Id3 VARCHAR(30) PATH 'id-3'
,UnitPrice NUMBER PATH 'unit-pr'
,EffectiveDate VARCHAR(30) PATH 'eff-dt'
,EffectiveTime VARCHAR(30) PATH 'eff-tm'
) E;
ROW_COUNT := SQL%ROWCOUNT; -- Not the # of all the rows inserted.
PROCESS_STATUS := STATUS.PROCESSED;
IF ROW_COUNT < 1 THEN -- The insert failed Row Count = 0 No exception thrown
PROCESS_STATUS := STATUS.ERROR;
STATUS_DESCRIPTION := 'ERROR Did not insert into Pos Inventory. Reason Unknown';
END IF;
EXCEPTION
WHEN OTHERS THEN
ROW_COUNT := 0;
PROCESS_STATUS := STATUS.ERROR;
STATUS_DESCRIPTION := 'SqlCode:' || SQLCODE || ' SqlErrMsg:' || SQLERRM;
END;
BEGIN
DBMS_OUTPUT.enable(NULL);
FOR A_NewStage IN NewStage
LOOP
READ_COUNT := READ_COUNT + 1;
STAGE_TBL_PROCESS(A_NewStage.ID, PROCESS_STATUS, STATUS_DESCRIPTION, ROW_COUNT);
INSERT_COUNT_TOTAL := INSERT_COUNT_TOTAL + ROW_COUNT;
IF(ROW_COUNT <= 0 OR PROCESS_STATUS = STATUS.ERROR) THEN
ERROR_COUNT := ERROR_COUNT + 1;
UPDATE STAGE_TBL
SET status = PROCESS_STATUS,
status_DATE = SYSDATE,
status_DESCRIPTION = STATUS_DESCRIPTION
WHERE ID = A_NewStage.ID;
ELSE
UPDATE STAGE_TBL
SET status = PROCESS_STATUS,
status_DATE = SYSDATE,
status_DESCRIPTION = STATUS_DESCRIPTION,
SHRED_DT = SYSDATE
WHERE ID = A_NewStage.ID;
END IF;
COMMIT;
END LOOP;
COMMIT;
IF ERROR_COUNT > 0 THEN
ERRMSG := '** ERROR: ' || ERROR_COUNT || ' Stage records did not insert in to the Processed table correctly';
RAISE_APPLICATION_ERROR(-20001,ErrMsg);
END IF;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END ;
/*
This one is taking 10 seconds to process an XML with about 2000 rp_sendRow elements
*/
DECLARE
CURSOR NewStage IS
SELECT *
FROM STAGE_TBL
WHERE status = 'N'
ORDER BY PUT_TIME ASC;
SUBTYPE rt_NewStage IS NewStage % rowtype;
ROW_COUNT INTEGER := 0; -- Return value from calling the procedure
READ_COUNT INTEGER := 0; -- Number of rows read from the stage table
INSERT_COUNT_TOTAL INTEGER := 0; -- Number of Inserts Inven records
ERROR_COUNT INTEGER := 0; -- Number of Inven inserts that did inserted more then 1 row in Inven
PROCESS_STATUS STATUS.MmsStatus;
STATUS_DESCRIPTION STATUS.MmsStatusReason;
ERRMSG VARCHAR2(500);
PROCEDURE STAGE_TBL_PROCESS (IDDATA IN RAW, xData IN STAGE_TBL.XML_DOCUMENT%TYPE, PROCESS_STATUS OUT VARCHAR2, STATUS_DESCRIPTION OUT VARCHAR2, ROW_COUNT OUT NUMBER) AS
/*
This procedure is to parse the XML from STAGE_TBL and populate the data from XML to PROCESSED_DATA_TBL table
IN PARAMS
----------
IDDATA - ID from STAGE_TBL
xData - XMLType field from XML_DOCUMENT of STAGE_TBL
OUT PARAMS
-----------
PROCESS_STATUS - The STATUS of parsing and populating PROCESSED_DATA_TBL
STATUS_DESCRIPTION - The description of the STATUS of parsing and populating PROCESSED_DATA_TBL
ROW_COUNT - Number of rows inserted into PROCESSED_DATA_TBL
*/
BEGIN
INSERT ALL INTO PROCESSED_DATA_TBL
(PD_ID,
STORE,
SALES_NBR,
UNIT_COST,
ST_FLAG,
ST_DATE,
ST,
START_QTY,
START_VALUE,
START_ON_ORDER,
HAND,
ORDERED,
COMMITED,
SALES,
RECEIVE,
VALUED,
ID_1,
ID_2,
ID_3,
UNIT_PRICE,
EFFECTIVE_DATE,
STATUS,
STATUS_DATE,
STATUS_REASON)
VALUES (IDDATA
,store
,SalesNo
,UnitCost
,StWac
,StDt
,St
,StartQty
,StartValue
,StartOnOrder
,Hand
,Ordered
,COMMITED
,Sales
,Rec
,Valued
,Id1
,Id2
,Id3
,UnitPrice
,to_Date(EffectiveDate||' '||EffectiveTime, 'YYYY-MM-DD HH24:MI:SS')
,'N'
,SYSDATE
,'XML PROCESS INSERT')
-- This is to parse and fetch the data from XML
SELECT E.* FROM XMLTABLE('rp_send/rp_sendRow' PASSING xDATA COLUMNS
store VARCHAR(20) PATH 'store'
,SalesNo VARCHAR(20) PATH 'sales'
,UnitCost NUMBER PATH 'cost'
,StWac VARCHAR(20) PATH 'flag'
,StDt DATE PATH 'st-dt'
,St NUMBER PATH 'st'
,StartQty NUMBER PATH 'qty'
,StartValue NUMBER PATH 'value'
,StartOnOrder NUMBER PATH 'start-on-order'
,Hand NUMBER PATH 'hand'
,Ordered NUMBER PATH 'order'
,Commited NUMBER PATH 'commit'
,Sales NUMBER PATH 'sales'
,Rec NUMBER PATH 'rec'
,Valued NUMBER PATH 'val'
,Id1 VARCHAR(30) PATH 'id-1'
,Id2 VARCHAR(30) PATH 'id-2'
,Id3 VARCHAR(30) PATH 'id-3'
,UnitPrice NUMBER PATH 'unit-pr'
,EffectiveDate VARCHAR(30) PATH 'eff-dt'
,EffectiveTime VARCHAR(30) PATH 'eff-tm'
) E;
ROW_COUNT := SQL%ROWCOUNT; -- Not the # of all the rows inserted.
PROCESS_STATUS := STATUS.PROCESSED;
IF ROW_COUNT < 1 THEN -- The insert failed Row Count = 0 No exception thrown
PROCESS_STATUS := STATUS.ERROR;
STATUS_DESCRIPTION := 'ERROR Did not insert into Pos Inventory. Reason Unknown';
END IF;
EXCEPTION
WHEN OTHERS THEN
ROW_COUNT := 0;
PROCESS_STATUS := STATUS.ERROR;
STATUS_DESCRIPTION := 'SqlCode:' || SQLCODE || ' SqlErrMsg:' || SQLERRM;
END;
BEGIN
DBMS_OUTPUT.enable(NULL);
FOR A_NewStage IN NewStage
LOOP
READ_COUNT := READ_COUNT + 1;
STAGE_TBL_PROCESS(A_NewStage.ID, A_NewStage.XML_DOCUMENT, PROCESS_STATUS, STATUS_DESCRIPTION, ROW_COUNT);
INSERT_COUNT_TOTAL := INSERT_COUNT_TOTAL + ROW_COUNT;
IF(ROW_COUNT <= 0 OR PROCESS_STATUS = STATUS.ERROR) THEN
ERROR_COUNT := ERROR_COUNT + 1;
UPDATE STAGE_TBL
SET status = PROCESS_STATUS,
status_DATE = SYSDATE,
status_DESCRIPTION = STATUS_DESCRIPTION
WHERE ID = A_NewStage.ID;
ELSE
UPDATE STAGE_TBL
SET status = PROCESS_STATUS,
status_DATE = SYSDATE,
status_DESCRIPTION = STATUS_DESCRIPTION,
SHRED_DT = SYSDATE
WHERE ID = A_NewStage.ID;
END IF;
COMMIT;
END LOOP;
COMMIT;
IF ERROR_COUNT > 0 THEN
ERRMSG := '** ERROR: ' || ERROR_COUNT || ' Stage records did not insert in to the Processed table correctly';
RAISE_APPLICATION_ERROR(-20001,ErrMsg);
END IF;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END ;
My XML with just one rp_sendRow element, it can go upto 2000 rp_sendRow elements
<?xml version = \"1.0\" encoding = \"UTF-8\"?>
<rp_send xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">
<rp_sendRow>
<store>0123</store>
<sales>022399190</sales>
<cost>0.01</cost>
<flag>true</flag>
<st-dt>2013-04-19</st-dt>
<st>146.51</st>
<qty>13.0</qty>
<value>0.0</value>
<start-on-order>0.0</start-on-order>
<hand>0.0</hand>
<order>0.0</order>
<commit>0.0</commit>
<sales>0.0</sales>
<rec>0.0</rec>
<val>0.0</val>
<id-1/>
<id-2/>
<id-3/>
<unit-pr>13.0</unit-pr>
<eff-dt>2015-06-16</eff-dt>
<eff-tm>09:12:21</eff-tm>
</rp_sendRow>
</rp_send>The issue I see is when I pass an XML object to a procedure (STAGE_TBL_PROCESS) to analyze its takes about 10 seconds per XML, but rather than from XML if I directly pick up table in the procedure (STAGE_TBL_PROCESS) passing the ID to be about 0.15 seconds.
In version 11.1, Oracle introduced a new model of storage for the data type XMLType called XML binary.
Binary XML become the default in 11.2.0.2, to disparage the old storage based on CLOB.
Binary XML is a format optimized after analysis for the storage and treatment of the XQuery.
When an XQuery expression is evaluated (through for example XMLTABLE) on an XMLType column stored as binary XML, Oracle can use an ongoing evaluation of XPath that surpasses the query even crushed a transitional XMLType of several order of magnitude.
You can see that in the action plan of the explain command:
SQL> SELECT E.* 2 FROM stage_tbl t 3 , XMLTABLE('rp_send/rp_sendRow' PASSING t.xml_document 4 COLUMNS store VARCHAR(20) PATH 'store' 5 , SalesNo VARCHAR(20) PATH 'sales' 6 , UnitCost NUMBER PATH 'cost' 7 ) E ; Execution Plan ---------------------------------------------------------- Plan hash value: 1134903869 -------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 2008 | 32 (0)| 00:00:01 | | 1 | NESTED LOOPS | | 1 | 2008 | 32 (0)| 00:00:01 | | 2 | TABLE ACCESS FULL| STAGE_TBL | 1 | 2002 | 3 (0)| 00:00:01 | | 3 | XPATH EVALUATION | | | | | | --------------------------------------------------------------------------------
When the query is executed on a passenger XMLType (for example, a parameter, or a PL/SQL variable), Oracle cannot run the binary model and use a functional assessment based on memory of the XML DOM-like representation.
You can see that in the plan to explain it by spoting a 'COLLECTION ITERATOR PICKLER FETCH' operation.
So what explains the difference (in your version) between treatment from a column of XMLType (stored in binary XML format) or a variable or a parameter.
From 11.2.0.4 and beyond, things have changed a bit with Oracle, introducing a new transitional level of optimization on XMLType.
The plan of the explain command will show a "XMLTABLE ASSESSMENT' in this case.
-
How to pass the value of an element in a function called by a procedure
Hello
I have a procedure named PROCEDURE AFFICHAGE_PLUVIO_VEILLE (sorry I don't know how to get in shape for the code):
{code: sql}create or replace PROCEDURE AFFICHAGE_PLUVIO_VEILLE AS
CURSOR curs1 is
Select the site, name, site_pluviometre clef_var
where EN_SERVICE = 'YES ';
number of stmt;
BEGIN
DELETE FROM PLUVIO_DATA;
for m loop curs1
stmt: = calc_pluvio (m.clef_var);
INSERT INTO pluvio_data values (m.clef_var, stmt);
end loop;
commit;
END AFFICHAGE_PLUVIO_VEILLE; {code}
This procedure calls a function:
{code: sql}create or replace function "CALC_PLUVIO" (station NUMBER)
return the number is the default number of 0 total.
BEGIN
WITH PRECIPITATION AS
(SELECT DATE1 RAINFALLDATE, VALUE
OF EVV_STPL
WHERE CLEF_VAR = station
AND TRUNC (DATE1) = TRUNC (sysdate-1))
SELECT SUM (TOTO) INTO CUMULATION
DE)
SELECT TRUNC (RAINFALLDATE) AS date,
VALUE,
(VALUE) AHEAD OF (TRUNC PARTITION (RAINFALLDATE)
ORDER BY RAINFALLDATE
) - VALUE AS TOTO
PRECIPITATION
)
WHERE TOTO > = 0
GROUP BY date;
DATE OF RETURN;
EXCEPTION
WHEN NO_DATA_FOUND THEN
TOTAL: = 0;
DATE OF RETURN;
END; {code}
You can see that the function uses 'sysdate-1' regarding the date. " In order to be more flexible with the date and to be able to use a date other than the date of the previous day, I would like to pass as a parameter to the function of the value of a page called P1_DATE.
But, how can I do? Function CALC_PLUVIO' is called by the stored procedure 'AFFICHAGE_PLUVIO_VEILLE of PROCEDURE' for which I can not transmit to any parameter as for example the P1_DATE element.
I use Application Express 5.0.1.00.06
Thank you for your help.
Chipniz wrote:
I have a procedure named AFFICHAGE_PLUVIO_VEILLE of PROCEDURE (sorry I don't know how to get in shape for the code):
Click on the link to the editor advanced usage in the top right of the edit box, select the code in the editor and choose the language desired from the syntax highlighting options in > toolbar button menu. (For SQL and PL/SQL code, use "SQL").
create or replace PROCEDURE AFFICHAGE_PLUVIO_VEILLE AS CURSOR curs1 is select site, nom, clef_var from site_pluviometre where EN_SERVICE = 'OUI'; stmt number; BEGIN DELETE FROM PLUVIO_DATA; for m in curs1 loop stmt := calc_pluvio (m.clef_var); INSERT INTO pluvio_data values (m.clef_var, stmt); end loop; commit; END AFFICHAGE_PLUVIO_VEILLE;
This procedure calls a function:
create or replace function "CALC_PLUVIO" (station in NUMBER) return number is cumul number default 0; BEGIN WITH RAINFALL AS (SELECT DATE1 RAINFALLDATE, VALEUR VALUE FROM EVV_STPL WHERE CLEF_VAR = station AND TRUNC (DATE1) = TRUNC (sysdate-1)) SELECT SUM (TOTO) INTO CUMUL FROM ( SELECT TRUNC (RAINFALLDATE) AS datte, VALUE, LEAD (VALUE) OVER ( PARTITION BY TRUNC (RAINFALLDATE) ORDER BY RAINFALLDATE ) - VALUE AS TOTO FROM RAINFALL ) WHERE TOTO >= 0 GROUP BY datte; RETURN CUMUL; EXCEPTION WHEN NO_DATA_FOUND THEN CUMUL := 0; RETURN CUMUL; END;
You can see that the function uses ' sysdate-1' regarding the date. " To be more flexible with the date and to be able to use a date other than the date of the previous day, I want to pass as a parameter to the function of the value of a page called P1_DATE.
But, how can I do? The CALC_PLUVIO function ' is called by the stored procedure 'AFFICHAGE_PLUVIO_VEILLE of PROCEDURE' for which I can not transmit to any parameter as for example the P1_DATE element.
What do you mean by "I can't pass any parameter"? That you cannot change the signatures of the procedure and function?
Passage of a parameter is the recommended approach. Including a default value will ensure that programs are backward compatible with existing code that does not it:
create or replace PROCEDURE AFFICHAGE_PLUVIO_VEILLE (p_rainfall_date in date default null) AS CURSOR curs1 is select site, nom, clef_var from site_pluviometre where EN_SERVICE = 'OUI'; stmt number; BEGIN DELETE FROM PLUVIO_DATA; for m in curs1 loop stmt := calc_pluvio (m.clef_var, p_rainfall_date); INSERT INTO pluvio_data values (m.clef_var, stmt); end loop; commit; END AFFICHAGE_PLUVIO_VEILLE;
create or replace function "CALC_PLUVIO" (station in NUMBER, p_rainfall_date in date default null) return number is cumul number default 0; rainfall_date date; BEGIN rainfall_date := trunc(coalesce(p_rainfall_date, sysdate-1)); WITH RAINFALL AS (SELECT DATE1 RAINFALLDATE, VALEUR VALUE FROM EVV_STPL WHERE CLEF_VAR = station AND TRUNC (DATE1) = calc_pluvio.rainfall_date) SELECT SUM (TOTO) INTO CUMUL FROM ( SELECT TRUNC (RAINFALLDATE) AS datte, VALUE, LEAD (VALUE) OVER ( PARTITION BY TRUNC (RAINFALLDATE) ORDER BY RAINFALLDATE ) - VALUE AS TOTO FROM RAINFALL ) WHERE TOTO >= 0 GROUP BY datte; RETURN CUMUL; EXCEPTION WHEN NO_DATA_FOUND THEN CUMUL := 0; RETURN CUMUL; END;
This code can be called APEX by:
AFFICHAGE_PLUVIO_VEILLE(p_rainfall_date => to_date(:p1_date, 'DD-MON-YYYY')); -- change format mask to that used in the P1_DATE item
Moreover, if the P1_DATE element is the only possible source of another value on the date of the rain, then the value can be referenced directly in the function:
create or replace function "CALC_PLUVIO" (station in NUMBER) return number is cumul number default 0; rainfall_date date; BEGIN rainfall_date := trunc(coalesce(v('P1_DATE'), sysdate-1)); WITH RAINFALL AS (SELECT DATE1 RAINFALLDATE, VALEUR VALUE FROM EVV_STPL WHERE CLEF_VAR = station AND TRUNC (DATE1) = calc_pluvio.rainfall_date) SELECT SUM (TOTO) INTO CUMUL FROM ( SELECT TRUNC (RAINFALLDATE) AS datte, VALUE, LEAD (VALUE) OVER ( PARTITION BY TRUNC (RAINFALLDATE) ORDER BY RAINFALLDATE ) - VALUE AS TOTO FROM RAINFALL ) WHERE TOTO >= 0 GROUP BY datte; RETURN CUMUL; EXCEPTION WHEN NO_DATA_FOUND THEN CUMUL := 0; RETURN CUMUL; END;
-
By the way the record as a parameter type to function
Hi all
I tried the below the example query for the record type as IN parameter works and I confused when calling the function.
Please find the code below
create or replace package pkg_rec is
type t_rec record is (ename, sal emp.sal%type emp.ename%type);
end;
create or replace function get_emp_sal (emprec pkg_rec.t_rec)
number is back
v_empno emp.empno%type;
Start
Select empno in v_empno
WCP
where ename = emprec.ename and sal = emprec.sal;
Return v_empno;
end;
-Block to call the function
declare
v_rec pkg_rec.t_rec;
v_empno emp.empno%type;
Start
v_rec. Ename: = 'SCOTT ';
v_rec. SAL: = 3000;
v_empno: = get_emp_det (v_rec); -Get the error "Expression is of the wrong type."
DBMS_OUTPUT. Put_line (' values ' | v_empno);
end;
You can please me to pass the parameter to function; referring
Thank you very much.
Is it typo?
Your function is called get_emp_sal, but you call get_emp_det.
Concerning
Marcus
-
How can I build and pass a variable to the function getField?
I need to know how to build and pass a variable to the function getField():
I have a form of several sections similar to a spreadsheet. Each section contains 5 rows of 11 columns. Currently I have calculations in the field I want to consolidate and move to the level of the document. The field names in each column are identical except for a row identifier. For example, in the 1st row: a_debtType1, a_debtTerm1, adebtRate1, etc. I want to be able to pass to a function of level document line identifier and that connect a function "getField. Here is an example:
Document-level:
function calculateLoan (lineNumber) {}
var myDate = getField("a_debtType"+lineNumber).valueAsString;
var myDate = getField("a_debtTerm"+lineNumber).valueAsString;
.. few treatment
return
}
Level of the form:
change the information in the form is ready for line 1
function calculateLoan("1");
Thanks in advance for any help.
It seems good except how you call the function of what you have. The calculation script should be something like:
Custom calculate script
calculateLoan("1");
Note that you can also get the line number if it is contained in behalf of the field that calls the script if you don't disturb him passing as parameter, assuming you named the fields correctly.
For example, to calculate the field is called "row_total.1", you can get the line number in the script like this:
var no_lig = event.target.name.split(".") [1] ;
-
Creating a function and passing the value of the query
I have what I thought, it was a pretty easy to resolve the situation: I want to concatenate two fields of the query, if the 2nd is not empty.
I created a function:
< name cfargument = "q1" value = "#query.q1 #" / > "
< name cfargument = "q1a' value =' #query.q1a #" / > "
< CFSET variables.myPunct = ":" > "
< cfset variables. ResultVar = "" >
< cfif QNE Trim (arguments.q1) "" > "".
< cfset variables. ResultVar =' #arguments.q1 # ">"
< / cfif >
< cfif QNE Trim (arguments.q1a) "" > "".
< cfif variable. ResultVar NEQ "" > "".
< cfset variables. ResultVar ='#variables. ResultVar & variables.myPunct # ">"
< / cfif >
< cfset variables. ResultVar ='#variables. ResultVar & arguments.q1a # ">"
< / cfif >
< variable cfreturn. ResultVar >
It's basically just the example they provide in online education, with the names have been changed.
In the strip of the details of my report, I have an expression builder containing field: report.mytestfunction)
When I run the present, I get: Q1 element is not defined in the ARGUMENTS.
I tried this ninety different ways (literally). It seems very clear to me that the query.q1 (Incidentally, none of the results of the query) are NOT passed to the function. I tried to make the expression: report.mytestfunction (query.q1). I tried to create an input parameter.
The documentation on this is ridiculously limited, given that the ability to implement conditional logic is entirely dependent on the 'function', I can say. I can in no way to get the function of interface with the query results. If the value fixed values in the service, rather than trying to use query variables, it shows very well.
Any ideas?Have you tried to remove the attribute "value" of your cfargument tag? The way I see it, you should have:
... rest of function...
And then you have to call it with: report.mytestfunction (query.q1, query.q1a)
-
How to pass the Javascript function OBJECT
Hello
I have 2 items.
P1_ITEM1onchange="javascript:function1(this); // here we are passing the object (THIS) for P1_ITEM1 {code} P1_ITEM2 {code} onchange="javascript:function2(this); // here we are passing the object (THIS) for P1_ITEM2 // how can I pass the object of P1_ITEM1. onchange="javascript:function3(xxxx); // here I want to pass the object for P1_ITEM1 {code} Thanks, Deepak
Deepak
Change the function definition for a pThis parameter to start - it's confusing otherwise.
For your last example, modify the parameters for the function to be () (Nothing) and then have the first line of another function as
var pThis = document.getElementById('P1_ITEM1');
Then use pThis as object...
See you soon
Ben
Maybe you are looking for
-
Video or all simply fails at it does not record my 3D Qosmio X 775
Hello I have a Qosmio x 775 with webcams stereo but when I try to record 3D video he stutters everything goes full screen and distorted shows 2 video screens and saves the video side by side... that when I use the Toshiba 3D player, it just shows he
-
Block diagram of... block diagram
Hi, I need your help. IM the wrong person for this post, but I have to do, so I depend on your help. I need to explain how LabView (pasted below) program works, but I don't understand it myself I would like to ask if someone can create a simplified b
-
WPS 9 does not print several pages
How to print multiple pages of the same document WPS (9)? It prints one even if I choose more than one. I have HP psc 1315xi printer.
-
How can I connect the FAX 1240 to my laptop and use it as a printer?
-
How can I send music Pandora from my phone to my laptop speakers via Bluetooth? I added the device. My Samsung-SM-G900V says it is paired but on my computer Dell laptop running Windows 7, I have open devices and printers then do a right click on th