PLS-00488: invalid variable declaration: object 'SHARED_REC' must be a typ
Hello,
I need to pass a plsql table as IN parameter for a procedure which is part of a Package. So, I did following in package spec.
CREATE OR REPLACE PACKAGE APPS.cxs_source
AS
TYPE type_shared_rec IS RECORD (
total_indexes NUMBER,
total_tables NUMBER,
grand_total NUMBER,
idx_lagnum_diff NUMBER,
idx_percentincr NUMBER,
tbl_lagnum_diff NUMBER,
tbl_percentincr NUMBER,
tablekount NUMBER,
indexkount NUMBER
TYPE shared_batch IS TABLE OF type_shared_rec
INDEX BY BINARY_INTEGER;
shared_rec shared_batch;
procedure generateUTL(p_dir_path in varchar2,
passTable shared_rec);
But I am getting PLS-00488 error as mentioned in subject line.
Where am i doing wrong?
I am using Oracle 9i EE.
Thanks,
R
shared_rec shared_batch;I think you dont need this variable.
>
procedure generateUTL(p_dir_path in varchar2,
passTable shared_rec);This is not correct you must use the type name and not the variable shared_rec. So your procedure must be
procedure generateUTL(p_dir_path in varchar2, passTable shared_batch);
Similar Messages
-
Invalid variable declaration: object 'TIMESTAMP' must be a type or subtype
Message 1: ORA-06550: line 91, column 14:
PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated
ORA-06553: PLS-488: invalid variable declaration: object 'TIMESTAMP' must be a type or subtype
ORA-06550: line 89, column 1:
PL/SQL: SQL Statement ignored
I'm getting above error message when i'm trying to define one cursor from a table which has a column with data timestamp(3) in a cursor i'm not even using a column with data type timestamp .( this tables i created by importing sybase tables into oracle )
SELECT to_char(sysdate) -- trunc(act.date_posted)
INTO v__Data
from cedb.cr_ar_debit_activity act
where rownum < 2 ;
for testing purpose i even removed the cursor and make it shor to above query then also it dosent work and gave the above error . if you know the solution then please let me know . i think i've to do/change database settings but i'm not sure .the above code is not working but the following code is working if i open cursor from assiging select to variable , why this is happening .
DECLARE
v_A_REPORT_DT VARCHAR2(100);
ls_sel VARCHAR2(900);
i INTEGER := 1;
TYPE dynamic_cur IS REF CURSOR;
tb_test_cur dynamic_cur ;
TYPE array_date_type IS TABLE OF DATE INDEX BY PLS_INTEGER;
v1 array_date_type ;
BEGIN
v_A_REPORT_DT := '01-01-2007'/* VARCHAR2(2000) */;
-- this one is not working
SELECT to_char(sysdate) -- trunc(act.date_posted)
INTO v_A_REPORT_DT
from cedb.cr_ar_debit_activity act
where rownum < 2 ;
ls_sel := 'SELECT trunc(act.date_posted)
from cedb.cr_ar_debit_activity act
where rownum < 3 ' ;
OPEN tb_test_cur FOR ls_sel;
LOOP
FETCH tb_test_cur INTO v1(i) ;
EXIT WHEN tb_test_cur%notfound;
dbms_output.put_line(to_char(v1(i)));
i := i + 1 ;
END LOOP;
CLOSE tb_test_cur;
END; -
Getting error PLS-00307: too many declarations while instantiating object.
Hi,
I'm using oracle 10.2.0.4.0
I've created an object obj_bsk as follows:
create or replace type obj_bsk as object
(batch_set_key varchar2(64),
constructor function obj_bsk
return self as result,
constructor function obj_bsk(p_batch_set_key in varchar2)
return self as result,
member procedure display_batch_set_key
and object body as
create or replace type body obj_bsk as
constructor function obj_bsk
return self as result is
begin
self.batch_set_key := sys_guid();
return;
end;
constructor function obj_bsk (p_batch_set_key varchar2)
return self as result is
begin
self.batch_set_key := p_batch_set_key;
return;
end;
member procedure display_batch_set_key is
begin
dbms_output.put_line('batch_set_key is:' || self.batch_set_key);
end;
end;
Then I've created a package test_obj as follows:
specification:
create or replace package test_obj is
-- Author : TSHARMA
-- Created : 31/01/2012 10:32:37
-- Purpose : to test objects
my_bsk obj_bsk;
g_batch_set_key varchar2(64);
procedure show_obj_val;
end test_obj;
body:
create or replace package body test_obj is
procedure show_obj_val is
begin
my_bsk.display_batch_set_key();
end;
begin
-- Initialization
if (g_batch_set_key is not null) then
my_bsk := obj_bsk(g_batch_set_key);
else
my_bsk := obj_bsk();
end if;
end test_obj;
When I'm compiling the package I'm getting following error:
Compilation errors for PACKAGE BODY TSHARMA.TEST_OBJ
Error: PLS-00307: too many declarations of 'OBJ_BSK' match this call
Line: 12
Text: my_bsk := obj_bsk(g_batch_set_key);
Error: PL/SQL: Statement ignored
Line: 12
Text: my_bsk := obj_bsk(g_batch_set_key);
Can anyone please explain why oracle is viewing it as too many call for constructor when both constructors are different.
and how to resolve the issue.
Thanks
TarunI've solved the problem. Though it is strange.
The error occurred because I'm using p_batch_set_key as parameter constructor.
i.e. constructor function obj_bsk(p_batch_set_key in varchar2)
return self as result,
once I changed it to the same name as variable name in object it compiled fine.
i.e constructor function obj_bsk(batch_set_key in varchar2)
return self as result,
It is very strange. Can anyone plesae explain why the parameter name should be same as variable name in object.
Thanks
Tarun -
PLS-00487: Invalid reference to variable ' expression '
oracle database 10G
OS unix
One of procedure is giving error PLS-00487: Invalid reference to variable '<expression>' while compilation in above database while it is compiling
successfully in other database.
Is there any database error?PLS-00487: Invalid reference to variable "string"
Cause: A variable was referenced in a way that is inconsistent with its datatype. For example, a scalar variable might have been mistakenly referenced as a record, as follows: DECLARE CURSOR emp_cur IS SELECT empno, ename, sal FROM emp; emp_rec emp_cur%ROWTYPE; my_sal NUMBER(7,2); BEGIN ... total_sal := total_sal + my_sal.sal; -- invalid ...
Action: Check the spelling of the variable name. Make sure the variable was declared properly and that the declaration and reference are consistent regarding datatype.
Most probably the compiler "sees" some other type variable with the same name first which in the other database doesn't exist or is out of scope.
Regards
Etbin -
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
Oracle 9.2 client ORA 8.1.7 Server:
Trying to run an SP in SQL navigator ( or PL/SQL)
I get the following error(s)
ORA-06550: line 6, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 6, column 3:
++++++++++++++++++++++++++++++++++++++++++++
Here's the Package and Proc Code with the errors at the end.
It seems not to like a Ref Cursor, but I'm not experienced enough to know the reason.
ANy Help would be very appreciated: AJACODE
++++++++++++++++++++++++++++++++++++++++++++
--Package Spec
Package RPT_NB_GUI_Param_Get_PKG
IS
TYPE rc_Params_gettbl IS RECORD (
o_QueryID Number,
o_ParameterID Number,
o_Param VARCHAR2 (20),
o_Param_Type VARCHAR2 (50),
o_Param_QueryID Number
TYPE rc_params IS REF CURSOR RETURN rc_Params_gettbl;
END; -- Package Specification RPT_NB_GUI_Param_Get_PKG
--+++++++++++++++++++++++++++++++++++++++++
-- Proc
Procedure RPT_NB_GUI_Param_Get_PROC
p_QueryID in Number ,
rc_ParamsGet IN OUT RPT_NB_GUI_Param_Get_PKG.rc_Params)
IS
-- Purpose: To generate Parameters for GUI
-- MODIFICATION HISTORY
-- Person Date Comments
-- AJ Grasso 04/11/2003 Created
BEGIN
OPEN rc_ParamsGet For
SELECT
QP.QueryID
,P.ParameterID
,P.Parameter
,PT.Parameter_Type
,PQ.Parameter_QueryID
FROM
rpt_Query_Parameter QP, rpt_Parameter P, rpt_Parameter_Type PT, rpt_parameter_query PQ
WHERE --inner join rpt_Parameter P ON
(QP.ParameterID = P.ParameterID)
AND --inner join rpt_Parameter_Type PT ON
(QP.Parameter_TypeID = PT.Parameter_TypeID)
AND --left outer join rpt_parameter_query PQ ON
(QP.Parameter_queryID = PQ.parameter_queryID)
AND (QP.QueryID = p_QueryID) ;
END; -- RPT_NB_GUI_Param_Get_PROC
-- ERRORS
-- +++++++++++++++++
ORA-06550: line 6, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 6, column 3:
PL/SQL: Statement ignored
ORA-06550: line 7, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 7, column 3:
PL/SQL: Statement ignored
ORA-06550: line 8, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 8, column 3:
PL/SQL: Statement ignored
ORA-06550: line 9, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 9, column 3:
PL/SQL: Statement ignored
ORA-06550: line 10, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 10, column 3:
PL/SQL: Statement ignored
ORA-06550: line 16, column 74:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 16, column 3:
PL/SQL: Statement ignored
ORA-06550: line 17, column 78:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 17, column 3:
PL/SQL: Statement ignored
ORA-06550: line 18, column 71:Oracle 9.2 client ORA 8.1.7 Server:
Trying to run an SP in SQL navigator ( or PL/SQL)
I get the following error(s)
ORA-06550: line 6, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 6, column 3:
++++++++++++++++++++++++++++++++++++++++++++
Here's the Package and Proc Code with the errors at the end.
It seems not to like a Ref Cursor, but I'm not experienced enough to know the reason.
ANy Help would be very appreciated: AJACODE
++++++++++++++++++++++++++++++++++++++++++++
--Package Spec
Package RPT_NB_GUI_Param_Get_PKG
IS
TYPE rc_Params_gettbl IS RECORD (
o_QueryID Number,
o_ParameterID Number,
o_Param VARCHAR2 (20),
o_Param_Type VARCHAR2 (50),
o_Param_QueryID Number
TYPE rc_params IS REF CURSOR RETURN rc_Params_gettbl;
END; -- Package Specification RPT_NB_GUI_Param_Get_PKG
--+++++++++++++++++++++++++++++++++++++++++
-- Proc
Procedure RPT_NB_GUI_Param_Get_PROC
p_QueryID in Number ,
rc_ParamsGet IN OUT RPT_NB_GUI_Param_Get_PKG.rc_Params)
IS
-- Purpose: To generate Parameters for GUI
-- MODIFICATION HISTORY
-- Person Date Comments
-- AJ Grasso 04/11/2003 Created
BEGIN
OPEN rc_ParamsGet For
SELECT
QP.QueryID
,P.ParameterID
,P.Parameter
,PT.Parameter_Type
,PQ.Parameter_QueryID
FROM
rpt_Query_Parameter QP, rpt_Parameter P, rpt_Parameter_Type PT, rpt_parameter_query PQ
WHERE --inner join rpt_Parameter P ON
(QP.ParameterID = P.ParameterID)
AND --inner join rpt_Parameter_Type PT ON
(QP.Parameter_TypeID = PT.Parameter_TypeID)
AND --left outer join rpt_parameter_query PQ ON
(QP.Parameter_queryID = PQ.parameter_queryID)
AND (QP.QueryID = p_QueryID) ;
END; -- RPT_NB_GUI_Param_Get_PROC
-- ERRORS
-- +++++++++++++++++
ORA-06550: line 6, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 6, column 3:
PL/SQL: Statement ignored
ORA-06550: line 7, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 7, column 3:
PL/SQL: Statement ignored
ORA-06550: line 8, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 8, column 3:
PL/SQL: Statement ignored
ORA-06550: line 9, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 9, column 3:
PL/SQL: Statement ignored
ORA-06550: line 10, column 16:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 10, column 3:
PL/SQL: Statement ignored
ORA-06550: line 16, column 74:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 16, column 3:
PL/SQL: Statement ignored
ORA-06550: line 17, column 78:
PLS-00487: Invalid reference to variable 'RC_PARAMSGET'
ORA-06550: line 17, column 3:
PL/SQL: Statement ignored
ORA-06550: line 18, column 71: -
Same variable declaration in package
Hi
Please go through below lines of code where I have declared same variable 2 times, which got compiled successfully. But If I do the same in stand alone procedure it throws an error. In case of creation of package it says package created. Can anyone justify to this .....
SQL> create or replace package
2 may221
3 as
4 a number := 10 ;
5 a number := 20 ;
6 procedure p1(a number) ;
7 end ;
8 /
Package created.
SQL> create or replace package body may221
2 as
3 procedure p1(a number)
4 as
5 begin
6 dbms_output.put_line(a) ;
7 end ;
8 end ;
9 /
Package body created.
SQL> set serverout on
SQL> exec may221.p1(20);
20
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_output.put_line(may221.a) ;
3 end ;
4 /
dbms_output.put_line(may221.a) ;
ERROR at line 2:
ORA-06550: line 2, column 32:
PLS-00371: at most one declaration for 'MAY221.A' is permitted in the declaration section
ORA-06550: line 2, column 4:
PL/SQL: Statement ignored
Thanks and Regards
JC> I checked it's working fine.. no errors..
Oracle version?
There is an error as there are two definitions of variable a. This will generate a run-time error when that variable is used.
However, the result of procedure P1 is not an error.
It is all a matter of scope. Scope determines the resolution of a reference (like a variable name, object name, column name, table name, etc.)
The scope is first local - which means the local code block is checked for resolution. And the variable a is found. In o-o terms, when you refer to variable a it is first resolved as self.a - and only when that fails, the scope changes to the "encapsulating" unit which is the package.
The following code illustrates:
SQL> create or replace package FooPackage is
2 a number := 10;
3 a number := 11;
4
5 procedure Show( a number );
6 end;
7 /
Package created.
SQL> show errors
No errors.
SQL>
SQL>
SQL> create or replace package body FooPackage is
2 procedure Show( a number ) is
3 begin
4 DBMS_OUTPUT.put_line( a ); -- <= resolved as self.a
5 end;
6 end;
7 /
Package body created.
SQL> show errors
No errors.
SQL>
SQL>
SQL> exec FooPackage.Show( 12 )
12
PL/SQL procedure successfully completed.
SQL> exec DBMS_OUTPUT.put_line( FooPackage.a );
BEGIN DBMS_OUTPUT.put_line( FooPackage.a ); END;
ERROR at line 1:
ORA-06550: line 1, column 40:
PLS-00371: at most one declaration for 'FOOPACKAGE.A' is permitted
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored -
I am very confused on this "Object Variable vs Object" thing.
Pls refer to the code below:
class Test
static void show()
System.out.println("Show method in Test class");
public class Q2 extends Test
static void show()
System.out.println("Show method in Q2 class");
public static void main(String[] args)
Test t = new Test();
t.show();
Q2 q = new Q2();
q.show();
t = q;
t.show();
q = t; // line 25
q.show();
}The code above should encounter error at line 25, because of incompatible type. The solution is to cast it to type Q2. But, I do not know why should I cast it. I thought:
t = q; // assign object of type Q2 to variable of type Test, so now
t is object of type Q2.
so,
q = t; // when I assign object of type Q2 to variable of type Q2, I
thought that is acceptable, but it is not. WHY?
Thanks!Thanks!
However, there is another question!
Can I say, after t = q, it is actually becomes
Test t = new Q2(); ??
if so, then why when
q = t; // error?? Isn't this statement indirectly means Q2 q = new Q2()? Is so, why must we cast?
Thanks again! -
Invalid package declaration:
If you read my post a few messages down, I asked how to add a package in NetBeans. Solved (THANKS).
But now I get this error when I mouseover the items in the package. Can I get an exact walkthrough on what to do to enable a package to work in NetBeans?
l'll be more specific. I downloaded the jpb package from http://knking.com/books/java/ (Near the bottom)
NetBeans saves my projects in C:\Documents and Settings\Administrator. So (In accordance with the instructions given in the book) I made the dir. C:\Documents and Settings\Administartor\jpb and inserted 3 .java files in it (SimpleIO.java Convert.java and DrawableFrame.java). From this point, what do I do so that (in netbeans) I can type import jpb.* and not get any errors?
THANKS AGAIN FOR EVERYONE WHO HELPSYou must compile these files, and I suggest you to
create a jar library:
New project -> General -> Java Class Library
Copy your sources in it and build project. This will
generate a .jar in the dist folder in mounted
filesystem.
Now add this builded jar in your project library as
commented before.
mariOHey there, I'm also a newb facing a similar error...
I backed up a package by copy - pasting it and now i mounted it. However, when i mouseover any of its classes it says "Invalid package declaration" and i can't solve it....
pls help
THX!!! -
Invalid method declaration; return type required
The code:
public Reminder(int seconds) {
timer = new Timer();
timer.schedule(new RemindTask(), seconds*1000);
class RemindTask extends TimerTask {
public void run() {
System.out.format("Time's up!%n");
timer.cancel(); //Terminate the timer thread
public static void main(String[] args)
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
try
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
catch (Exception ex)
System.out.println("Failed loading L&F: ");
System.out.println(ex);
new superball();
new Reminder(5);
System.out.format("Task scheduled.%n");
//= End of Testing =
}Gives:
"invalid method declaration; return type required"
If i add void to public Reminder(int seconds) {It prints:
cannot find symbol
symbol : class Reminder
location: class superball
new Reminder(5);
Is it because of the public class?
public class superball extends JFrameHere is the FULL code:
/* superball */
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.regex.Pattern;
import java.util.Timer;
import java.util.TimerTask;
import java.util.*;
import java.io.*;
* Summary description for superball
public class superball extends JFrame
// Variables declaration
int ballx;
int bally;
int jumpstop;
int stopper;
int coin;
int coinx;
int coiny;
int coinvaluex;
int coinvaluey;
Timer timer;
private int value = 0;
private static Random r = new Random();
private JLabel jLabel1;
private JLabel jLabel2;
private JLabel jLabel4;
private JLabel jLabel5;
private JLabel jLabel7;
private JLabel jLabel9;
private JLabel jLabel10;
private JPanel contentPane;
private JPanel jPanel1;
// End of variables declaration
public superball()
super();
initializeComponent();
// TODO: Add any constructor code after initializeComponent call
this.setVisible(true);
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always regenerated
* by the Windows Form Designer. Otherwise, retrieving design might not work properly.
* Tip: If you must revise this method, please backup this GUI file for JFrameBuilder
* to retrieve your design properly in future, before revising this method.
private void initializeComponent()
jLabel1 = new JLabel();
jLabel2 = new JLabel();
jLabel4 = new JLabel();
jLabel5 = new JLabel();
jLabel7 = new JLabel();
jLabel9 = new JLabel();
jLabel10 = new JLabel();
coin = 1;
coinx = Math.abs(r.nextInt()) % 460 + 100;
coiny = Math.abs(r.nextInt()) % 200 + 100;
ballx = 342;
bally = 338;
jumpstop = 0;
stopper = 13;
contentPane = (JPanel)this.getContentPane();
jPanel1 = new JPanel();
// jLabel1
jLabel1.setIcon(new ImageIcon("IMG\\coin.gif"));
jLabel1.setText("0");
// jLabel2
jLabel2.setIcon(new ImageIcon("IMG\\logo.PNG"));
// jLabel4
jLabel4.setIcon(new ImageIcon("IMG\\black.GIF"));
// jLabel5
jLabel5.setIcon(new ImageIcon("IMG\\ballstanding2.gif"));
// jLabel7
jLabel7.setIcon(new ImageIcon("IMG\\star-heart.gif"));
jLabel7.setText(" 100");
// jLabel9
jLabel9.setIcon(new ImageIcon("IMG\\coin.gif"));
// jLabel10
jLabel10.setIcon(new ImageIcon("IMG\\stage1.GIF"));
// contentPane
contentPane.setLayout(null);
contentPane.setBackground(new Color(255, 254, 254));
addComponent(contentPane, jLabel5, 342,338,60,18);
addComponent(contentPane, jLabel1, 561,4,100,18);
addComponent(contentPane, jLabel2, 2,3,208,24);
addComponent(contentPane, jLabel7, 495,4,60,18);
addComponent(contentPane, jLabel9, coinx,coiny,19,18);
addComponent(contentPane, jLabel2, 2,3,208,24);
addComponent(contentPane, jLabel10, -2,29,738,412);
addComponent(contentPane, jPanel1, 79,209,200,100);
// jPanel1
jPanel1.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
jPanel1.setFocusable(true);
jPanel1.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e)
jPanel1_keyPressed(e);
public void keyReleased(KeyEvent e)
jPanel1_keyReleased(e);
public void keyTyped(KeyEvent e)
jPanel1_keyTyped(e);
// superball
this.setTitle("Superball created by Hannes Karlsson");
this.setLocation(new Point(0, 0));
this.setSize(new Dimension(617, 450));
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setResizable(false);
/** Add Component Without a Layout Manager (Absolute Positioning) */
private void addComponent(Container container,Component c,int x,int y,int width,int height)
c.setBounds(x,y,width,height);
container.add(c);
// TODO: Add any appropriate code in the following Event Handling Methods
private void jPanel1_keyPressed(KeyEvent e)
System.out.println("\njPanel1_keyPressed(KeyEvent e) called.");
// TODO: Add any handling code here
if(e.getKeyCode()==e.VK_LEFT) // when the user enters left
jLabel5.setLocation(new Point(ballx--, bally));
jLabel5.setLocation(new Point(ballx--, bally));
jLabel5.setLocation(new Point(ballx--, bally));
jLabel5.setLocation(new Point(ballx--, bally));
jLabel5.setIcon(new ImageIcon("IMG\\ballroll.gif"));
} // equalling PLAIN_SPEED
if(e.getKeyCode()==e.VK_RIGHT) // when the user enters right
jLabel5.setLocation(new Point(ballx++, bally));
jLabel5.setLocation(new Point(ballx++, bally));
jLabel5.setLocation(new Point(ballx++, bally));
jLabel5.setLocation(new Point(ballx++, bally));
jLabel5.setIcon(new ImageIcon("IMG\\ballroll.gif"));
} // equalling PLAIN_SPEED
if(e.getKeyCode()==e.VK_UP) // when the user enters up
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setIcon(new ImageIcon("IMG\\balljetpack.gif"));
} // equalling PLAIN_SPEED
if(e.getKeyCode()==e.VK_DOWN) // when the user enters up
jLabel5.setLocation(new Point(ballx, bally++));
jLabel5.setLocation(new Point(ballx, bally++));
jLabel5.setLocation(new Point(ballx, bally++));
jLabel5.setLocation(new Point(ballx, bally++));
jLabel5.setIcon(new ImageIcon("IMG\\ballroll.gif"));
} // equalling PLAIN_SPEED
if(bally>=340)
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
System.out.println("LOW!!!");
if(bally<=-2)
jLabel5.setLocation(new Point(ballx, bally++));
jLabel5.setLocation(new Point(ballx, bally++));
jLabel5.setLocation(new Point(ballx, bally++));
jLabel5.setLocation(new Point(ballx, bally++));
System.out.println("HIGH!!!");
if(ballx>=594)
jLabel5.setLocation(new Point(ballx--, bally));
jLabel5.setLocation(new Point(ballx--, bally));
jLabel5.setLocation(new Point(ballx--, bally));
jLabel5.setLocation(new Point(ballx--, bally));
System.out.println("RIGHT!!!");
if(ballx<=-3)
jLabel5.setLocation(new Point(ballx++, bally));
jLabel5.setLocation(new Point(ballx++, bally));
jLabel5.setLocation(new Point(ballx++, bally));
jLabel5.setLocation(new Point(ballx++, bally));
System.out.println("LEFT!!!");
if (bally==294 && (ballx > 218 && ballx < 274))
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
if (bally==262 && (ballx > 246 && ballx < 306))
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
if (bally==230 && (ballx > 486 && ballx < 562))
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
if (bally==310 && (ballx > 486 && ballx < 594))
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
if (bally==262 && (ballx > 442 && ballx < 514))
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
if (bally==294 && (ballx > 378 && ballx < 466))
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
jLabel5.setLocation(new Point(ballx, bally--));
// COIN
if ((bally > coiny-10 && bally < coiny+10) && (ballx > coinx-10 && ballx < coinx+10))
coinx = Math.abs(r.nextInt()) % 617 + 1;
coiny = Math.abs(r.nextInt()) % 300 + 1;
jLabel9.setLocation(new Point(coinx, coiny));
System.out.println("Coinx:"+coinx+"");
System.out.println("Coiny:"+coiny+"");
jLabel1.setText(""+ coin++ +"");
System.out.println("Ballx:"+ballx+"");
System.out.println("Bally:"+bally+"");
private void jPanel1_keyReleased(KeyEvent e)
System.out.println("\njPanel1_keyReleased(KeyEvent e) called.");
// TODO: Add any handling code here
jLabel5.setIcon(new ImageIcon("IMG\\ballstanding2.gif"));
private void jPanel1_keyTyped(KeyEvent e)
System.out.println("\njPanel1_keyTyped(KeyEvent e) called.");
// TODO: Add any handling code here
// TODO: Add any method code to meet your needs in the following area
//============================= Testing ================================//
//= =//
//= The following main method is just for testing this class you built.=//
//= After testing,you may simply delete it. =//
//======================================================================//
public void Reminder(int seconds) {
timer = new Timer();
timer.schedule(new RemindTask(), seconds*1000);
class RemindTask extends TimerTask {
public void run() {
System.out.format("Time's up!%n");
timer.cancel(); //Terminate the timer thread
public static void main(String[] args)
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
try
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
catch (Exception ex)
System.out.println("Failed loading L&F: ");
System.out.println(ex);
new superball();
new Reminder(5);
System.out.format("Task scheduled.%n");
//= End of Testing =
}No, it's because you can't have a constructor called Reminder if you don't have a class named Reminder.
-
Variable declaration in BEx - Business scenario's
Hi,
I need some documents about all kind of variable declaration with some example business scenarios in MM, FI-CO modules.
will assign you a reasonable points
Regards,
Pooja.SHi Pooja,
The processing type of a variable may be varies from business requirement.
In general we will use the processing type:
Replacement Path : If you specify a variable as a characteristic value, you do not have to specify a text for the characteristic value right away. Instead, you can fill the text field dynamically and specifically for the characteristic that you use for the variable when you execute the query. To do this, define a text variable with automatic replacement.
[http://help.sap.com/saphelp_nw70/helpdata/EN/bd/589b3c494d8e15e10000000a114084/content.htm]
Authorisations: If the user belongs to Asia PAciffic region and he must see only details of his region then we can create a variable Region vt Processing type Authorisations so that he vl able to see only that region's data.
[http://help.sap.com/saphelp_nw70/helpdata/EN/44/599b3c494d8e15e10000000a114084/content.htm]
SAP EXIT: If you want to define a query that only ever displays the data from the current month, drag the delivered variable current month (technical name 0CMONTH) for the characteristic calendar year/month (technical name 0CMONTH) into the query filter.
[http://help.sap.com/saphelp_nw70/helpdata/EN/f1/0a5702e09411d2acb90000e829fbfe/content.htm]
Customer Exit: You want to use one characteristic value to calculate a second characteristic value. The InfoProvider only contains the calendar day. However, you now also want to display the cumulated value for the relevant period (beginning with the first day of a quarter) in a query.
For the first day of the quarter, use a variable with customer exit processing. If you now enter the current calendar day (for example, 06/19/2000), a start date of 06/01/2000 appears in the customer exit, and the cumulated value of this period can be displayed.
[http://help.sap.com/saphelp_nw70/helpdata/EN/f1/0a56f5e09411d2acb90000e829fbfe/content.htm]
I hope this helps you. -
Why can't I move a variable declaration from inside a Sub to the Declarations area?
I'm writing an app and so far, so good. But I need wider access to an array defined in my "Form_Load" sub.
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Assign checkboxes to an array.
Dim Checkboxes() As CheckBox = {chkThumb01, chkThumb02, chkThumb03, chkThumb04, _
chkThumb05, chkThumb06, chkThumb07, chkThumb08, chkThumb09, chkThumb10}
Moving the declaration ("Dim Checkboxes()...") from "Sub frmMain_Load" up into the Declarations space just above it breaks my program. :(
I tried putting it in a Module and that fails too. The ONLY place it work's is in Form_Load (it's not related to being an array because at least one standard integer variable declaration has this problem too.)
I have other variables in the Declarations area that work fine (eg: "Dim bolChanges as Boolean"), but for some reason, I can't move others out into what
should be a more global namespace.
Anyone know what's going on? Thx.No, because this makes no difference.
Background #1: If you do not write your own constructor (=Sub New), the VB compiler adds a default constructor. It contains a call to Sub InitializeComponent. In this Sub, the controls are created and assigned to chkThumb01 etc. You see it if you type "Sub
New[Enter]":
Sub New()
InitializeComponent()
End Sub
Background #2: If you write
Public Class Test
Private values As Integer() = {1, 2, 3}
End Class
it is identical to
Public Class Test
Private values As Integer()
Sub New()
values = New Integer() {1, 2, 3}
End Sub
End Class
As you can see, the assignments that you do to fields of the class in the declaration line are actually executed in the constructor (sub new).
Now put both backgrounds together. Consequently, this code
Public Class Form1
Private buttons As Button() = {Button1, Button2, Button3}
End Class
is identical to this one:
Public Class Form1
Private buttons As Button()
Sub New()
buttons = New Button() {Button1, Button2, Button3}
InitializeComponent()
End Sub
End Class
Obviously, the assignment to variable "buttons" is done before the call to Sub InitializeComponent. At this point, variables Button1, Button2 and Button3 are still empty (Nothing) because they will be set in Sub InitializeComponent. Consequently,
the array buttons contains just {Nothing, Nothing, Nothing}
In opposite, if the array buttons is set in the Load event, Button1, Button2 and Button3 have already been set before, Consequently, the array buttons correctly contains references to the three buttons.
Armin -
PLS-00330: invalid use of type name or subtype name
I am relatively new to Sql and am in the process of learning, so please bear with me. I am trying to create a trigger for the Invoices table that displays the vendor_name, invoice_number, and payment_total after the payment_total has been increased. I have discovered that I must use a compound trigger due to a mutating-table error and ended up with this:
CREATE OR REPLACE TRIGGER invoices_after_update_payment
FOR UPDATE OF payment_total
ON invoices
COMPOUND TRIGGER
TYPE invoice_numbers_table IS TABLE OF VARCHAR2(50);
TYPE payment_totals_table IS TABLE OF NUMBER;
TYPE vendor_names_table IS TABLE OF VARCHAR2(50);
TYPE summary_payments_table IS TABLE OF NUMBER INDEX BY VARCHAR2(50);
TYPE summary_names_table IS TABLE OF NUMBER INDEX BY VARCHAR2(50);
invoice_numbers invoice_numbers_table;
payment_totals payment_totals_table;
vendor_names vendor_names_table;
payment_summarys summary_payments_table;
name_summarys summary_names_table;
AFTER STATEMENT IS
invoice_number VARCHAR2(50);
payment_total NUMBER;
vendor_name VARCHAR2(50);
BEGIN
SELECT i.invoice_number, i.payment_total, v.vendor_name
BULK COLLECT INTO invoice_numbers, payment_totals, vendor_names
FROM invoices i JOIN vendors v
ON i.vendor_id = v.vendor_id
GROUP BY i.invoice_number;
FOR i IN 1..invoice_numbers.COUNT() LOOP
invoice_number := invoice_numbers(i);
payment_total := payment_totals(i);
vendor_name := vendor_names(i);
summary_payments_table(invoice_number) := payment_total;
summary_names_table(invoice_number) := vendor_name;
END LOOP;
END AFTER STATEMENT;
AFTER EACH ROW IS
temp_payment_total NUMBER;
vendor_name VARCHAR2(50);
BEGIN
temp_payment_total := payment_summarys(:new.invoice_number);
vendor_name := name_summarys(:new.invoice_number);
IF (:new.payment_total > temp_payment_total) THEN
DBMS_OUTPUT.PUT_LINE('Vendor Name: ' || vendor_name || ', Invoice Number: ' || :new.invoice_number || ', Payment Total: ' || :new.payment_total);
END IF;
END AFTER EACH ROW;
END;
/The code that I am using to update the table is:
UPDATE invoices
SET payment_total = 508
WHERE invoice_number = 'QP58872'At this point, I am getting an error report saying:
29/7 PLS-00330: invalid use of type name or subtype name
29/7 PL/SQL: Statement ignored
30/7 PLS-00330: invalid use of type name or subtype name
30/7 PL/SQL: Statement ignoredWhat does the error code entail? I have looked it up but can't seem to pin it. Any help would be greatly appreciated and I am open to any suggestions for improving my current code.
I am using Oracle Database 11g Express Edition on Windows 7. I am not sure if it is relevant, but I am also using Sql Developer. If you need any further information, I will do my best to provide what I can.
Thanks!
Edited by: 927811 on Apr 15, 2012 11:54 PM
Edited by: 927811 on Apr 15, 2012 11:56 PMI took your advice and removed the exception handling. There is no point in it being there. I also checked the timing points and you are correct. So, I changed my AFTER STATEMENT to BEFORE STATEMENT, which I had been thinking about doing anyways. It just seemed logical to me. That brings me to where I am now. I ran my update again and got back this error, It is the same as the one before, but for a different line (?)
Error starting at line 1 in command:
UPDATE invoices
SET payment_total = 510
WHERE invoice_number = 'QP58872'
Error report:
SQL Error: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "AP.INVOICES_AFTER_UPDATE_PAYMENT", line 30
ORA-04088: error during execution of trigger 'AP.INVOICES_AFTER_UPDATE_PAYMENT'
06502. 00000 - "PL/SQL: numeric or value error%s"
*Cause:
*Action:Also, to make sure you are clear as to what my code now looks like:
SET SERVEROUTPUT ON;
CREATE OR REPLACE TRIGGER invoices_after_update_payment
FOR UPDATE OF payment_total
ON invoices
COMPOUND TRIGGER
TYPE invoice_numbers_table IS TABLE OF VARCHAR2(50);
TYPE payment_totals_table IS TABLE OF NUMBER;
TYPE vendor_names_table IS TABLE OF VARCHAR2(50);
TYPE summary_payments_table IS TABLE OF NUMBER INDEX BY VARCHAR2(50);
TYPE summary_names_table IS TABLE OF NUMBER INDEX BY VARCHAR2(50);
invoice_numbers invoice_numbers_table;
payment_totals payment_totals_table;
vendor_names vendor_names_table;
payment_summarys summary_payments_table;
name_summarys summary_names_table;
BEFORE STATEMENT IS
invoice_number VARCHAR2(50);
payment_total NUMBER;
vendor_name VARCHAR2(50);
BEGIN
SELECT i.invoice_number, i.payment_total, v.vendor_name
BULK COLLECT INTO invoice_numbers, payment_totals, vendor_names
FROM invoices i JOIN vendors v
ON i.vendor_id = v.vendor_id
GROUP BY i.invoice_number, i.payment_total, v.vendor_name;
FOR i IN 1..invoice_numbers.COUNT() LOOP
invoice_number := invoice_numbers(i);
payment_total := payment_totals(i);
vendor_name := vendor_names(i);
payment_summarys(invoice_number) := payment_total;
name_summarys(invoice_number) := vendor_name;
END LOOP;
END BEFORE STATEMENT;
AFTER EACH ROW IS
temp_payment_total NUMBER;
vendor_name VARCHAR2(50);
BEGIN
temp_payment_total := payment_summarys(:new.invoice_number);
vendor_name := name_summarys(:new.invoice_number);
IF (:new.payment_total > temp_payment_total) THEN
DBMS_OUTPUT.PUT_LINE('Vendor Name: ' || vendor_name || ', Invoice Number: ' || :new.invoice_number || ', Payment Total: ' || :new.payment_total);
END IF;
END AFTER EACH ROW;
END;
/Thanks for the help! -
How to use local variables declared in b/t the methods in other views
Hi
i need to use the value of the local variables declared in b/w the views in one other view,as i have manipulated the value based on some condition & want to use it in 1 more view for my req.,but that variable is not global one just for once i need to use it,and i can't again write the whole for its conditions,as its there in initialization view,which if coded again,can hit the functionality there,so is it possible to use the value of such local variables thereafter or not,if yes pls let me know,or i need to declare the global variable for this.hi,
1.Declare an Attribute in Component controller.
2. Pass the value to this Attribute in View V1.
using :
wd_comp_controller->Att = 'Saurav'.
3. Now in view2 , you can access this Attribute using:
data lv type string.
lv = wd_comp_controller->Att .
Here Att is my attribute of type string declared in component controller. -
Binding done at variable declaration
What is difference between
int x;
x=5;
and
int x=5;
What are different binding takes place?
How Binding differs in both the cases?
Can anybody please tell me about it.Hello Tomasz,
welcome in the SAP GUI Scripting forum.
You add at first the SAP GUI Scripting API library as reference to your VBA project from the Tools menu.
Now you can use this code with explicit variable declaration:
Option Explicit
Sub Test()
On Error Resume Next
Dim SapGuiAuto As Object
Dim SAPGUIApp As SAPFEWSELib.GuiApplication
Dim Connection As SAPFEWSELib.GuiConnection
Dim Session As SAPFEWSELib.GuiSession
Set SapGuiAuto = GetObject("SAPGUI")
If SapGuiAuto Is Nothing Then
Exit Sub
End If
Set SAPGUIApp = SapGuiAuto.GetScriptingEngine
If SAPGUIApp Is Nothing Then
Exit Sub
End If
Set Connection = SAPGUIApp.Children(0)
If Connection Is Nothing Then
Exit Sub
End If
Set Session = Connection.Children(0)
If Session Is Nothing Then
Exit Sub
End If
'Your Code here
End Sub
Good luck.
Cheers
Stefan -
PLS-00307: too many declarations of 'DEFINE_COLUMN' match this call
Compilation of this procedure issues 'PLS-00307: too many declarations of 'DEFINE_COLUMN' match this call'.
Here is the code:
PROCEDURE leggi_comp (tabella spre_005.nome_table%type, cen dinf_027.cd_centro%type, prat dinf_027.nr_pratica%type,
serv dinf_027.cd_servizio%type, fase dinf_027.cd_fase%type, dt_ril dinf_027.dt_rilev%type,
comp_out out dinf_027.cd_compilatore%type) IS
source_cursor number;
v_cen dinf_027.cd_centro%type;
v_prat dinf_027.nr_pratica%type;
v_serv dinf_027.cd_servizio%type;
v_fase dinf_027.cd_fase%type;
v_dt_ril dinf_027.dt_rilev%type;
v_comp_out dinf_027.cd_compilatore%type;
myreturn number;
BEGIN
source_cursor := dbms_sql.open_cursor;
v_cen := cen;
v_prat := prat;
v_serv := serv;
v_fase := fase;
v_dt_ril := dt_ril;
dbms_sql.parse (source_cursor,
'select cd_compilatore from ' || tabella||' where
cd_centro = :cen and
nr_pratica = :prat and
cd_servizio = :serv and
cd_fase = :fase and
dt_rilev = :dt_ril',dbms_sql.v7);
dbms_sql.bind_variable(source_cursor, 'cen', v_cen);
dbms_sql.bind_variable(source_cursor, 'prat', v_prat);
dbms_sql.bind_variable(source_cursor, 'serv', v_serv);
dbms_sql.bind_variable(source_cursor, 'fase', v_fase);
dbms_sql.bind_variable(source_cursor, 'dt_ril',v_dt_ril);
dbms_sql.define_column(source_cursor, 1, v_comp_out);
myreturn := dbms_sql.execute(source_cursor);
myreturn := dbms_sql.fetch_rows(source_cursor);
dbms_sql.column_value(source_cursor,1,v_comp_out);
comp_out := v_comp_out;
dbms_sql.close_cursor(source_cursor);
exception
when others
then if dbms_sql.is_open (source_cursor)
then dbms_sql.close_cursor (source_cursor);
end if;
raise;
END;
Can anybody help me?From the documentation which is worth reading
DBMS_SQL.DEFINE_COLUMN (c IN INTEGER,
position IN INTEGER,
column IN <datatype>)
Where <datatype> can be any one of the following types:
BINARY_DOUBLE
BINARY_FLOAT
BFILE
BLOB
CLOB CHARACTER SET ANY_CS
DATE
DSINTERVAL_UNCONSTRAINED
NUMBER
TIME_UNCONSTRAINED
TIME_TZ_UNCONSTRAINED
TIMESTAMP_LTZ_UNCONSTRAINED
TIMESTAMP_TZ_UNCONSTRAINED
TIMESTAMP_UNCONSTRAINED
UROWID
VARCHAR2 CHARACTER SET ANY_CS
YMINTERVAL_UNCONSTRAINEDSo you need a call more like:
dbms_sql.define_column(source_cursor, 1, dinf_027.cd_compilatore%type);because v_comp_out is not a datatype, it is a variable.
John
Maybe you are looking for
-
How can I find the correct file size of a layered Photoshop document?
I need to send layered PSD files by email (Mac's Mail), and I don't use services like Dropbox. My ISP allows a maximum file size of 5 MB. I reduce the file size by reducing it to 8 MB/channel, 150 ppi and reducing the maximum size dimension to 10 inc
-
Ipod isn't being recognized by my computer
My ipod has the icon that shows that it needs to be connected to itunes to be synchronized but once i connect it to the computer it won't recognize it. One of the reasons im thinking is because, i connected it to a new computer not the one i had orig
-
Safari for Macbook Pop-Up Problems
I have a Macbook Pro that I got less than a year ago, and I recently started having Safari problems. Whenever I am using safari, I get random pop-ups for things like promotional websites that say they're giving away free stuff, Mackeeper, and other w
-
Solution manager last action time
Dear Expert, I know in crm_dno_monitor have on column show "Change On"-it show the last action for complete the ticket. Now my concern is in crm_dno_monitor, is there any posibility to show on last reply time? i mean the consultant last reply solutio
-
Hello! I'm trying to figure out how to update my a row in my DataGridView. As you can see in my codes, I basically just remade my INSERT statement and changed it to UPDATE. I'm aware of this and I knew it wouldn't work, but how can I update my datagr