Execute a function inside XML
I have a Flash application that receives data from a php application in xml format. Would it be possible for me to call functions in flash that it receives in xml format?
Let's say the php application sends this:-
<data>
<command>gotoAndStop(15)</command>
</data>
Would I be able to get that function executed in the Flash application?
check: array access operator
check other:
http://74.125.155.132/search?q=cache:ew5e3NEOo1EJ:help.adobe.com/en_US/AS3LCR/Flash_10.0/o perators.html+array+access+operator+flash+cs4&cd=2&hl=en&ct=clnk&gl=us&client=firefox-a
Similar Messages
-
Executing function inside a procedure
I have a function like fun_a(a varchar) which returns a number
I execute the function in sql prompt by select fun_a('hello') from dual;
Now i have to execute that function inside a procedure and return the output of the function to a variable like the following
create or replace procedure x is
a number;
vsql varchar2(255);
i varchar2(40):='hello';
begin
vsql :='select fun_a('||i||') from dual';
execute immediate VSQL INTO a;
dbms_output.put_line(a);
end;
I am not getting the output . Please help me in thisOr even:
CREATE OR REPLACE PROCEDURE x
IS
vsql VARCHAR2(255);
i VARCHAR2(40) := 'EMP';
i1 VARCHAR2(40) := 'EMPNO';
a NUMBER := primary_check_fun(i, i1);
BEGIN
dbms_output.put_line(a);
END;or just for fun,
CREATE OR REPLACE PROCEDURE x
IS
vsql VARCHAR2(255);
i VARCHAR2(40) := 'EMP';
i1 VARCHAR2(40) := 'EMPNO';
BEGIN
dbms_output.put_line(primary_check_fun(i, i1));
END;
Well if we're going to extremes Will we could look at it and say that the parameters are pre-defined and just have...
exec dbms_output.put_line(primary_check_fun('EMP','EMPNO'));
;) -
How to execute a function and return the result into a bind variable
Hi,
I am trying to calculate the sum of salaries of all persons with a particular JOB_ID using a function TOTAL_INCOME(v_job_id).
create or replace function total_income
+(v_job_id IN varchar2)+
RETURN number IS
v_total number(6);
cursor get_sal is
select salary from employees
where job_id = v_job_id;
BEGIN
v_total := 0;
for emp in get_sal
loop
v_total := v_total emp.salary;+
end loop;
dbms_output.put_line('Total salary of '||v_job_id||' is: '|| v_total);
return v_total;
END;
Now I woud like to execute this function and assign the returned value into a bind variable test_sal
variable test_sal number(6)
SELECT total_income('AD_VP') into :test_sal FROM DUAL;
dbms_output.put_line('Total Sal:'||:test_sal);
This is returning the below errors:
SELECT total_income('AD_VP') into :test_sal FROM DUAL
*+
Error at line 0
ORA-01036: illegal variable name/number
dbms_output.put_line('Total Sal:'||:test_sal);
Error at line 3
ORA-00900: invalid SQL statement
Could someone help me what could be the problem?? Thanks for your time...Dear,
If everything you will do will be done inside PL/SQL (stored procedure or stored function) then you don't have to care about bind variable.
When using PL/SQL (static SQL) you will never encounter issues related to bind variables. PL/SQL itself takes care of your code and uses bind variables behind the scene.
The only situation where you have to look carefully to the use of bind variables within PL/SQL is when you use Dynamic sql into stored procedures or functions.
So, see in the light of the above comment, if you have to care about returning your function into a bind variable?
Best regards
Mohamed Houri -
Oracle Execution Time for function inside view
Hi Guys,
i would like to ask if i call a function inside a view , how does it behave in term of execution time and performance
For Example i have a view as below
create or replace view CUST.CUST_VIEW
select a.nice , a.getCustomDisplay(a.name,a.pin,a.dos,b.master_key) as custom from CUST.customer as a , CUST.master as b
where a.idno = b.main_id_no
AND the function look like this
create or replace function getCustomDisplay(a varchar2,b varchar2,c varchar2,d varchar2)
begin
select * from CUST.MAPPING_MATRIX order by idno asc;
for loop
//logic goes here to determine the result return from matrix
end
My Question is for example
1. If i do select * from CUST.CUST_VIEW ( return 1000 records for example ) , so the function getCustomDisplay will be executed 1000 times also right ( that means select * from CUST.MAPPING_MATRIX order by idno asc; will also be executed 1000 times ) ?
2. If i do select * from CUST.CUST_VIEW where rownum <= 20 , how many times getCustomDisplay() function will be executed ?
The reason i ask this because recently we saw a few million execution times per day from AWR report for this query
"select * from CUST.MAPPING_MATRIX order by idno asc;"
But when i investigate , and put a logger whenever it call getCustomDisplay , the query above as mention in item no 2 only will be executed as many as the record that will be returned from ( view + where condition ).
3. will it affect performance if my view return a lot of records ? or is there any way to improve it?
ThanksHi
i have other solutions that seems work for reducing number of execution times but do you think its scalable and feasible ?
CREATE OR REPLACE package body ACER.TYPE_CAT_PASS_UTIL_TEST as
*/* Private package data */*
TYPE g_rec IS RECORD (
id_no VARCHAR2 (4),
type_pass VARCHAR2 (3),
scheme_ind VARCHAR2 (5),
cat_pass VARCHAR2 (2),
entrepass VARCHAR2 (2),
display_type_pass VARCHAR2 (15),
display_cat_pass VARCHAR2 (5),
display_type_pass_desc VARCHAR2 (80),
rule_id VARCHAR2 (5)
TYPE g_tab_type IS TABLE OF g_rec INDEX BY BINARY_INTEGER;
g_tab g_tab_type;
i BINARY_INTEGER;
procedure initializeTypePassMatrix(test IN varchar2) as
begin
if(g_tab.COUNT < 1)then
FOR appln_rec in (
SELECT tb_type_cat_pass_matrix.id_no,
tb_type_cat_pass_matrix.type_pass,
tb_type_cat_pass_matrix.scheme_ind,
tb_type_cat_pass_matrix.cat_pass,
tb_type_cat_pass_matrix.entrepass,
tb_type_cat_pass_matrix.display_type_pass,
tb_type_cat_pass_matrix.display_cat_pass,
tb_type_cat_pass_matrix.display_type_pass_desc,
tb_type_cat_pass_matrix.rule_id
FROM tb_type_cat_pass_matrix ORDER BY id_no asc)
LOOP
dbms_output.put_line('g_tab.COUNT before insert: ' || g_tab.COUNT);
i := g_tab.COUNT + 1;
g_tab (i).id_no := appln_rec.id_no;
g_tab (i).type_pass := appln_rec.type_pass;
g_tab (i).scheme_ind := appln_rec.scheme_ind;
g_tab (i).cat_pass := appln_rec.cat_pass;
g_tab (i).entrepass := appln_rec.entrepass;
g_tab (i).display_type_pass := appln_rec.display_type_pass;
g_tab (i).display_cat_pass := appln_rec.display_cat_pass;
g_tab (i).display_type_pass_desc:= appln_rec.display_type_pass_desc;
g_tab (i).rule_id := appln_rec.rule_id;
DBMS_OUTPUT.put_line ('g_tab.count after insert: ' || g_tab.COUNT);
END LOOP;
else
DBMS_OUTPUT.put_line ('g_tab>=1, no need to initialize');
end if;
exception
when others then
dbms_output.put_line('error happen'||DBMS_UTILITY.format_error_backtrace);
Logger.ERROR('TYPE_CAT_PASS_UTIL.initializeTypePassMatrix',SQLCODE,SQLERRM || ' ' ||DBMS_UTILITY.format_error_backtrace,'SYSTEM');
end initializeTypePassMatrix;
procedure populateTypeCatPassFullDesc(typePass IN varchar2, schemeInd IN varchar2,catPass IN varchar2,entrePass IN varchar2, displayTypePass IN OUT varchar2,displayTypePassDesc IN OUT varchar2, displayCatPass IN OUT varchar2 )is
v_displayTypePass varchar2(15) :='-';
v_displayTypePassDesc varchar2(100) :='-';
v_displayCatPass varchar2 (2):='-';
v_type_pass varchar2(3) := '';
v_scheme_ind varchar2(5) := '';
v_cat_pass varchar2(2);
v_entrepass varchar2(2);
v_flag_valid_1 boolean:=false;
v_flag_valid_2 boolean:=false;
v_flag_valid_3 boolean:=false;
v_flag_valid_4 boolean:=false;
v_appln_rec g_rec;
begin
dbms_output.put_line('line 1');
initializeTypePassMatrix('test');
FOR nomor in g_tab.FIRST .. g_tab.LAST
LOOP
v_appln_rec := g_tab(nomor);
dbms_output.put_line('line 2.1');
v_flag_valid_1 :=false;
v_flag_valid_2 :=false;
v_flag_valid_3 :=false;
v_flag_valid_4 :=false;
v_type_pass := v_appln_rec.type_pass;
v_scheme_ind := v_appln_rec.scheme_ind;
v_cat_pass := v_appln_rec.cat_pass;
v_entrepass := v_appln_rec.entrepass;
dbms_output.put_line('line 2.2');
if(typePass = v_type_pass or v_type_pass = 'NA') then
v_flag_valid_1:= true;
end if;
if(schemeInd = v_scheme_ind or v_scheme_ind='NA') then
v_flag_valid_2 := true;
elsif(schemeInd is null and v_scheme_ind is null) then
v_flag_valid_2 := true;
end if;
if(catPass = v_cat_pass or v_cat_pass='NA') then
v_flag_valid_3 := true;
elsif(catPass is null and v_cat_pass is null) then
v_flag_valid_3 := true;
end if;
if(entrePass = v_entrepass or v_entrepass='NA') then
v_flag_valid_4 := true;
end if;
if(v_flag_valid_1 = true and v_flag_valid_2 = true and v_flag_valid_3 = true and v_flag_valid_4 = true) then
v_displayTypePass := v_appln_rec.display_type_pass;
v_displayCatPass := v_appln_rec.display_cat_pass;
v_displayTypePassDesc := v_appln_rec.display_type_pass_desc;
dbms_output.put_line('rule id got :'||v_appln_rec.rule_id);
dbms_output.put_line('rule no got :'||v_appln_rec.id_no);
exit when (0 = 0);
end if;
END LOOP;
displayTypePass := v_displayTypePass;
displayCatPass := v_displayCatPass;
dbms_output.put_line('1type:' || v_displayTypePassDesc);
displayTypePassDesc := v_displayTypePassDesc;
dbms_output.put_line('2type:' || displayTypePassDesc);
dbms_output.put_line('type:' || v_displayTypePass);
dbms_output.put_line('cat :' || v_displayCatPass);
exception
when others then
dbms_output.put_line('error happen'||DBMS_UTILITY.format_error_backtrace);
Logger.ERROR('TYPE_CAT_PASS_UTIL.populateTypeCatPass',SQLCODE,SQLERRM || ' ' ||DBMS_UTILITY.format_error_backtrace,'SYSTEM');
end populateTypeCatPassFullDesc;
function getDisplayTypePass(typePass IN varchar2, schemeInd IN varchar2,catPass IN varchar2,entrePass IN varchar2) return varchar2 is
v_displayTypePass varchar2(15) :='-';
v_displayTypePassDesc varchar2(100) :='-';
v_displayCatPass varchar2(2) :='-';
begin
populateTypeCatPassFullDesc(typePass,schemeInd,catPass,entrePass,v_displayTypePass,v_displayTypePassDesc,v_displayCatPass);
return v_displayTypePass;
exception
when others then
dbms_output.put_line('error happen'||DBMS_UTILITY.format_error_backtrace);
Logger.ERROR('TYPE_CAT_PASS_UTIL.populateTypeCatPass',SQLCODE,SQLERRM || ' ' ||DBMS_UTILITY.format_error_backtrace,'SYSTEM');
end getDisplayTypePass;
end TYPE_CAT_PASS_UTIL_TEST;
By Using like above even i do query on select * from <some_view) it will be only one execution for
SELECT tb_type_cat_pass_matrix.id_no,*
**tb_type_cat_pass_matrix.type_pass,**
**tb_type_cat_pass_matrix.scheme_ind,**
**tb_type_cat_pass_matrix.cat_pass,**
**tb_type_cat_pass_matrix.entrepass,**
**tb_type_cat_pass_matrix.display_type_pass,**
**tb_type_cat_pass_matrix.display_cat_pass,**
**tb_type_cat_pass_matrix.display_type_pass_desc,**
**tb_type_cat_pass_matrix.rule_id**
**FROM tb_type_cat_pass_matrix ORDER BY id_no asc*
the key point is the initializeTypePassMatrix function but it seems the variable only works for one session ?
if i open new session it will be reset again . -
I have problems for to use Start function inside a case structure.
I am doing data acquisition using the Config, Start and Read functions, all them inside a while loop. I want to use Config function only when certain conditions occur, so I put the function inside a case and no problem. But when I put the start function inside the same case, the acquisition is not good. Please view my attachment. My application is client-server type.
Attachments:
scope_server(config_start).vi 160 KBBoxer,
I checked your example and have several easy but important suggestions for you:
1.- First, make sure that the first time you initialize the VI, the AI Config and AI Start are executed, because based on the debug I made, your program doesn't do it, and this is very important.
2.- Add an AI Clear after the acquisition is done, so that you release the resources. This is a good programming technique, and may help you solve your issue.
3.- Add an Error Cluster, so that you know if an error occurred at some point of the acquisition. This will help you track the issue.
4.- What do you mean by "the acquisition is not good". What does it happen? What does it do? Do you get an error? <- This is the reason of step 3.
5.- Finally, if you have doubts
programming AI, check one of the shipping examples of LV. They can give you a much clearer idea.
Hope this helps,
L Aguila
Applications Engineeer
National Instruments -
How to call a function inside a class?
Hello, i am trying to fire a function onPress .. this
function is inside a class.
In this function i refer to another function inside the calss
to call a Tween. It never arrives in the second function.
I tried to make an example.
In the fla file i have:
var test:makeMovie = new makeMovie(this);
You will see a red squere and you can press on it. It should
run the tween class. Am i using the delegate class wrong?I always have to use test movie and trace a couple of times
each time I start to use Delegate.
It wraps function.apply I think, which I tend to use more
often.
try using:
Container.onPress = Delegate.create(this,setAlpha);
and then just
setTween()
inside your setAlpha....
That's conceptually how I think I would try it above if I was
doing something similar.
I'm not sure it would have the desired effect even if the
delegate was executed as you have it coded. Unless you want
setTween's execution scope to be the Container clip in which case
you might need to do what kglad said and change the Container
reference to 'this'.
The way you have it at the moment inside setAlpha the
Delegate.create is simply creating a function...and not excuting
it.
its like : function something(){trace('what')}
and not like : something();
Below is some quick code that helps show how things work.
Notice that I assigned the delegate function to mainFunc....so that
along with the last example might provide a clue. Just paste it on
a frame and take a look at what's happening. -
Call a function inside a package from a stored procedure
Hello:
I am kind of new to the stored procedure. Does anyone know how to call a function inside a package from another stored procedure?
I have a existing function (func_b) inside a package (pack_a) and it returns a cursor. I want to call this function from a stored procedure (proc_c) so that I use the data inside the cursor.
can I do the following in proc_c:
my_cursor1 SYS_REFCURSOR;
begin
my_cursor1 := exec pack_a.func_b
end
It will be very helpful if anyone can point me to any reading or example. Thank you very much for your information.guys:
Thank you for your information so far. I need some more help here. I was able to run the function in my stored procedure. However, I was not able to print the result on the screen to view the cursor result, although I am using dbms_output.put_line statement inside my stored procedure.
I use the following statement to execute my stored procedure on sql*plus. I can tell the stored procedure is executed successfully, but I did see anything printed:
DECLARE TEMP VARCHAR2(100);
BEGIN PROC_LAWS_CAD_NAME_SEARCH('LPD', 'TEST DEVICE ID', 'TEST LAST NAME', 'TEST FIRST NAME', 'F', '11112009', TEMP); END;
I tried to use 'set serveroutput on' and got the following error:
ERROR:
ORA-06502: PL/SQL: numeric or value error: host bind array too small
ORA-06512: at line 1
I am kind of confused now. thank you for your help.
Jack
Here is my procedure:
create or replace
PROCEDURE PROC_SEARCH
( AGENCY_ID IN VARCHAR2,
DEVICE_ID IN VARCHAR2,
L_NAME IN VARCHAR2,
F_NAME IN VARCHAR2,
SEX IN VARCHAR2,
DOB IN VARCHAR2,
CAD_NAME_SCH_RESULT_STR OUT VARCHAR2)
AS
v_agy_id varchar2(10);
v_device_id varchar2(20);
v_l_name varchar2(25);
v_f_name varchar2(15);
v_sex varchar2(1);
v_dob date;
-- this cursor is going to be used to store a list of warrant matching
-- name search criteria
cad_srch_cursor sys_refcursor;
objSrch SEARCH_RESULT_TEMP%ROWTYPE;
BEGIN
cad_srch_cursor := SEARCH_PKG.SEARCH('TESTING', 'TESTER', null, null,null, null, getPhonetic('TESTING'));
LOOP
FETCH cad_srch_cursor INTO objSrch;
EXIT WHEN cad_srch_cursor%NOTFOUND;
--insert into SEARCH_RESULT_TEMP (name_last) values (objSrch.name_last);
CAD_NAME_SCH_RESULT_STR := objSrch.name_last;
dbms_output.put_line('First:'||objSrch.name_first||':Last:'||objSrch.name_last||':Middle:'||objSrch.name_middle);
end LOOP;
END PROC_LAWS_SEARCH;
----------------------------------------- -
Custom aggregate function inside a package.
Hi there,
I'm trying to write a custom aggregate function and group that function inside a package together with some other functions that I have. As an example (to simulate the problem I have) suppose my custom aggregation to do a summation of numbers looks like:
CREATE OR REPLACE TYPE SUM_AGGREGATOR_TYPE AS OBJECT (
summation NUMBER,
STATIC FUNCTION ODCIAggregateInitialize(agg_context IN OUT
SUM_AGGREGATOR_TYPE) RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT SUM_AGGREGATOR_TYPE,
next_number IN NUMBER) RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT SUM_AGGREGATOR_TYPE,
para_context IN SUM_AGGREGATOR_TYPE) RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateTerminate(self IN SUM_AGGREGATOR_TYPE,
return_value OUT NUMBER, flags IN NUMBER) RETURN NUMBER
CREATE OR REPLACE TYPE BODY SUM_AGGREGATOR_TYPE IS
STATIC FUNCTION ODCIAggregateInitialize(agg_context IN OUT
SUM_AGGREGATOR_TYPE)
RETURN NUMBER IS
BEGIN
agg_context := SUM_AGGREGATOR_TYPE(NULL);
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT SUM_AGGREGATOR_TYPE,
next_number IN NUMBER)
RETURN NUMBER IS
BEGIN
IF self.summation IS NULL THEN
self.summation := next_number;
ELSIF summation IS NOT NULL THEN
self.summation := self.summation + next_number;
END IF;
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT SUM_AGGREGATOR_TYPE,
para_context IN SUM_AGGREGATOR_TYPE)
RETURN NUMBER IS
BEGIN
self.summation := self.summation + para_context.summation;
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateTerminate(self IN SUM_AGGREGATOR_TYPE,
return_value OUT NUMBER, flags IN NUMBER)
RETURN NUMBER IS
BEGIN
return_value := self.summation;
return ODCIConst.Success;
END;
END;
If I write the following function definition:
CREATE OR REPLACE FUNCTION MY_SUM(input NUMBER)
RETURN NUMBER PARALLEL_ENABLE AGGREGATE USING SUM_AGGREGATOR_TYPE;
and corresponding type declaration to test:
CREATE OR REPLACE TYPE VECTOR
IS
TABLE OF NUMBER;
this statement:
select my_sum(column_value) from table(vector(1, 2, 1, 45, 22, -1));
gives the correct result of 70. However, creating a package with the function definition:
CREATE OR REPLACE PACKAGE MY_FUNCTIONS AS
FUNCTION MY_SUM(input NUMBER)
RETURN NUMBER PARALLEL_ENABLE AGGREGATE USING SUM_AGGREGATOR_TYPE;
END;
and calling it via:
select MY_FUNCTIONS.my_sum(column_value) from table(vector(1, 2, 1, 45, 22, -1));
explodes with:
ORA-00600: internal error code, arguments: [17090], [], [], [], [], [], [], [], [], [], [], []
Is it possible to have custom aggregate functions nested inside package declarations?
I'm using Oracle 11g, Release 2 (11.2.0.1.0).HiddenName wrote:
Is it possible to have custom aggregate functions nested inside package declarations?Yes, it is possible, you have succesfuly created your function. Your problem is that the database throws ORA-600 on execute. And with ORA-600 you can do 2 things: 1) google ORA-600 17090 or 2) contact your Oracle Support.
You could also try to declare the function without PARALLEL_ENABLE - just to try to see if it changes anything. You can also try to call your function against a regular table with rows and columns - not against an collection type with table() operator.
Anyway - these 2 tests should be usefull for Oracle Support.
I never tried to put a custom aggregate function into a package. First - the cases when you need a custom aggregate function to be written for your system are very rare. Second - even if I needed 1 then I never needed 2 or more custom aggregate functions on my system. And as I do not like to make my life more complex than necessary, I have created it as a stand-alone function. And it is works (slowly).I tried using a standard table as you suggested:
CREATE TABLE TEST_DATA
test_value NUMBER
INSERT INTO TEST_DATA
(SELECT column_value test_value from TABLE(vector(1, 2, 1, 45, 22, -1)));
COMMIT;
select my_sum(test_value) from test_data;
select my_functions.my_sum(test_value) from test_data;
I also tried removing the PARALLEL_ENABLE clause to create the package as follows:
CREATE OR REPLACE PACKAGE MY_FUNCTIONS AS
FUNCTION MY_SUM(input NUMBER)
RETURN NUMBER AGGREGATE USING SUM_AGGREGATOR_TYPE;
END;
And unfortunately it still breaks with the following error: SQL Error: ORA-00600: internal error code, arguments: [17090]. This looks like an Oracle bug to me as the PL/SQL parsing engine should have disallowed me to even create this if it is not supported in Oracle. Instead, it allows me to create the package, and breaks when I call the function with this weird error (additionally cutting my connection from the database) instead of disallowing me to do this altogether and printing a nice error message telling me that Oracle doesn't support this. How would I go about logging a ticket for this?
Edited by: wcmatthysen on Dec 1, 2010 12:51 PM -
Can i write function inside a trigger?
My requirement is that i've to call a function inside a trigger. Since this function is not frequently used so what i am thinking that i should write this function inside trigger. Can i do that?
i know that function can be called inside trigger, but can i create a function inside trigger?
if yes, then how?
give me an overview. I'll appricate any kind of help.Hi,
jadoo wrote:
you mean to say that i can create a function in declaration section of trigger?Just an example,
SQL> select empno,sal, deptno
2 from emp
3 where empno=7369;
EMPNO SAL DEPTNO
7369 800 20
SQL> create table sal_inc_tab
2 (inc_empno number,
3 inc_sal number);
Table created.
SQL> create or replace trigger f_trg After update on emp
2 REFERENCING NEW AS NEW OLD AS OLD
3 FOR EACH ROW
4 Declare
5 v_inc_sal number;
6 function sal_inc (v_sal number)
7 return number as
8 Begin
9 return :new.sal+3000;
10 end sal_inc;
11 BEGIN
12 v_inc_sal:=sal_inc(:new.sal);
13 Insert into sal_inc_tab values(:new.empno,v_inc_sal);
14 end;
15 /
Trigger created.
SQL> select * from sal_inc_tab;
no rows selected
SQL> update emp
2 set deptno=10
3 where empno=7369;
1 row updated.
SQL> select * from sal_inc_tab;
INC_EMPNO INC_SAL
7369 3800You can do same thing without function. Here there was no specific logic as such, it was just to show you how this is executed.
Twinkle -
Call function inside running class
Hey All,
i have a two question in classes.
1- i have class and i called its before and its running on runtime. i need to call function inside this class from another class, but without call the first one again, because if i called it, it will run default class function again
is this doable ?
2- What super() mean ?
Thanks a lot.this is the default call, and when i call the method by this way its will run the default class function before call the method.
here my example:
i need to call checkboxes function in ChannelsMain class without pass by the grey script.
Note: the call_cb is working and the trace is working
so i now the class is running, i need to call the checkboxes without ( var ci:YourClass = new YourClass(); )
package com.link
import fl.controls.CheckBox;
import flash.events.*;
public class ChannelsMain
var cbLength:uint = Main.PV.channel_id.length;
public function ChannelsMain()
// constructor code
for (var i:int = 0; i < cbLength; i++)
var cb:CheckBox = new CheckBox;
cb.name = Main.PV.channel_id[i];
cb.label = Main.PV.channel_name[i];
cb.x = 50;
cb.y = 50 + i * 30;
cb.addEventListener(Event.CHANGE,call_cb);
Main.MS.addChild(cb);
//call xml function
if(i == cbLength - 1)
new ChannelsXML();
private function call_cb(evt:Event)
trace(evt.currentTarget.name,evt.currentTarget.selected);
public function checkboxes(evt)
trace(evt); -
Can I use table function inside Dynamic query ?
Dear Gurus,
I have following code
DECLARE
TYPE CRITERIA_LIST_TABLE AS TABLE OF VARCHAR2(20);
OtherNoList CRITERIA_LIST_TABLE; /* CRITERIA_LIST_TABLE is index by table*/
QUERY_STRING VARCHAR2(4000);
BEGIN
OtherNoList := CRITERIA_LIST_TABLE();
SELECT DISTINCT REGEXP_SUBSTR('1,5,6,4', '[^\,]+',1, LEVEL ) BULK COLLECT INTO OtherNoList
FROM DUAL
CONNECT BY LEVEL <= REGEXP_COUNT('1,5,6,4', '\,') + 1 ;
QUERY_STRING := 'INSERT INTO TAB1 (C1,C2) '||
'SELECT C1,'||
'C2 '||
'FROM TAB1 ,'||
'TABLE( '||
'CAST (OtherNoList AS CRITERIA_LIST_TABLE) '||
') OTHRNOS '||
'WHERE TAB1.C1 = OTHRNOS.COLUMN_VALUE ';
DBMS_OUTPUT.PUT_LINE('Query String is '||QUERY_STRING);
EXECUTE IMMEDIATE QUERY_STRING;
END;
Can I use Table function inside dynamic query.
Thanking in advance
SanjeevTry:
DECLARE
TYPE CRITERIA_LIST_TABLE AS TABLE OF VARCHAR2(20);
OtherNoList CRITERIA_LIST_TABLE; /* CRITERIA_LIST_TABLE is index by table*/
QUERY_STRING VARCHAR2(4000);
BEGIN
OtherNoList := CRITERIA_LIST_TABLE();
SELECT DISTINCT REGEXP_SUBSTR('1,5,6,4', '[^\,]+',1, LEVEL ) BULK COLLECT INTO OtherNoList
FROM DUAL
CONNECT BY LEVEL <= REGEXP_COUNT('1,5,6,4', '\,') + 1 ;
QUERY_STRING := 'INSERT INTO TAB1 (C1,C2) '||
'SELECT C1,'||
'C2 '||
'FROM TAB1 ,'||
'TABLE( '||
'CAST (:OtherNoList AS CRITERIA_LIST_TABLE) '||
') OTHRNOS '||
'WHERE TAB1.C1 = OTHRNOS.COLUMN_VALUE ';
DBMS_OUTPUT.PUT_LINE('Query String is '||QUERY_STRING);
EXECUTE IMMEDIATE QUERY_STRING using OtherNoList;
END;p.s. not tested
Amiel Davis -
How to find out list of procedures and functions inside a package
How I can find out the list of Procedures and Functions inside a Package.
Look at ALL_PROCEDURES and ALL_ARGUMENTS.
-
How to open labview program with Quit Labview function inside?
Hi Any idea how to open labview program with Quit Labview function inside?
I forgot to add and set the condition of the type for this program.
If the program is an application, it would close straight away.
If it is still labview work, it will go straight to editing program without closing.
So I need to recover, open it and make some changes.
Clement
Solved!
Go to Solution.Put the VI in a project and open it from there, then it shouldn't autorun. You can use App.kind property of application to decide whether to close or not.
/Y
LabVIEW 8.2 - 2014
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
G# - Free award winning reference based OOP for LV -
Error while executing the function module BAPI_RE_CN_CREATE
Dear All
I was using the the function module BAPI_RE_CN_CREATE. When I am trying to execute the function module I am getting the error message u201CBusiness transaction RECN doest existu201D. While inputting the parameters for the function module I have given RECN In the input field TRANS. Requesting you to please kindly suggest.
Regards.
VaraprasadHi Varaprasad,
please try the following.
1. Create a contract manually in the system
2. Use BAPI_RE_CN_GET_DETAIL to show how the fields and structures are filled.
3. Check and change the parameters for BAPI_RE_CN_CREATE accordingly.
Hope that helps.
Regards, Franz -
Error while executing the function
hi,
I have a table with the following data.
T_1 T_2 T_3 T_4
a.1 1 aa ff
a.1 2 ab ff
a.2 1 ba ff
a.2 2 bb ff
a.2 3 bc ff
a.2 4 bd ff
a.3 1 ca ff
a.3 3 cc ff
a.4 2 db ffi want the data in the following way.
col_1 col_2 col3
a.1 1,2 aa ,ab
a.2 1,2 ,3,4 ba,bb,bc,bd
a.3 1,3 ca,cc
a.4 2 db For this , i have written a package as shown below.
create or replace package t_emp_pkg as
type typ_emp is record
tv_t_1 t_Emp.t_1%type,
tv_t_2 varchar2(20),
tv_t_3 varchar2(20));
type typ_emp_tab is table of typ_emp;
function t_emp_func(pv_value in varchar2) return typ_emp_tab;
end t_emp_pkg;
create or replace package body t_emp_pkg as
function t_emp_func(pv_value in varchar2) return typ_emp_Tab is
cursor c1(v_value varchar2) is
select distinct t_1 from t_emp where t_4 = v_value ;
cursor c2(pv_t_1 varchar2) is
select t_2,t_3 from t_emp
where t_1 = pv_t_1;
typ_emp_table typ_emp_tab := typ_emp_tab();
t_count number := 0;
c1_cur_rec c1%rowtype;
c2_cur_rec c2%rowtype;
v_temp_value1 varchar2(30);
v_temp_value2 varchar2(30);
begin
open c1(pv_value);
loop
fetch c1 into c1_cur_rec;
exit when c1%notfound;
v_temp_value1 := null;
v_temp_value2 := null;
open c2(c1_cur_rec.t_1);
loop
fetch c2 into c2_cur_rec;
exit when c2%notfound;
v_temp_value1 := v_temp_value1||','||c2_cur_rec.t_2;
v_temp_value2 := v_temp_value2||','||c2_cur_rec.t_3;
end loop;
--close c2;
t_count := t_count+1;
typ_emp_table(t_count).tv_t_1 := c1_cur_rec.t_1;
typ_emp_table(t_count).tv_t_2 := v_temp_value1;
typ_emp_table(t_count).tv_t_3 := v_temp_value2;
--dbms_output.put_line(typ_emp_table(t_count).tv_t_1);
--dbms_output.put_line(typ_emp_table(t_count).tv_t_2);
--dbms_output.put_line(typ_emp_table(t_count).tv_t_3);
end loop;
close c1;
return typ_emp_table;
end;
end;
When i executed the function , i got the following error.
SQL> declare
2 v t_emp_pkg.typ_emp_tab := t_emp_pkg.typ_emp_tab();
3 begin
4 v := t_emp_pkg.t_emp_func('ff');
5 for i in v.first..v.last loop
6 dbms_output.put_line(v(i).tv_t_1 ||', '||v(i).tv_t_2||', '||v(i).tv_t_3);
7 end loop;
8 end;
9 /
declare
ERROR at line 1:
ORA-06533: Subscript beyond count
ORA-06512: at "SCOTT.T_EMP_PKG", line 30
ORA-06512: at line 4
but when i am running this queries in anonymous block (i.e) using declare,begin,end , i am getting the data correctly.
1 declare
2 pv_value varchar2(5) := 'ff';
3 cursor c1(v_value varchar2) is
4 select distinct t_1 from t_emp where t_4 = v_value ;
5 cursor c2(pv_t_1 varchar2) is
6 select t_2,t_3 from t_emp
7 where t_1 = pv_t_1;
8 --typ_emp_table typ_emp_tab := typ_emp_tab();
9 t_count number := 0;
10 c1_cur_rec c1%rowtype;
11 c2_cur_rec c2%rowtype;
12 v_temp_value1 varchar2(300);
13 v_temp_value2 varchar2(300);
14 begin
15 open c1(pv_value);
16 loop
17 fetch c1 into c1_cur_rec;
18 exit when c1%notfound;
19 v_temp_value1 := null;
20 v_temp_value2 := null;
21 open c2(c1_cur_rec.t_1);
22 loop
23 fetch c2 into c2_cur_rec;
24 exit when c2%notfound;
25 v_temp_value1 := v_temp_value1||','||c2_cur_rec.t_2;
26 v_temp_value2 := v_temp_value2||','||c2_cur_rec.t_3;
27 end loop;
28 close c2;
29 t_count := t_count+1;
30 --typ_emp_table(t_count).tv_t_1 := c1_cur_rec.t_1;
31 --typ_emp_table(t_count).tv_t_2 := v_temp_value1;
32 --typ_emp_table(t_count).tv_t_3 := v_temp_value2;
33 dbms_output.put_line(c1_cur_rec.t_1);
34 dbms_output.put_line(v_temp_value1);
35 dbms_output.put_line(v_temp_value2);
36 end loop;
37 close c1;
38* end;
39 /
a.2
,1,2,3,4
,ba,bb,bc,bd
a.3
,1,3
,ca,cc
a.4
,2
,db
a.1
,1,2
,aa,ab
PL/SQL procedure successfully completed.So can anybody tell me why it is not executing correctly when executing as a function.
Thanks in advance.hi devmiral,
I am not sure exactly where i am making the mistake. I have modified the package but still i am getting the error.
create or replace package body t_emp_pkg as
function t_emp_func(pv_value in varchar2) return typ_emp_Tab is
cursor c1(v_value varchar2) is
select distinct t_1 from t_emp where t_4 = v_value ;
cursor c2(pv_t_1 varchar2) is
select t_2,t_3 from t_emp
where t_1 = pv_t_1;
typ_emp_table typ_emp_tab ;
--:= typ_emp_tab();
t_count number := 0;
c1_cur_rec c1%rowtype;
c2_cur_rec c2%rowtype;
v_temp_value1 varchar2(30);
v_temp_value2 varchar2(30);
begin
open c1(pv_value);
loop
fetch c1 into c1_cur_rec;
exit when c1%notfound;
v_temp_value1 := null;
v_temp_value2 := null;
open c2(c1_cur_rec.t_1);
loop
fetch c2 into c2_cur_rec;
exit when c2%notfound;
v_temp_value1 := v_temp_value1||','||c2_cur_rec.t_2;
v_temp_value2 := v_temp_value2||','||c2_cur_rec.t_3;
end loop;
--close c2;
t_count := t_count+1;
typ_emp_table(t_count).tv_t_1 := c1_cur_rec.t_1;
typ_emp_table(t_count).tv_t_2 := v_temp_value1;
typ_emp_table(t_count).tv_t_3 := v_temp_value2;
typ_emp_table := typ_emp_tab(c1_cur_rec.t_1,v_temp_value1,v_temp_value2);
typ_emp_table.extend;
end loop;
close c1;
return typ_emp_table;
end;
end;
SQL> @t_emp_pkg_body.sql
Warning: Package Body created with compilation errors.
SQL> sho err
Errors for PACKAGE BODY T_EMP_PKG:
LINE/COL ERROR
36/1 PL/SQL: Statement ignored
36/18 PLS-00306: wrong number or types of arguments in call to
'TYP_EMP_TAB'
36/18 PLS-00306: wrong number or types of arguments in call to
'TYP_EMP_TAB'
36/18 PLS-00306: wrong number or types of arguments in call to
'TYP_EMP_TAB'Thanks in advance.
Maybe you are looking for
-
How can I change my iCloud account ?
So, here's the story: I changed my Apple e-mail ID because it was hacked, and I accidentally used that e-mail for my iCloud and forgot 'cause I don't use iCloud, and forgot the password for it. Now, I'm trying to restore my iPod but it says that I ne
-
I have the below code in my User control ASCX page. <form id="form1" runat="server"> <asp:ScriptManager runat="server"></asp:ScriptManager> <table> <tr> <td> <rsweb:ReportViewer ID="rvDracas" runat="server" Height=
-
How to add new tab page to equiment ?
Dear Guru's i created the new equipement category K by coping the standard S.when i am creating the equipment while using equipment category S i am getting tab pages General,Location,organization,structure,Sales and Distribution. But while using the
-
Left side of screen dim/slow response during standby
left side of screen gets dim during standby, slow to responde after awakened. anyone else experiencing this? By the way, I've had the screen replaced and the monitor (cable?) replaced as well. I tried to get a new machine but they said that I had to
-
Hello, I have iPad mini Retina 16gb with Cellular and a very annoying problem. Sometimes (3 times in February), when I use AppStore, I click on an app, a window with app's description appears and... I can't quit to AppStore! Normally, when the app's