Variable issue, not declaring
Hi,
i've an issue on Production Environment. When i use a variable (both declaring or setting) i retrieve an error.
"com.sunopsis.core.SnpsInexistantObjectException: SnpSessTaskLog.getObjectByIdent : SnpSessTaskLog does not exist"
I've checked agent and connection to repo. Any idea?
Thanks in adavance
Hi,
For the record, I just had the same issue and in my case and purging the logs in the Operator was enough to solve the problem.
Regards,
Jerome Fr
Similar Messages
-
SP2-0552: Bind variable "SV_STUDENT_ID" not declared.
I get this error:
SP2-0552: Bind variable "SV_STUDENT_ID" not declared.
DECLARE
sv_student_id NUMBER;
v_student_id NUMBER := &sv_student_id;
v_enrolled VARCHAR2(3) := 'NO';
BEGIN
DBMS_OUTPUT.PUT_LINE ('Check if the student is enrolled');
SELECT 'YES'
INTO v_enrolled
FROM enrollment
WHERE student_id = v_student_id;
DBMS_OUTPUT.PUT_LINE ('The student is enrolled into one course');
EXCEPTION
WHEN NO_DATA_FOUND
THEN
DBMS_OUTPUT.PUT_LINE ('The student is not enrolled');
WHEN TO_MANY_ROWS
THEN
DBMS_OUTPUT.PUT_LINE ('The student is enrolled to many courses');
END;Define &sv_student_id;
DECLARE
v_student_id NUMBER := &sv_student_id;
v_enrolled VARCHAR2(3) := 'NO';
BEGIN
DBMS_OUTPUT.PUT_LINE ('Check if the student is enrolled');
SELECT 'YES'
INTO v_enrolled
FROM enrollment
WHERE student_id = v_student_id;
DBMS_OUTPUT.PUT_LINE ('The student is enrolled into one course');
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE ('The student is not enrolled');
WHEN TO_MANY_ROWS THEN
DBMS_OUTPUT.PUT_LINE ('The student is enrolled to many courses');
END; -
Bind variable "LOOP" not declared.
Hi,
I am very new to Pl/SQL.My job needs me to migrate MySQL database to Oracle(that I did successfully) but the procedures in the MySQL could not be migrated to Oracle,So have to create them manually.
While creating procedure,Am getting these errors
Error(4,1): PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following: begin function pragma procedure subtype type <an identifier> <a double-quoted delimited-identifier> current cursor delete exists prior The symbol "begin" was substituted for "DECLARE" to continue.
Error(5,1): PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following: begin function pragma procedure subtype type <an identifier> <a double-quoted delimited-identifier> current cursor delete exists prior
CREATE OR REPLACE PROCEDURE PROCEDURE1 AS
BEGIN
Declare v_date date;
Declare v_particulars varchar(50);
Declare v_quantity float default 0;
Declare v_item integer default 0;
Declare v_vendor integer default 0;
Declare v_flag integer default 1;
Declare v_supplier_id integer default null;
Declare v_unit integer default 0;
Declare v_srno integer default 0;
Declare op_date date;
declare op_bal float default 0;
Declare temp_v_from_date date;
Declare temp_v_to_date date;
Declare done integer default 0;
Declare cur1 cursor for (select sibs.opening_balance_date,'Opening Balance',sibs.item_id,
sum(sibs.opening_balance_qty), '1'from store_item_batch_stock sibs where sibs.opening_balance_date is not null
and sibs.department_id = v_depart and sibs.item_id = v_item_id group by sibs.item_id);
Declare cur2 cursor for (select sgm.grn_date, concat('Receipt',' - (',sgm.grn_no,')'), sgt.item_id,
sum(NVL((case d.formula when 1 then ((sgt.received_qty + sgt.free_qty) * sgt.mdq_value) / d.conversion_factor1
else (sgt.received_qty + sgt.free_qty) end),0)), '2',sgm.supplier_id,sgm.unit_id from store_grn_m sgm,
store_grn_t sgt, mas_store_item c, mas_store_item_conversion d
where sgm.grn_date between v_from_date and v_to_date and sgm.department_id = v_depart
and sgt.item_id = c.item_id and c.item_conversion_id = d.item_conversion_id and sgt.grn_master_id = sgm.grn_master_id
and sgt.item_id = v_item_id group by sgm.grn_master_id );
Declare cur3 cursor for (select sim.issue_date,concat('Issue',concat(' -(',concat(sim.issue_no,')'))), sit.item_issued,
sum(NVL(sit.qty_issued,0)), '3' from store_issue_m sim, store_issue_t sit
where sim.issue_date between v_from_date and v_to_date and sim.department_id = v_depart
and sit.issue_m_id = sim.id and sim.issue_type = 'i' and sit.item_issued = v_item_id
and sit.issued = 'y' group by sim.id );
Declare cur4 cursor for (select sgrm.return_date, 'Vendor Return', sgrt.item_id,
sum(NVL(sgrt.return_qty,0)), '3' from store_grn_return_m sgrm,store_grn_return_t sgrt
where sgrm.return_date between v_from_date and v_to_date and sgrm.department_id = v_depart
and sgrt.grn_return_id = sgrm.grn_return_id and sgrt.item_id = v_item_id group by sgrm.grn_return_id );
Declare cur5 cursor for (select sadm.adjustment_date, 'Adjustment',sadt.item_id,
sum(NVL(sadt.adjust_qty,0)), '2' from store_adjustment_m sadm,
store_adjustment_t sadt where sadm.adjustment_date between v_from_date and v_to_date
and sadm.department_id = v_depart and sadt.adjust_id = sadm.id and sadt.item_id = v_item_id
and sadt.adjust_qty != 0 group by sadm.id );
Declare cur6 cursor for (select sim.issue_date,'Receipt (Internal)', sit.item_issued,
sum(NVL(sit.qty_issued,0)), '2' from store_issue_m sim, store_issue_t sit
where sim.issue_date between v_from_date and v_to_date and sim.to_store = v_depart
and sit.issue_m_id = sim.id and sim.issue_type = 'i' and sit.item_issued = v_item_id
and sit.issued = 'y' group by sim.id );
declare cur7 cursor for (select siam.adjustment_date, 'Adjustment',siat.item_id,
sum(NVL(siat.adjusted_qty,0)), '2' from store_item_adjustment_m siam,
store_item_adjustment_t siat where siam.adjustment_date between v_from_date and v_to_date
and siam.adjustment_login_dept = v_depart and siat.item_adjustment_m_id = siam.item_adjustment_id
and siat.item_id = v_item_id and siat.adjusted_qty != 0 group by siam.item_adjustment_id
Declare oldcur1 cursor for (select sgm.grn_date, 'Receipt', sgt.item_id,
sum(NVL((case when d.formula =1 then ((sgt.received_qty + sgt.free_qty) * sgt.mdq_value) / d.conversion_factor1
else (sgt.received_qty + sgt.free_qty) end),0)), '2' from store_grn_m sgm,
store_grn_t sgt, mas_store_item c, mas_store_item_conversion d
where sgm.grn_date between '2009-03-31' and (v_from_date -1)
and sgm.department_id = v_depart and sgt.item_id = c.item_id and c.item_conversion_id = d.item_conversion_id
and sgt.grn_master_id = sgm.grn_master_id and sgt.item_id = v_item_id group by sgm.grn_master_id );
Declare oldcur2 cursor for (select sim.issue_date,'Issue', sit.item_issued,
sum(NVL(sit.qty_issued,0)), '3' from store_issue_m sim, store_issue_t sit
where sim.issue_date between '2009-03-31' and (v_from_date -1)
and sim.department_id = v_depart and sit.issue_m_id = sim.id and sim.issue_type = 'i'
and sit.item_issued = v_item_id and sit.issued = 'y' group by sim.id );
Declare oldcur3 cursor for (select sgrm.return_date, 'Return', sgrt.item_id, sum(NVL(sgrt.return_qty,0)), '2'
from store_grn_return_m sgrm, store_grn_return_t sgrt
where sgrm.return_date between '2009-03-31' and (v_from_date -1)
and sgrm.department_id = v_depart and sgrt.grn_return_id = sgrm.grn_return_id and sgrt.item_id = v_item_id group by sgrm.grn_return_id );
Declare oldcur4 cursor for (select sadm.adjustment_date, 'Adjustment',sadt.item_id,
sum(NVL(sadt.adjust_qty,0)), '2' from store_adjustment_m sadm, store_adjustment_t sadt
where sadm.adjustment_date between '2009-03-31' and (v_from_date -1) and sadm.department_id = v_depart
and sadt.adjust_id = sadm.id and sadt.item_id = v_item_id and sadt.adjust_qty != 0 group by sadm.id );
Declare oldcur5 cursor for (select sim.issue_date,'RCPT', sit.item_issued, sum(NVL(sit.qty_issued,0)), '3' from store_issue_m sim,
store_issue_t sit where sim.issue_date between '2009-03-31' and (v_from_date -1) and sim.to_store = v_depart
and sit.issue_m_id = sim.id and sit.item_issued = v_item_id and sit.issued = 'y' group by sim.id );
declare oldcur7 cursor for (select siam.adjustment_date, 'Adjustment',siat.item_id,
sum(NVL(siat.adjusted_qty,0)), '2' from store_item_adjustment_m siam,
store_item_adjustment_t siat where siam.adjustment_date between '2009-03-31' and (v_from_date -1)
and siam.adjustment_login_dept = v_depart and siat.item_adjustment_m_id = siam.item_adjustment_id and siat.item_id = v_item_id
and siat.adjusted_qty != 0 group by siam.item_adjustment_id
Declare closingStockUpdateCursor cursor for(select sno,date,qty,flag from ledger where dept_id = v_depart and item_id = v_item_id
and flag!=0 order by date );
Declare continue handler for not found set done =1;
delete from ledger where item_id = v_item_id and dept_id = v_depart;
Open cur1;
item_loop:loop
Fetch cur1 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then
Leave item_loop;
End if;
if not (v_date > v_from_date) then
set op_bal = v_quantity;
set op_date = v_date;
End if;
End loop item_loop;
Close cur1;
set done = 0;
Open oldcur1;
item_loop:loop
Fetch oldcur1 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then
Leave item_loop;
End if;
set op_bal = op_bal + v_quantity;
End loop item_loop;
Close oldcur1;
set done = 0;
Open oldcur2;
item_loop:loop
Fetch oldcur2 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then
Leave item_loop;
End if;
set op_bal = op_bal - v_quantity;
End loop item_loop;
Close oldcur2;
set done = 0;
Open oldcur3;
item_loop:loop
Fetch oldcur3 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then Leave item_loop;
End if; set op_bal = op_bal + v_quantity;
End loop item_loop;
Close oldcur3;
set done = 0;
Open oldcur4;
item_loop:loop
Fetch oldcur4 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then
Leave item_loop;
End if;
if op_date != v_date then
set op_bal = op_bal + v_quantity;
End if;
End loop item_loop;
Close oldcur4;
set done = 0;
Open oldcur5;
item_loop:loop
Fetch oldcur5 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then Leave item_loop;
End if;
set op_bal = op_bal + v_quantity;
End loop item_loop;
Close oldcur5;
set done = 0;
Open oldcur7;
item_loop:loop
Fetch oldcur7 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then Leave item_loop;
End if;
set op_bal = op_bal + v_quantity;
End loop item_loop;
Close oldcur7;
set done = 0;
insert into ledger(date, particulars,qty,item_id,dept_id,flag,closing_stock) values(v_from_date,'Opening Balance', op_bal, v_item_id,v_depart,'0',op_bal);
Open cur2;
item_loop:loop
Fetch cur2 into v_date, v_particulars, v_item, v_quantity, v_flag, v_supplier_id, v_unit;
If done =1 then
Leave item_loop;
End if;
insert into ledger(date, particulars,qty,item_id,flag,dept_id,vendor_id,closing_stock,unit_id) values(v_date,v_particulars, v_quantity, v_item,v_flag,v_depart,v_supplier_id,0,v_unit);
End loop item_loop;
Close cur2;
set done = 0;
Open cur3;
item_loop:loop
Fetch cur3 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then
Leave item_loop;
End if;
insert into ledger(date, particulars,qty,item_id,flag,dept_id,closing_stock) values(v_date,v_particulars,v_quantity, v_item,v_flag,v_depart,0);
End loop item_loop;
Close cur3;
set done = 0;
Open cur4;
item_loop:loop
Fetch cur4 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then
Leave item_loop;
End if;
insert into ledger(date, particulars,qty,item_id,flag,dept_id,closing_stock) values(v_date,v_particulars,v_quantity, v_item,v_flag,v_depart,0);
End loop item_loop;
Close cur4;
set done = 0;
Open cur5;
item_loop:loop
Fetch cur5 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then Leave item_loop;
End if;
insert into ledger(date, particulars,qty,item_id,flag,dept_id,closing_stock) values(v_date,v_particulars, v_quantity, v_item,v_flag,v_depart,0);
End loop item_loop;
Close cur5;
set done = 0;
Open cur6;
item_loop:loop
Fetch cur6 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then
Leave item_loop;
End if;
insert into ledger(date, particulars,qty,item_id,flag,dept_id,closing_stock) values(v_date,v_particulars, v_quantity, v_item,v_flag,v_depart,0);
End loop item_loop;
Close cur6;
set done = 0;
Open cur7;
item_loop:loop
Fetch cur7 into v_date, v_particulars, v_item, v_quantity, v_flag;
If done =1 then
Leave item_loop;
End if;
insert into ledger(date, particulars,qty,item_id,flag,dept_id,closing_stock) values(v_date,v_particulars, v_quantity, v_item,v_flag,v_depart,0);
End loop item_loop;
Close cur7;
set done = 0;
Open closingStockUpdateCursor;
item_loop:loop
Fetch closingStockUpdateCursor into v_srno,v_date, v_quantity, v_flag;
If done =1 then
Leave item_loop;
End if;
if v_flag = 2 then
set op_bal = op_bal + v_quantity;
else
set op_bal = op_bal - v_quantity;
end if;
update ledger set closing_stock = op_bal where sno = v_srno;
End loop item_loop;
Close closingStockUpdateCursor;
set done = 0;
END
NULL;
END PROCEDURE1;
/Please help where I am getting wrongAnother comment.
If two products are identical in features, there is nothing much to differentiate one from the other. And this is important as the differences between products are what drives the buyer's decision as to which one is the best.
There are major differences between Oracle and mySQL. Some of them core and fundamental differences. And this is what makes one product "better" than the other - and drives the decision on whether to use Oracle or mySQL.
Oracle makes a poor mySQL. It does the Oracle thing very well. So it does not make sense to take a design and code that works for mySQL, plonk it down on Oracle, and think that Oracle's differences will now make this design and code work and perform "better".
Everything but. As Oracle does a poor mySQL imitation, the end result of that will be a system that performs worse than what it did on mySQL.
To make use of that which makes Oracle "better" than mySQL, requires the application to be redesigned and code refactored.
So IMO, what you/your company are doing, is bound for failure. You will pay more money for a more sophisticated and very able RDBMS product - that is unable to reach its potential as you are asking it to pretend to be mySQL and to do that, better than mySQL. That is an epic fail. -
Hello.
This program is supposed to pull values from a table using a loop, and in the loop, put the values in objects in a varray. I'm new to objects and am stumped trying to get this program to run. When I attempt to run it in SQL*Plus I get the following feedback:
Type created.
Type body created
SP2-0552: Bind variable "MY_VARRAY_EMP1" not declared.
I don't think I even need a bind variable. Any feedback would be appreciated. Here's the program:
-- Enable screen I/O
SET SERVEROUTPUT ON SIZE 1000000
SET VERIFY OFF
-- begin object spec
CREATE OR REPLACE TYPE employee3 AS OBJECT
ename CHAR (20 char),
empno NUMBER (4),
sal NUMBER (10),
MEMBER FUNCTION get_ename RETURN CHAR, MEMBER PROCEDURE set_ename (SELF IN OUT NOCOPY employee3),
MEMBER FUNCTION get_empno RETURN NUMBER, MEMBER PROCEDURE set_empno (SELF IN OUT NOCOPY employee3),
MEMBER FUNCTION get_sal RETURN NUMBER, MEMBER PROCEDURE set_sal (SELF IN OUT NOCOPY employee3)
-- begin object body
CREATE OR REPLACE TYPE BODY employee3 AS
-- gets
MEMBER FUNCTION get_ename RETURN CHAR IS
BEGIN
RETURN self.ename;
END;
MEMBER FUNCTION get_empno RETURN NUMBER IS
BEGIN
RETURN self.empno;
END;
MEMBER FUNCTION get_sal RETURN NUMBER IS
BEGIN
RETURN self.ename;
END;
-- sets
MEMBER PROCEDURE set_ename(SELF IN OUT employee3) IS
BEGIN
self.ename := ename;
END;
MEMBER PROCEDURE set_empno(SELF IN OUT employee3) IS
BEGIN
self.empno := empno;
END;
MEMBER PROCEDURE set_sal(SELF IN OUT employee3) IS
BEGIN
self.sal := sal;
END;
END;
DECLARE
TYPE emp_varray IS VARRAY(10) OF EMPLOYEE3;
my_varray_emp1 EMP_VARRAY;
-- List of EMPNO's in order of appearance in EMP table (for cross-referencing, single-line retrieval)
TYPE MYCREF_VARRAY IS VARRAY(10) OF NUMBER(4);
varray_mycref MYCREF_VARRAY := MYCREF_VARRAY(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
this_object EMPLOYEE3;
-- make a variable to store one empno
thisno NUMBER(4);
-- make a counter
counter INT;
-- query variables for the set calls
q_ename CHAR(20 CHAR);
q_empno NUMBER(4);
q_sal NUMBER(10);
my_result INT;
BEGIN
--my_varray_emp1 := EMP_VARRAY(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-- Put the first 10 EMPNO's in my cref array
SELECT empno BULK COLLECT INTO varray_mycref FROM emp WHERE ROWNUM < 11;
-- Use a loop to retrieve the first 10 objects in the "emp" table and put them in the varray of objects
q_ename := NULL;
q_empno := NULL;
q_sal := NULL;
my_result := NULL;
this_object := NULL;
counter := 1;
FOR counter IN 1..10 LOOP
thisno := varray_mycref(counter);
this_object := my_varray_emp1(counter);
SELECT ename INTO q_ename FROM emp WHERE empno = thisno;
my_result := this_object.set_ename(q_ename, NULL);
SELECT empno INTO q_empno FROM emp WHERE empno = thisno;
my_result := this_object.set_empno(q_empno, NULL);
SELECT sal INTO q_sal FROM emp WHERE empno = thisno;
my_result := this_object.set_sal(q_sal, NULL);
END LOOP;
-- Use another loop to display the information in the reverse order.
FOR counter in REVERSE 1..10 LOOP
this_object =: my_varray_emp1(counter);
dbms_output.put_line((this_object.get_ename()) || CHR(9) || (this_object.get_empno()) || CHR(9) || (this_object.get_sal()));
END LOOP;
END;Cleaning up your code for errors and eliminating unnecessary complexity...
Add a user-defined constructor which takes all attributes and calls the "setter" procedures in one trip:
-- Enable screen I/O
set SERVEROUTPUT on size 1000000
set VERIFY off
-- begin object spec
create or replace type employee3 as object
ename CHAR (20 char),
empno NUMBER (4),
sal NUMBER (10),
constructor function employee3(
self in out nocopy employee3,
aEname in char,
aEmpNo in integer,
aSal in number
return self as result,
member function get_ename return CHAR, member procedure set_ename (SELF in out nocopy employee3, ename in char),
member function get_empno return NUMBER, member procedure set_empno (SELF in out nocopy employee3, empno in integer),
member function get_sal return NUMBER, member procedure set_sal (SELF in out nocopy employee3, sal in integer)
-- begin object body
create or replace type body employee3 as
constructor function employee3(
self in out nocopy employee3,
aEname in char,
aEmpNo in integer,
aSal in number
return self as result
is
begin
self.set_ename(aEname);
self.set_empno(aEmpNo);
self.set_sal(aSal);
return;
end;
-- gets
member function get_ename return CHAR is
begin
return self.ename;
end;
member function get_empno return NUMBER is
begin
return self.empno;
end;
member function get_sal return NUMBER is
begin
return self.sal;
end;
-- sets
member procedure set_ename(SELF in out employee3, ename in char) is
begin
self.ename := ename;
end;
member procedure set_empno(SELF in out employee3, empno in integer) is
begin
self.empno := empno;
end;
member procedure set_sal(SELF in out employee3, sal in integer) is
begin
self.sal := sal;
end;
end;
(Since I don't have EMP handy at the moment, create a simple view instead)
create or replace view emp
as
select 'EMP' || to_char(level) ename
, level + 100 empno
, DBMS_RANDOM.VALUE(25000,75000) sal
from DUAL
connect by
level <= 20
Get rid of your loop and individual SELECTs, and replace it with a single SELECT BULK COLLECT INTO...
declare
type emp_varray is varray(10) of EMPLOYEE3;
my_varray_emp1 EMP_VARRAY;
this_object EMPLOYEE3;
begin
-- No need for a loop. Use SELECT BULK COLLECT INTO, together with a user-defined constructor call (since the
-- user-defined constructor overrides the default constructor we need to call it using named-parameter notation):
select new employee3(
aEname => e.ename,
aEmpNo => e.empno,
aSal => e.sal
bulk collect into
my_varray_emp1
from emp e
where rownum <= 10;
-- Use another loop to display the information in the reverse order.
for counter in reverse 1..10 loop
this_object := my_varray_emp1(counter);
dbms_output.put_line((this_object.get_ename()) || chr(9) || to_char(this_object.get_empno()) || chr(9) || to_char(this_object.get_sal()));
end loop;
end;
EMP10
110 60110
EMP9
109 67485
EMP8
108 58242
EMP7
107 47597
EMP6
106 58995
EMP5
105 49098
EMP4
104 47406
EMP3
103 67574
EMP2
102 59663
EMP1
101 52929
PL/SQL procedure successfully completed.
Gerard -
hi all
declare jobno number;
BEGIN
DBMS_JOB.SUBMIT(:jobno,
'proc_mvref;',
SYSDATE, 'SYSDATE + 1');
commit;
END;
when i run this statement,I get the follwing error.
P2-0552: Bind variable "JOBNO" not declared.
But I cannot locate the error.
Thanks in Advancevariable jobno number
BEGIN
DBMS_JOB.SUBMIT(:jobno,
'proc_mvref;',
SYSDATE, 'SYSDATE + 1');
commit;
END;
print jobno
Now it'll work.
or
set serveroutput on
declare jobno number;
BEGIN
DBMS_JOB.SUBMIT(jobno, -- note the edit
'proc_mvref;',
SYSDATE, 'SYSDATE + 1');
dbms_output.put_line(jobno);
commit;
END;
This will work too...
Sybrand Bakker -
SP2-0552: Bind variable not declared
Hi,
I am using below bind values in a sql query.
declare
B1 number;
B2 varchar2(10);
B3 varchar2(10);
B4 number;
B5 date;
B6 date;
B7 varchar2(30);
B8 number;
B9 number;
B10 varchar2(9);
B11 number;
Begin
:B1 := 24152;
:B2 := 'CR_CORP';
:B3 := 'COST';
:B4 := 24152;
B5 := TO_DATE('01/29/12 23:20:34','MM/DD/YY HH24:MI:SS');
B6 := TO_DATE('02/27/12 21:10:58','MM/DD/YY HH24:MI:SS');
:B7 := 'BEGIN';
:B8 := 945142827;
:B9 := 483695;
:B10 := 'CR_CORP';
:B11 := 7;
End;
and even tried as below:
declare
variable B1 number;
variable B2 varchar2(30);
variable B3 varchar2(30);
variable B4 number;
B5 date;
B6 date;
variable B7 varchar2(30);
variable B8 number;
variable B9 number;
variable B10 varchar2(30);
variable B11 number;
Begin
:B1 := 24152;
:B2 := 'CR_CORP';
:B3 := 'COST';
:B4 := 24152;
B5 := TO_DATE('01/29/12 23:20:34','MM/DD/YY HH24:MI:SS');
B6 := TO_DATE('02/27/12 21:10:58','MM/DD/YY HH24:MI:SS');
:B7 := 'BEGIN';
:B8 := 945142827;
:B9 := 483695;
:B10 := 'CR_CORP';
:B11 := 7;
End;
Resulting in SP2-0552: Bind variable "B7" not declared.
Kindly help!Try this:
/* Formatted on 14-3-2012 12:02:31 (QP5 v5.163.1008.3004) */
DECLARE
B1 NUMBER;
B2 VARCHAR2 (10);
B3 VARCHAR2 (10);
B4 NUMBER;
B5 DATE;
B6 DATE;
B7 VARCHAR2 (30);
B8 NUMBER;
B9 NUMBER;
B10 VARCHAR2 (9);
B11 NUMBER;
BEGIN
B1 := 24152;
B2 := 'CR_CORP';
B3 := 'COST';
B4 := 24152;
B5 := TO_DATE ('01/29/12 23:20:34', 'MM/DD/YY HH24:MI:SS');
B6 := TO_DATE ('02/27/12 21:10:58', 'MM/DD/YY HH24:MI:SS');
B7 := 'BEGIN';
B8 := 945142827;
B9 := 483695;
B10 := 'CR_CORP';
B11 := 7;
SELECT /*+ USE_HASH(SUB_DD,BK) */
DH.ASSET_ID,
DH.CODE_COMBINATION_ID,
NULL,
DECODE (:B3,
'COST', CB.ASSET_COST_ACCT,
'CIP COST', CB.CIP_COST_ACCT,
'RESERVE', CB.DEPRN_RESERVE_ACCT,
'REVAL RESERVE', CB.REVAL_RESERVE_ACCT),
DECODE (
:B3,
'RESERVE', DECODE (DD.DEPRN_SOURCE_CODE, 'D', :B7, 'ADDITION'),
'REVAL RESERVE', DECODE (DD.DEPRN_SOURCE_CODE,
'D', :B7,
'ADDITION'),
:B7),
DECODE (:B3,
'COST', DD.COST,
'CIP COST', DD.COST,
'RESERVE', DD.DEPRN_RESERVE,
'REVAL RESERVE', DD.REVAL_RESERVE),
:B11
FROM FA_DEPRN_DETAIL DD,
FA_DISTRIBUTION_HISTORY DH,
FA_ASSET_HISTORY AH,
FA_CATEGORY_BOOKS CB,
FA_BOOKS BK,
( SELECT ASSET_ID, DISTRIBUTION_ID, MAX (PERIOD_COUNTER) MPC
FROM FA_DEPRN_DETAIL
WHERE BOOK_TYPE_CODE = :B2 AND PERIOD_COUNTER <= :B1
GROUP BY ASSET_ID, DISTRIBUTION_ID) SUB_DD
WHERE DH.BOOK_TYPE_CODE = :B10
AND DECODE (DD.DEPRN_SOURCE_CODE, 'D', :B6, :B5) BETWEEN DH.DATE_EFFECTIVE
AND NVL (
DH.DATE_INEFFECTIVE,
SYSDATE)
AND DD.ASSET_ID = DH.ASSET_ID
AND DD.BOOK_TYPE_CODE = :B2
AND DD.DISTRIBUTION_ID = DH.DISTRIBUTION_ID
AND DD.PERIOD_COUNTER <= :B1
AND DD.ASSET_ID BETWEEN :B9 AND :B8
AND DECODE (:B3,
'CIP COST', DD.DEPRN_SOURCE_CODE,
DECODE (:B7, 'BEGIN', DD.DEPRN_SOURCE_CODE, 'D')) =
DD.DEPRN_SOURCE_CODE
AND DD.PERIOD_COUNTER = SUB_DD.MPC
AND DD.DISTRIBUTION_ID = SUB_DD.DISTRIBUTION_ID
AND SUB_DD.ASSET_ID = DD.ASSET_ID
AND AH.ASSET_ID = DD.ASSET_ID
AND AH.ASSET_TYPE <> 'EXPENSED'
AND DECODE (DD.DEPRN_SOURCE_CODE, 'D', :B6, :B5) BETWEEN AH.DATE_EFFECTIVE
AND NVL (
AH.DATE_INEFFECTIVE,
SYSDATE)
AND CB.CATEGORY_ID = AH.CATEGORY_ID
AND CB.BOOK_TYPE_CODE = DD.BOOK_TYPE_CODE
AND BK.BOOK_TYPE_CODE = CB.BOOK_TYPE_CODE
AND BK.ASSET_ID = DD.ASSET_ID
AND DECODE (DD.DEPRN_SOURCE_CODE, 'D', :B6, :B5) BETWEEN BK.DATE_EFFECTIVE
AND NVL (
BK.DATE_INEFFECTIVE,
SYSDATE)
AND NVL (BK.PERIOD_COUNTER_FULLY_RETIRED, :B1 + 1) > :B4
AND DECODE (
:B3,
'COST', DECODE (AH.ASSET_TYPE,
'CAPITALIZED', CB.ASSET_COST_ACCT,
NULL),
'CIP COST', DECODE (AH.ASSET_TYPE,
'CIP', CB.CIP_COST_ACCT,
NULL),
'RESERVE', CB.DEPRN_RESERVE_ACCT,
'REVAL RESERVE', CB.REVAL_RESERVE_ACCT)
IS NOT NULL;
END;
/ HTH,
Thierry -
SP2-0552: Bind variable not declared error. Any help please?
Hi Experts,
I have a question regarding the error that I am getting: SP2-0552: Bind variable "V_COUNT_TOT_BAL" not declared.
I have 'out' parameters declared in my procedure and executing the same from sql script as shown below:
set ver off
set serverout on
set linesize 8000
Declare
Variable v_count_dtl_bal NUMBER(10);
Variable v_updat_dtl_bal NUMBER(10);
Variable v_count_tot_bal NUMBER(10);
Begin
execute load_abc.insert_abc_bal(:v_count_dtl_bal,:v_updat_dtl_bal,:v_count_tot_bal);
End;
exit;
So, when this sql script runs it given me the above error. However, all the result looks good and there's no problem with the data or anything else that might be impacted. I suspect this error stems from the code in the sql script above.
Any idea what am I doing wrong?
Thanks in advance for any inputs.Thanks Frank. I still receive the same error if I follow your example or any of the ones explained above. This is what I am getting and still an error underneath:
Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
VARCHAR2 (n CHAR) | NCHAR | NCHAR (n) |
NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
BINARY_FLOAT | BINARY_DOUBLE ] ]
Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
VARCHAR2 (n CHAR) | NCHAR | NCHAR (n) |
NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
BINARY_FLOAT | BINARY_DOUBLE ] ]
Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
VARCHAR2 (n CHAR) | NCHAR | NCHAR (n) |
NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
BINARY_FLOAT | BINARY_DOUBLE ] ]
SP2-0552: Bind variable "V_COUNT_TOT_BAL" not declared. -
Presentation variable is not supported in "SQL Issued"
hi, there is a presentation variable called @{ps_var} from a prompt
and I have written a custom sql and typed in "SQL Issued"
!http://img31.imageshack.us/img31/8673/customsql.jpg!
I found that the presentation variable is not supported in "SQL Issued" (exception flows when I clicked the "Set SQL" button.)
(in the captured screen, it is hardcoded as 'REPLACED_BY_PRESENTATION_VARIABLE', no error occurs when I clicked the "Set SQL" button. the result is correct.
however, when 'REPLACED_BY_PRESENTATION_VARIABLE' is replaced by @{ps_var}, exception flows when I clicked the "Set SQL" button.
is there an alternatives to avoid the error ? or any ways to assign the selected value from the prompt to this sql ?
thank you very much!Just set your presentation variable with an other method.
Check here you will find how you can set a presentation variable for a filter
http://gerardnico.com/wiki/dat/obiee/presentation_service/obiee_presentation_variable_area -
Bind variable not declared - please help
Hello,
I have wrote a PL/SQL script to update some order_id's in a table. I have declared all my variables but get an error -- bind variable not declared. Can anyone tell me what the problem might be?
DECLARE
last_ship DATE ;
last_order NUMBER;
last_cust NUMBER;
VARIABLE curr_item NUMBER;
VARIABLE curr_order NUMBER;
aorder_id CHAR(6);
aitem_id CHAR(2);
acust_id NUMBER(6);
aship_date DATE;
CURSOR c1 IS
SELECT
order_id,
item_id,
ship_date,
cust_id
FROM
test_sales
ORDER BY
1,2,3,4,5;
BEGIN
SELECT
MAX(order_id)
INTO
curr_order
FROM
sales_order;
OPEN c1;
LOOP
FETCH c1 INTO aorder_id, aitem_id, aship_date, acust_id;
EXIT WHEN c1%NOTFOUND;
last_cust := c1.cust_id; -- Saves the last values to check if processing same order
last_order := c1.aorder_id; --
last_ship := c1.aship_date; --
IF c1.aorder_id = last_order AND c1.cust_id = last_cust AND c1.ship_date = last_ship THEN
curr_item := curr_item +1;
UPDATE test_sales SET c1.aorder_id = :curr_order;
UPDATE test_sales SET c1.aitem_id = :curr_item;
ELSE
curr_order := curr_order + 1;
curr_item := 1;
UPDATE test_sales SET c1.aorder_id = :curr_order;
UPDATE test_sales SET c1.aitem_id = :curr_item;
END IF;
END LOOP;
CLOSE c1;
END;
/Cheers
Mikecheck yours code you are direct accesing cusrsor named directly which is not allowed
1 DECLARE
2 vemp emp.empno%TYPE;
3 vemp1 emp.empno%TYPE;
4 CURSOR c1 IS SELECT empno FROM emp;
5 BEGIN
6 OPEN c1;
7 LOOP
8 FETCH c1 INTO vemp;
9 EXIT WHEN c1%NOTFOUND;
10 vemp1:=c1.empno;
11 END LOOP;
12 CLOSE c1;
13* END;
SQL> /
vemp1:=c1.empno;
ERROR at line 10:
ORA-06550: line 10, column 14:
PLS-00225: subprogram or cursor 'C1' reference is out of scope
ORA-06550: line 10, column 4:
PL/SQL: Statement ignored
SQL> DECLARE
2 vemp emp.empno%TYPE;
3 CURSOR c1 IS SELECT empno FROM emp;
4 BEGIN
5 OPEN c1;
6 LOOP
7 FETCH c1 INTO vemp;
8 EXIT WHEN c1%NOTFOUND;
9 END LOOP;
10 CLOSE c1;
11 END;
12 .
SQL> /
PL/SQL procedure successfully completed.Yours code
OPEN c1;
LOOP
FETCH c1 INTO aorder_id, aitem_id, aship_date, acust_id;
EXIT WHEN c1%NOTFOUND;
last_cust:= c1.cust_id;
last_order:= c1.aorder_id;
END LOOP;
CLOSE c1;
END;You sholud move it c1.cust_id within fetch statment or
bind the cursor name with another local cursor variable
then fetch into this local bind variable and use cursor
via this variable
e.g
DECLARE
CUSRSOR c1 IS SELECT cust_id,aorderid
FROM <TABLE>;
c2 c1%ROWTYPE;
OPEN c1;
LOOP
FETCH c1 INTO c2;
aorder_id:=c2.aorderid;
last_cust:= c1.cust_id;
last_order:= c1.aorder_id;
END LOOP;
CLOSE c1;
END;Khurram -
I have a problem that’s driving me crazy. I apologize if this is beginner stuff, but I don’t know what to do.
It’s an ASP.NET Web Application. I’m using VS2013 Pro. I have a Web Form, WebForm1.aspx. It looks like this:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb"
Inherits="WebApplication2.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<%
Response.Write(MyVar)
%>
</div>
</form>
</body>
</html>
The code behind, WebForm1.aspx.vb, looks like this:
Public Class WebForm1
Inherits System.Web.UI.Page
Public MyVar = "Blah Blah"
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
End Class
And the error message I’m getting is: ' MyVar ' is not declared. It may be inaccessible due to its protection level. The error is in WebForm1.aspx.
Most maddening, sometimes it works, sometimes I get the error message.
What am I doing wrong?Hello AzraV,
Welcome to MSDN forum.
Your issue is out of support range of VS General Question forum which mainly discusses
the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
and Visual Studio Editor.
Because you are working with ASP.NET Web Application, I suggest that you can consult your issue on ASP.NET forum:
http://forums.asp.net/
for better solution and support.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Xsl variable error not explained in earlier thread
Steve,
Thank you so much for your response to my earlier thread, it is difficult to focus on what I am supposed to be doing today, with all the sad news from the east coast.
Re-visiting this variable issue one more time to try understand what is going wrong with this file.
Below is a shortened version of the file plus the output from parsing it with xalan, saxon and oracle's two latest versions. As you see it parses fine with xalan and saxon but errors out with oracle's latest version. Should this be looked at again perhaps?
xml file
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="UtilDataForm.xsl"?>
<page>
<dataform target="News.xsql" submit="SubmitButtonTitle">
<item type="checkboxlist" name="nameOfCheckBoxList" label="CheckBoxList">
<ROWSET>
<ROW><VALUE>4</VALUE><DISPLAY>This</DISPLAY></ROW>
<ROW><VALUE>5</VALUE><DISPLAY>That</DISPLAY></ROW>
<ROW><VALUE>6</VALUE><DISPLAY>The Other</DISPLAY></ROW>
</ROWSET>
</item>
</dataform>
</page>
xsl file
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!--
| UtilDataForm.xsl: Transform <dataform> structural info
| into a data-bound HTML Form
+-->
<xsl:template match="dataform">
<xsl:variable name="form-target">
<xsl:choose>
<xsl:when test="@target">
<xsl:value-of select="@target"/>
</xsl:when>
<xsl:when test="./target">
<xsl:value-of select="./target"/>
<xsl:if test="*">?</xsl:if>
<xsl:for-each select="*">
<xsl:value-of select="name(.)"/>
<xsl:text>=</xsl:text>
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:text>&;</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<center>
<form method="POST" action="{$form-target}">
<xsl:for-each select="item[@type='hidden']">
<input type="hidden" name="{@name}" value="{normalize-space(.)}"/>
</xsl:for-each>
<table>
<xsl:for-each select="item[@type != 'hidden']">
<tr>
<th align="right"><xsl:value-of select="@label"/></th>
<td>
<xsl:choose>
<xsl:when test="@type='text'">
<input type="text" name="{@name}"
value="{normalize-space(.)}">
<xsl:if test="@size">
<xsl:attribute name="size">
<xsl:value-of select="@size"/>
</xsl:attribute>
</xsl:if>
</input>
</xsl:when>
<xsl:when test="@type='password'">
<input type="password" name="{@name}"
value="{normalize-space(.)}">
<xsl:if test="@size">
<xsl:attribute name="size">
<xsl:value-of select="@size"/>
</xsl:attribute>
</xsl:if>
</input>
</xsl:when>
<xsl:when test="@type='textarea'">
<textarea class="code" rows="5" name="{@name}">
<xsl:if test="@size">
<xsl:attribute name="cols">
<xsl:value-of select="@size"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="normalize-space(.)"/>
</textarea>
</xsl:when>
<xsl:when test="@type='list'">
<xsl:variable name="default" select="default"/>
<select name="{@name}">
<xsl:for-each select="ROWSET/ROW">
<option value="{VALUE}">
<xsl:if test="VALUE=$default">
<xsl:attribute name="selected"/>
</xsl:if>
<xsl:value-of select="DISPLAY"/>
</option>
</xsl:for-each>
</select>
</xsl:when>
<xsl:when test="@ty pe='checkboxlist'">
<xsl:variable name="name" select="@name"/>
<xsl:for-each select="ROWSET/ROW">
<input type="checkbox" name="{$name}" value="{VALUE}">
<xsl:if test="SELECTED='Y'">
<xsl:attribute name="checked"/>
</xsl:if>
</input>
<xsl:value-of select="DISPLAY"/>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
</table>
<input type="submit" value="{@submit}"/>
</form>
</center>
</xsl:template>
</xsl:stylesheet>
xalan output
<?xml version="1.0" encoding="UTF-8"?>
<center><form action="News.xsql" method="POST"><table><tr><th align="right">CheckBoxList</th><td><input value="4"
name="nameOfCheckBoxList" type="checkbox"/>This
<input value="5" name="nameOfCheckBoxList"
type="checkbox"/>That
<input value="6" name="nameOfCheckBoxList" type="checkbox"/>The Other
</td></tr></table><input
value="SubmitButtonTitle" type="submit"/></form></center>
saxon output
<?xml version="1.0" encoding="utf-8"?>
<center><form method="POST" action="News.xsql"><table><tr><th align="right">CheckBoxList</th><td><input type="checkbox"
name="nameOfCheckBoxList" value="4"/>This
<input type="checkbox" name="nameOfCheckBoxList" value="5"/>That
<input
type="checkbox" name="nameOfCheckBoxList" value="6"/>The Other
</td></tr></table><input type="submit"
value="SubmitButtonTitle"/></form></center>
oraxsl with xmlparserv2.jar dated 06/19/01 10:09
<?xml version = '1.0'?>
<center><form method="POST" action="News.xsql"><table><tr><th align="right">CheckBoxList</th><td><input type="checkbox"
name="nameOfCheckBoxList" value="4"/>This
<input type="checkbox" name="nameOfCheckBoxList" value="5"/>That
<input
type="checkbox" name="nameOfCheckBoxList" value="6"/>The Other
</td></tr></table><input type="submit"
value="SubmitButtonTitle"/></form></center>
oraxsl with xmlparserv2.jar dated 08/04/01 20:24
file:/W:/workorders/util/UtilDataForm.xsl: XSL-1031: (Error) Variable not defined: 'name'.
oracle.xml.parser.v2.XPathException: Variable not defined: 'name'.
Error occurred while processing W:\workorders\util\FormTest.xsql: file:/W:/workorders/util/UtilDataForm.xsl: XSL-1031:
(Error) Variable not defined: 'name'.
Thank you again for your help!
Ola Kvalvaag
IS Administrator
CT&E Environmental Services Inc.Yeah!!! It works. Turned out to be a combination of DrKlap's and Martisan's suggestions -- had to change var frame's declaration from JFrame to MyFrame:
MyFrame frame;Next, created the external class -- but again changed JFrame references to MyFrame:
public class ShowOnExit extends WindowAdapter {
// JFrame aFrame;
MyFrame aFrame;
public ShowOnExit(MyFrame f) {
aFrame = f;
public void windowClosing(WindowEvent e)
System.out.println("Why me???" + aFrame.textArea.getText()); // aFrame here not frame !!!
}This worked. So looks like even though the original code added a WindowListener to 'frame', the listener didn't couldn't access frame's methods unless it was explicitly passed in as a parameter. Let me know if that's wrong.
Thanks again, all. -
Variable textArea not found in class javax.swing.JFrame...
Making progress on this issue -- but still stuck. Again trying to get the text from a JTextArea on exit:
frame.addWindowListener
(new WindowAdapter() {
public void windowClosing(WindowEvent e)
System.out.println("Why me???" + frame.textArea.getText());
});User MARSIAN helped me understand the scope fo the variables and now that has been fixed. Unfortunately I cannot access my variable textArea in the above code. If get this error:
Error: variable textArea not found in class javax.swing.JFrame
What am I doing wrong?
import java.net.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import FragImpl.*;
public class Framework extends WindowAdapter {
public int numWindows = 0;
private Point lastLocation = null;
private int maxX = 500;
private int maxY = 500;
JFrame frame;
public Framework() {
newFrag();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
maxX = screenSize.width - 50;
maxY = screenSize.height - 50;
makeNewWindow();
public void makeNewWindow() {
frame = new MyFrame(this); //*
numWindows++;
System.out.println("Number of windows: " + numWindows);
if (lastLocation != null) {
//Move the window over and down 40 pixels.
lastLocation.translate(40, 40);
if ((lastLocation.x > maxX) || (lastLocation.y > maxY)) {
lastLocation.setLocation(0, 0);
frame.setLocation(lastLocation);
} else {
lastLocation = frame.getLocation();
System.out.println("Frame location: " + lastLocation);
frame.setVisible(true);
frame.addWindowListener
(new WindowAdapter() {
public void windowClosing(WindowEvent e)
System.out.println("Why me???" + frame.textArea.getText());
//This method must be evoked from the event-dispatching thread.
public void quit(JFrame frame) {
if (quitConfirmed(frame)) {
System.exit(0);
System.out.println("Quit operation not confirmed; staying alive.");
private boolean quitConfirmed(JFrame frame) {
String s1 = "Quit";
String s2 = "Cancel";
Object[] options = {s1, s2};
int n = JOptionPane.showOptionDialog(frame,
"Windows are still open.\nDo you really want to quit?",
"Quit Confirmation",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
options,
s1);
if (n == JOptionPane.YES_OPTION) {
return true;
} else {
return false;
private void newFrag()
Frag frag = new FragImpl();
public static void main(String[] args) {
Framework framework = new Framework();
class MyFrame extends JFrame {
protected Dimension defaultSize = new Dimension(200, 200);
protected Framework framework = null;
private Color color = Color.yellow;
private Container c;
JTextArea textArea;
public MyFrame(Framework controller) {
super("New Frame");
framework = controller;
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setSize(defaultSize);
//Create a text area.
textArea = new JTextArea(
"This is an editable JTextArea " +
"that has been initialized with the setText method. " +
"A text area is a \"plain\" text component, " +
"which means that although it can display text " +
"in any font, all of the text is in the same font."
textArea.setFont(new Font("Serif", Font.ITALIC, 16));
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);
textArea.setBackground ( Color.yellow );
JScrollPane areaScrollPane = new JScrollPane(textArea);
//Create the status area.
JPanel statusPane = new JPanel(new GridLayout(1, 1));
ImageIcon icoOpen = null;
URL url = null;
try
icoOpen = new ImageIcon("post_it0a.gif"); //("doc04d.gif");
catch(Exception ex)
ex.printStackTrace();
System.exit(1);
setIconImage(icoOpen.getImage());
c = getContentPane();
c.setBackground ( Color.yellow );
c.add ( areaScrollPane, BorderLayout.CENTER ) ;
c.add ( statusPane, BorderLayout.SOUTH );
c.repaint ();
}Yeah!!! It works. Turned out to be a combination of DrKlap's and Martisan's suggestions -- had to change var frame's declaration from JFrame to MyFrame:
MyFrame frame;Next, created the external class -- but again changed JFrame references to MyFrame:
public class ShowOnExit extends WindowAdapter {
// JFrame aFrame;
MyFrame aFrame;
public ShowOnExit(MyFrame f) {
aFrame = f;
public void windowClosing(WindowEvent e)
System.out.println("Why me???" + aFrame.textArea.getText()); // aFrame here not frame !!!
}This worked. So looks like even though the original code added a WindowListener to 'frame', the listener didn't couldn't access frame's methods unless it was explicitly passed in as a parameter. Let me know if that's wrong.
Thanks again, all. -
Error: variable XMLInterface not found in class
Hi,
I am creating an XML Publisher Report Output from OAF Page.
This is my code in CustAM
public void initSunReportVO()
SunReportVOImpl vo = getSunReportVO1();
if(vo == null)
MessageToken errTokens[] = {
new MessageToken("OBJECT_NAME", "SunReportVO1")
throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
} else
vo.executeQuery();
public void getSunReportDataXML()
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
OAViewObject vo = (OAViewObject)findViewObject("SunReportVO1");
((XMLNode) vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
System.out.println(outputStream.toString());
catch(Exception e)
throw new OAException (e.getMessage());
I am getting the following errors.
Error(1608,27): variable XMLInterface not found in class XXX.oracle.apps.po.requisition.server.custamImpl
Could anyone help me how to resolve the above issues.
Thanks in Advance.
SruthiHi,
WebExpensesAMImpl$ExpenseTypeAmount is an inner class that you cannot access from outside of the class in which it is specified
Frank -
About ora-01006 :bind variable does not exist
Hi all of you,i have this dynamic sql :
DECLARE
v_query clob;
cpt number;
begin
v_query:='
SELECT
count(TBA.ANT_ID)
FROM
WHERE TBA.ANT_FUT_ID = TFT.FUT_ID
AND TBA.ANT_KATEGORIE_CODE_ID = TAKCL.ANT_KATEGORIE_CODE_ID(+)
AND TBA.ANT_KFZ_REIHEN_ID = TKR.KFZ_REIHEN_ID(+)
AND TBA.ANT_ID = F1.ANT_ANT_ID(+)
AND TBA.ANT_ID = F2.ANT_ANT_ID(+)
AND TBA.ANT_ID = F3.ANT_ANT_ID(+)
AND TBA.ANT_ID = ERS.ers_bdk(+)
AND TBA.ANT_ID = F1_2.ANT_ANT_ID(+)
AND TBA.ANT_ID = F2_3.ANT_ANT_ID(+)
AND TBA.ANT_ID = MFU.MFU_ANT_ID(+)
AND MFU.MFU_NIETGEOMETRIE_ID = NG.NG_ID(+)
AND MFU.MFU_MATRIZEN_BEICHNUNG_ID = MZB.MZB_ID(+)
-- Suchkriterien: --
--Ersteller
AND DECODE( ERS.ers_id, NULL, ''%'', ERS.ers_name ) LIKE DECODE('':1'',NULL,''%'','''')||''''|| :1 ||''''||DECODE('':1'',NULL,''%'','''')
--Fahrzeug
AND DECODE( TKR.NAME, NULL, ''%'', TKR.NAME ) LIKE DECODE('':2'',NULL,''%'','''')||''''|| :2 ||''''|| DECODE('':2'',NULL,''%'','''')
--BDK
AND DECODE( fuege_db.bdk_nummer( TBA.ANT_ID,''.'' ), NULL, ''%%'',
fuege_db.bdk_nummer( TBA.ANT_ID,''.'' ) ) LIKE ''%''||:3||''%''
--Technologie
AND TBA.ANT_FUT_ID LIKE DECODE('':4'',NULL,''%'','''')||''''|| :4 ||''''||DECODE('':4'',NULL,''%'','''')
--Art
AND ((TBA.ANT_WFP_ID is null and 1=DECODE('':5'',NULL,1,1,1) ) or (TBA.ANT_WFP_ID is not null and 2=DECODE('':5'',NULL,2,2,2)))
--VTA
AND TBA.ANT_VTA = decode('':6'',1,1,TBA.ANT_VTA) ';
execute immediate v_query
into cpt USING
'Dominik Hussmann',
'AU736_Q7_SUV' ,
'WPS Stahl',
'0';
end ;
In the execution,i have this error :ora-01006 :bind variable does not exist, after analyzing,i have found that the problem is with parameters :5 and :6 ,i don't understand they have the same syntax
as bind variables 1,2,3 and 4.
Than you for any suggestion.I hope you do realise that there are 13 bind-variables in your sql, not 6?
Variables are bound by position. You cannot use the same bind variable twice, they will be 2 distinct bind variables.
For example, you use :1 three times, so you need to provide three arguments, in this case three times the same value. -
I am getting this error message "ORA-01006: bind variable does not exist.
My code works fine like this:
DECLARE
v_JOBTYPE varchar2(8);
v_STATUS varchar2(8);
v_FAILURE varchar2(8);
v_CAUSE varchar2(8);
v_ACTION varchar2(8);
BEGIN
SELECT EVT_STATUS, EVT_FAILURE, EVT_CAUSE, EVT_ACTION, EVT_JOBTYPE
INTO v_STATUS, v_FAILURE, v_CAUSE, v_ACTION, v_JOBTYPE
FROM R5EVENTS WHERE ROWID = :ROWID;
IF NVL(v_STATUS, 'X') = 'C' AND NVL(v_JOBTYPE , 'X') IN ('BRKD','UNPLBRKD','FILTRA', 'LUB', 'FAC') AND (v_FAILURE IS NULL OR v_CAUSE IS NULL OR v_ACTION IS NULL) THEN
RAISE_APPLICATION_ERROR( -20001, 'FAILURE, CAUSE AND ACTION FIELDS MUST BE POPULATED');
END IF;
END;
But I want to change the code to include a record (ACT_TRADE) from another table(R5ACTIVITIES). I am getting this error message "ORA-01006: bind variable does not exist - POST-UPDATE 200Before Binding". Any help would be appreciated.
DECLARE
v_STATUS varchar2(8);
v_FAILURE varchar2(8);
v_CAUSE varchar2(8);
v_ACTION varchar2(8);
V_CODE varchar2(8);
V_EVENT varchar2(8);
V_TRADE varchar2(8);
BEGIN
SELECT R5EVENTS.EVT_STATUS, R5EVENTS.EVT_FAILURE, R5EVENTS.EVT_CAUSE, R5EVENTS.EVT_ACTION, R5EVENTS.EVT_CODE, R5ACTIVITIES.ACT_EVENT, R5ACTIVITIES.ACT_TRADE
INTO v_STATUS, v_FAILURE, v_CAUSE, v_ACTION, V_CODE, V_EVENT, V_TRADE
FROM R5EVENTS, R5ACTIVITIES WHERE V_CODE = :V_EVENT;
IF NVL(v_STATUS, 'X') = 'C' AND NVL(v_TRADE , 'X') IN ('MTM','MTL','MTMGT', 'FTM', 'FTL', 'FTMGT', 'R5') AND (v_FAILURE IS NULL OR v_CAUSE IS NULL OR v_ACTION IS NULL) THEN
RAISE_APPLICATION_ERROR( -20001, 'FAILURE, CAUSE AND ACTION FIELDS MUST BE POPULATED');
END IF;
END;Thank you for your responses. Your feedback was helpful. This is what I ended up doing for a solution:
DECLARE
v_JOBTYPE varchar2(8);
v_STATUS varchar2(8);
v_FAILURE varchar2(8);
v_CAUSE varchar2(8);
v_ACTION varchar2(8);
v_GROUP varchar2(30);
BEGIN
SELECT EVT_STATUS, EVT_FAILURE, EVT_CAUSE, EVT_ACTION, EVT_JOBTYPE, USR_GROUP
INTO v_STATUS, v_FAILURE, v_CAUSE, v_ACTION, v_JOBTYPE, v_GROUP
FROM R5EVENTS, R5USERS WHERE R5EVENTS.ROWID = :ROWID
AND USR_CODE = O7SESS.CUR_USER;
IF NVL(v_STATUS, 'X') = 'C' AND NVL(V_GROUP,'X') IN ('MTM','MTL','MTMGT','FTL','FTMGTS','PLANNER','DISPATCH','PMCOOR','R5') AND (v_FAILURE IS NULL OR v_CAUSE IS NULL OR v_ACTION IS NULL) THEN
RAISE_APPLICATION_ERROR( -20001, 'FAILURE, CAUSE AND ACTION FIELDS MUST BE POPULATED');
END IF;
END;
Maybe you are looking for
-
I ended up with Safari 2.0.4 after 10.4.11 update - help
I had Safaributtons installed with 2.0.4 and I ran software update. Update installed Safari 3.0.4 and it would crash whenever I tried to open it. So I removed Safari 3.0.4 and reinstalled 2.0.4 off the installer CD. Software update says I'm up to dat
-
Problem while creatin a site customer
dear all, I m facing a problem while creating Customer for the Site from WB01. The following Error is coming " KNVV_CHSPL does not exist in the status table (TMOD*)". Kindly help me solving this issue. Regards Harshita Saxena
-
Home page -- The page cannot display (port?)
Hi! When I installed the Oracle Database XE 10g it didn't ask me for a port number. When it was installed and complete then it asked me if i wanted to open the database home page. I marked the checkbox and pushed finish, an internet window opened and
-
Help! MacBook Air Nvidia Graphics 256 uninstall failure to boot up! Help Please!
Hello, I have a 2011 MacBook air with an Nvidia Graphics Geforce of some sortI was trying to install fallout 1 on the computer, but it said I need to uninstall the Nvidia 256 graphics updatethe thing did not turn on. Status bar on, then says panic on
-
Problem with pvkimprt.exe
Hi. I'm having trouble getting pvkimprt.exe to import my .spc and .pvk file. After I enter the password in the password dialog box, it errors out with: Error: 000004c0, The format of the specified password is invalid. I know the password is correct,