Variable not declared?
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.
Similar Messages
-
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 -
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. -
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 adavanceHi,
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 -
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; -
Variable not found in class - Newbie
public void executeSearch() {
try {
File startSearchDir = new File(directory);
} catch (NullPointerException npe) {
System.out.println("The file path entered is not valid.");
return;
File [] fileArray = startSearchDir.listFiles();
Why is the startSearchDir variable not found on the last line of this method?
Thanks,
DevonThis is the whole class. I have tried the previous suggestion but then I get a duplicate declaration for the variable.
package PgScan;
import java.awt.*;
import javax.swing.JPanel;
import java.io.*;
import java.lang.reflect.Array;
* Title: Page Scanner
* Description: Page scanner recurisively scans through subdirectories through a provided path and
* for a provided tag.
* Copyright: Copyright (c) 2001
* @author
* @version 1.0
public class PgScan extends JPanel {
BorderLayout borderLayout1 = new BorderLayout();
private String directory = "";
private String searchString = "";
public PgScan() {
try {
jbInit();
catch(Exception ex) {
ex.printStackTrace();
private void jbInit() throws Exception {
this.setLayout(borderLayout1);
//Main Method
public static void main(String[] args) {
PgScan pgScan1 = new PgScan();
//Properties
public String getDirectory() {
return directory;
public void setDirectory(String newDirectory) {
directory = newDirectory;
public String getSearchString() {
return searchString;
public void setSearchString(String newString) {
searchString = newString;
//Methods
public void executeSearch() {
try {
File startSearchDir = new File(directory);
} catch (NullPointerException npe) {
System.out.println("The file path entered is not valid.");
return;
File [] fileArray = startSearchDir.listFiles();
TIA,
Devon -
Hi!
I have a problem with List View Report in mobile application (theme 50 in apex) after updating to apex 4.2.2. I created Report -> List View. I used select from pipelined function in Region Source. Then when page is running and submited three times (or refreshed three times) I get an error:
Error during rendering of region "LIST VIEW".
ORA-01007: variable not in select list
Technical Info (only visible for developers)
is_internal_error: true
apex_error_code: APEX.REGION.UNHANDLED_ERROR
ora_sqlcode: -1007
ora_sqlerrm: ORA-01007: variable not in select list
component.type: APEX_APPLICATION_PAGE_REGIONS
component.id: 21230833903737364557
component.name: LIST VIEW
error_backtrace:
ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4613
ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3220
I get this error only when I use select from pipelined function in Region Source (for example: "select value1, value2 from table(some_pipelined_function(param1, param2)) ").
You can check it on http://apex.oracle.com/pls/apex/f?p=50591 (login - demo, password - demo).
In this application:
- I created package TAB_TYPES_PKG:
create or replace PACKAGE TAB_TYPES_PKG IS
TYPE cur_rest_r IS RECORD (
STR_NAME VARCHAR2(128),
INFO VARCHAR2(128)
TYPE cur_rest_t IS TABLE OF cur_rest_r;
END TAB_TYPES_PKG;
- I created pipelined function TEST_FUNC:
create or replace
FUNCTION TEST_FUNC
RETURN TAB_TYPES_PKG.cur_rest_t PIPELINED IS
r_cur_rest TAB_TYPES_PKG.cur_rest_r;
BEGIN
r_cur_rest.STR_NAME := 'ROW 1';
r_cur_rest.INFO := '10';
PIPE ROW (r_cur_rest);
r_cur_rest.STR_NAME := 'ROW 2';
r_cur_rest.INFO := '20';
PIPE ROW (r_cur_rest);
r_cur_rest.STR_NAME := 'ROW 3';
r_cur_rest.INFO := '30';
PIPE ROW (r_cur_rest);
r_cur_rest.STR_NAME := 'ROW 4';
r_cur_rest.INFO := '40';
PIPE ROW (r_cur_rest);
r_cur_rest.STR_NAME := 'ROW 5';
r_cur_rest.INFO := '50';
PIPE ROW (r_cur_rest);
RETURN;
END TEST_FUNC;
- I created List View Report on Page 1:
Region Source:
SELECT str_name,
info
FROM TABLE (TEST_FUNC)
We can see error ORA-01007 after refresing (or submiting) Page 1 three times or more.
How to fix it?Hi all
I'm experiencing the same issue. Predictably on every third refresh I receive:
Error
Error during rendering of region "Results".
ORA-01007: variable not in select list
Technical Info (only visible for developers)
is_internal_error: true
apex_error_code: APEX.REGION.UNHANDLED_ERROR
ora_sqlcode: -1007
ora_sqlerrm: ORA-01007: variable not in select list
component.type: APEX_APPLICATION_PAGE_REGIONS
component.id: 6910805644140264
component.name: Results
error_backtrace: ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4613 ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3220
OK
I am running Application Express 4.2.2.00.11 on GlassFish 4 using Apex Listener 2.0.3.221.10.13.
Please note: this works perfectly using a classic report in my desktop application; however, no joy on the mobile side with a list view. I will use a classic report in the interim.
My region source is as follows:
SELECT description AS "DESCRIPTION", reference AS "REFERENCE" FROM TABLE(AUTOCOMPLETE_LIST_VIEW_FNC('RESULTS'))
The procedure:
FUNCTION AUTOCOMPLETE_LIST_VIEW_FNC(
p_collection_name IN VARCHAR2)
RETURN list_row_table_type
AS
v_tab list_row_table_type := list_row_table_type();
BEGIN
DECLARE
jsonarray json_list;
jsonobj json;
json_clob CLOB;
BEGIN
SELECT clob001
INTO json_clob
FROM apex_collections
WHERE collection_name = p_collection_name;
jsonobj := json(json_clob);
jsonarray := json_ext.get_json_list(jsonobj, 'predictions');
FOR i IN 1..jsonArray.count
LOOP
jsonobj := json(jsonArray.get(i));
v_tab.extend;
v_tab(v_tab.LAST) := list_row_type(json_ext.get_string(jsonobj, 'description'), json_ext.get_string(jsonobj, 'reference'));
END LOOP;
RETURN(v_tab);
END;
END AUTOCOMPLETE_LIST_VIEW_FNC;
Thanks!
Tim -
Namespace prefix 'xdosxlt' used but not declared
I'm trying to remove duplicate data from my dataset (below)
<MAIN>
<PODATA>
<PRJ>..
</PRJ>
<PRJ>..
</PRJ>
</PODATA>
<PRJ>..
</PRJ>
<PRJ>..
</PRJ>
<PODATA>
</PODATA>
and followed code as given in below link but getting error message *"Namespace prefix 'xdosxlt' used but not declared"*
https://blogs.oracle.com/xmlpublisher/entry/removin_duplicates
In short:_
Added a variable as
<?variable:metrics;xdosxlt:distinct_values(PODATA)?>
and in for loop referring as
<?for-each:$metrics?><?sort:PONUMBER;'ascending';data-type='text'?>
I cannot change the SQL as I need data on 2 group levels separately.
Can you pls assist? I'm EBS 11i and BIP Template Builder for Word 10.1.3.4.2
Edited by: oraclepro73 on May 8, 2012 3:19 PMHi ,
When i tried
<?variable:metrics;xdosxlt:distinct_values(DISTRIBUTIONS_ROW)?>
i get an error, any idea please?
Thanks,
Husam -
Error in BatchLoad process - Object variable or with block variable not set
Hi All,
We are working on FDM version 11.1.1.3 with Essbase as a target system.
To automate the data load process, we are loading the batch loader feature.
I have taken the backload script from admin guide and it is working fine in our test environment.
When, I am trying to use the same script in our QA environment, we are getting the below error message-
Error: An error occurred running the script:
*91 - Object variable or with block variable not set*
At Line: 24
QA environment has same version as Test environment (11.1.1.3). In QA, it the same script which I am using in Test environment.
Please help us on this issue. Any help will be highly appreciated.
Thanks & Regards,
Mohit JainHi,
As suggested by you, I have placed the code given by you and now my scripts looks like-
'Declare Local Variables
Dim lngProcessLevel
Dim strDelimiter
Dim blnAutoMapCorrect
Dim BATCHENG
Set BATCHENG = CreateObject("upsWBatchLoaderDM.clsBatchLoader")
BATCHENG.mInitialize API, SCRIPTENG
'Initialize Variables
lngProcessLevel = 12 'Up-To-Check
strDelimiter = "~"
blnAutoMapCorrect = 0
'Create the file collection
Set BATCHENG.PcolFiles = BATCHENG.fFileCollectionCreate(CStr(strDelimiter))
'Execute a Standard Serial batch
BATCHENG.mFileCollectionProcess BATCHENG.PcolFiles, CLng(lngProcessLevel), , CBool(blnAutoMapCorrect)
But still, I am getting the same error.
Have I placed the your given code at wrong place? please help me on this.
Thanks a lot for your help!!
Thanks & Regards,
Mohit -
Variable not defined: '_XDOXSLTCTX'
Hi,
This is Rama krishna. I have implemented a prototype for barcode generation service using BI Publisher API. I am using Jdeveloper 11g. I have created a small ADF Fusion application to consume the webservice.
My application is working fine when I run it in Jdeveloper 11g.
When I run it after deploying to standalone Weblogic server 10.3, I am getting the following error while generating the XSL. I found that RTFProcessor did not generate xsl:params and xsl:variables.
020609_111410132http://oracle.apps.xdo.common.xml.XSLTWrapperEXCEPTION XSL error:
<Line 11, Column 170>: XML-22031: (Error) Variable not defined: '_XDOXSLTCTX'.
Any idea why RTFProcessor is not generating XSL properly when deployed to Oracle WLS 10.3?
Thanks in advance.
Thanks & Regards,
Rama Krishna. PAre you trying to use _XDOCTX?
Use the following syntax to declare/set a variable value:
<?xdoxslt:set_variable($_XDOCTX, 'variable name', value)?>
Use the following syntax to retrieve a variable value:
<?xdoxslt:get_variable($_XDOCTX, 'variable name')?> -
Variable not defined: '_MR'.
Dear all,
I developped an RTF-template that runs fine locally.
If I upload it to the eBusinessSuite and try to run it there, I receive the following error in the OPP log:
[UNEXPECTED] [24862:RT391458] java.lang.reflect.InvocationTargetException at ....
Caused by: oracle.xdo.parser.v2.XPathException: Variable not defined: '_MR'.
I did not define any variable _MR in my template.
However if I export my template to an XSL-FO Style Sheet, I can find this variable.
It is defined twice as: <xsl:variable name="_MR" select="number(89.85)" xdofo:alt="internal"/>
If I use an image in the heading, variable $_MR is used once in a statement that I don't understand.
If I remove the image, the variable is only declared, but never used.
In the eBS he is always wrong: with or without image.
Any help in this would be very appreciated.
Little update:
In the XSL-FO are several variables defined for each section in the template:
_PW = page with
_PH = page height
_ML = margin left
_MR = margin right
_MT = margin top
_MB = margin bottom
_HY ? something to do with header ?
_FY ? something to do with footer ?
May be this does ring a bell.Hi
I have a RTF template wherein I am calling a sub-template.
Whether I invoke the sub-template RTF directly (import:file) or convert it to XSL and import that (import:xsl), I always get this error
Caused by: oracle.xdo.parser.v2.XPathException: Variable not defined: '_MR'.
This happens in my local desktop, I have not even copied the files to server.
My Template Builder version is '5.6 Build 45'
Please help.
Ritu
Edited by: Rits on Oct 15, 2008 12:42 AM -
Variable not getting set?
'elo!
I have a slight problem when it comes to setting a variable. I guess it's some kind of variable-not-being-global-or-something-else-I-can't-figure-out-problem.
Anyway. What I have are two classes.
The first one is an extended JFrame that holds my GUI and some variables that I wanted to make sure every class could access. And that's what I thought I did.
Variable outside constructor, so that other methods can access it:
String characterName = "";Methods modifying that variable.
// Set char name
public void setCharName(String name) {
String characterName = name;
System.out.println("Char. name: " + characterName);
public String getCharName() {
System.out.println("Char. name: " + characterName);
return characterName;
}When this class creates an instance of the other class a reference to the JFrame is passed to what is actually an extend JPanel. In that JPanel is a JTextField. When enter is pushed getText() grabs the text and sends it to pf.setCharName() (pf = parent frame). That works, the print gives me a correct result in the console. However when I do pf.getCharName() I only get the "Char. name: " output. The variable characterName is empty. (and it doesnt't return anything.)
So what am I doing wrong here? I'm stuck!
/SimonString characterName = "";The 'characterName' String has already been defined in the object
// Set char name
public void setCharName(String name) {
String characterName = name;
System.out.println("Char. name: " + characterName);
}.In the 'setCharName' method, you are declaring another String 'characterName' again. This is considered as a local variable in the 'setCharName' method. That is the reason why it is not getting reflected in the getCharName method.
So, try this:
// Set char name
public void setCharName(String name) {
this.characterName = name;
System.out.println("Char. name: " + characterName);
}Now, since characterName is no longer a local variable in the 'setCharName' method, it should get reflected in the getCharName method.
Maybe you are looking for
-
How to Schedule a BPMN process to run at a particular time everyday?
I have a timer start event for a BPMN process. I am using BPM 11g. I want that my process should trigger automatically everyday at 7pm. Can anyone please assist how to achieve this. I have tried to put in Time Cycle tab, *0 Months 1 Days 19:0:0*, but
-
Hello guys, My G5 Chirrips and it gets picked up by my studio equipment. I've been told turning off napping will sort this. Is there anything I should be aware of when turning of 'napping' ? Cheers Mike
-
Unable to add XML files to genericObjects Folders using Webdav - cFolders
Hi All I am not able to add XML files to genericObjects Folders using Webdav in cFolders What could be the reason.. When I try to copy, it says "cant read from source file" Regards, Aby
-
I would like to update my iPad ti iOS how do I do that
Hi I would like to update my iPad to iOS how do I do that
-
Itunes always losing my music, driving me up the wall?
This is really getting on my nerves. I have reloaded the songs into itunes so many times that I have lost count, when the list of music comes up, I manually go in delete the song/album and reload it into itunes. I have a folder w/all my music on my