Package variable declaration

I need to declare Item_To_Go_To package level variable stored in the Instace package for the below code.
I have create a a package specification in the form as a Program Unit named "Instance".
Now i need to declare Item_To_Go_To variable which will store control name like
Instance.Item_To_Go_To := 'myblock.myitem';
I have controls like text item, list item, Checkbox. How to declare these variables?
I have used the below one:
PACKAGE Instance IS
Item_To_Go_To item;
END;
In my example Instance.Item_To_Go_To := 'User.FIRST_NAME';
is giving expression is a wrong type error. Please let me know what i have done wrong.
I have used timer expired trigger to overcome my illegal restricted procedure Go_item issue.
Code snippet.
Declare
htimer Timer;
Begin
Instance.Item_To_Go_To := 'myblock.myitem';
Create_Timer( 'wvi_nav_timer', 1, NO_REPEAT);
End;
Then in the When-Timer-Expired trigger...
Begin
If ( Get_Application_Property( Timer_Name ) = 'wvi_nav_time' ) Then
Go_Item( Instance.Item_To_Go_To );
End If;
End;
Please refer:
Alternative trigger like post_change but can 'go_item'
Edited by: Chris90909 on Jun 12, 2009 12:27 PM

As you are trying to assign a varchar-value to the variable, you should declare it as varchar2 like:
PACKAGE Instance IS
  Item_To_Go_To VARCHAR2(61);
END;

Similar Messages

  • View of variables declared within a package/procedure

    Does anyone know of a view which holds all the variables declared within a package/function/procedure?
    I can see that _arguments holds the parameters defined.
    PLSQL Developer displays these things in their drop downs, so I assume they are either getting it from a view or have written something which parses the _source view?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Do you mean this ?
    SCOTT@db102 SQL> desc dbms_output
    PROCEDURE DISABLE
    PROCEDURE ENABLE
    Argument Name                  Type                    In/Out Default?
    BUFFER_SIZE                    NUMBER(38)              IN     DEFAULT
    PROCEDURE GET_LINE
    Argument Name                  Type                    In/Out Default?
    LINE                           VARCHAR2                OUT
    STATUS                         NUMBER(38)              OUT
    PROCEDURE GET_LINES
    Argument Name                  Type                    In/Out Default?
    LINES                          TABLE OF VARCHAR2(32767) OUT
    NUMLINES                       NUMBER(38)              IN/OUT
    PROCEDURE GET_LINES
    Argument Name                  Type                    In/Out Default?
    LINES                          DBMSOUTPUT_LINESARRAY   OUT
    NUMLINES                       NUMBER(38)              IN/OUT
    PROCEDURE NEW_LINE
    PROCEDURE PUT
    Argument Name                  Type                    In/Out Default?
    A                              VARCHAR2                IN
    PROCEDURE PUT_LINE
    Argument Name                  Type                    In/Out Default?
    A                              VARCHAR2                IN
    SCOTT@db102 SQL>                                         

  • Using a static variable declared in an applet in another class

    Hi guys,
    I created an applet and i want to use one of the static variables declared in teh applet class in another class i have. however i get an error when i try to do that...
    in my Return2 class i try to call the variable infoPanel (declared as a static JPanel in myApplet...myApplet is set up like so:
    public class myApplet extends JApplet implements ActionListener, ListSelectionListener
    here are some of the lines causing a problem in the Return2 class:
    myApplet.infoPanel.removeAll();
    myApplet.infoPanel.add(functionForm2.smgframeold);
    myApplet.infoPanel.validate();
    myApplet.infoPanel.repaint();
    here are some of the errors i get
    dummy/Return2.java [211:1] package myApplet does not exist
    myApplet.infoPanel.removeAll();
    ^
    dummy/Return2.java [212:1] package myApplet does not exist
    myApplet.infoPanel.add(functionForm2.smgframeold);
    ^
    dummy/Return2.java [213:1] package myApplet does not exist
    myApplet.infoPanel.validate();
    ^
    dummy/Return2.java [214:1] package myApplet does not exist
    myApplet.infoPanel.repaint();
    ^
    please help! thanks :)

    I don't declare any packages though....i think it just doesn't recognize myApplet for some reason..
    other errors i got compiling are:
    dummy/Return2.java [82:1] cannot resolve symbol
    symbol : variable myApplet
    location: class Return2
    updateDesc.setString(3, myApplet.staticName);
    I Don't get why i'm getting this error cuase they worked fine when myApplet was a standalone application, not an applet.
    myApplet is in the same folder as Return2 and it compiles properly.

  • How to refer a packaged variable

    Hi,
    I have gone through the forum where it mentions how to refer a constant in a package.I want to refer a variable declared in package spec.
    CREATE OR REPLACE PACKAGE p1
    IS
    sDebugMode VARCHAR2(3) := 'ON';....
    end;

    user8731258 wrote:
    I have gone through the forum where it mentions how to refer a constant in a package.I want to refer a variable declared in package spec.
    CREATE OR REPLACE PACKAGE p1
    IS
    sDebugMode VARCHAR2(3) := 'ON';
    end;
    In order to use PL/SQL variables (including global static variables), a SQL needs to be created with bind variables. This requires the use of PL/SQL itself. The following is thus valid:
    create or replace procedure GetFooCursor( cur out sys_refcursor ) is
    begin
      --// PL/SQL creates a SQL bind variable and bind it using
      --// the PL/SQL variable
      open cur for select * from foo_table where foo_switch = p1.sDebugMode;
    end;However, you cannot do the following using SQL only:
    SQL> select * from foo_table where foo_switch = p1.sDebugMode;The SQL engine needs to resolve what "+p1.sDebugMode+" refers to. The SQL engine only support calling PL/SQL functions. It is not capable of looking inside the PL/SQL engine's memory and access PL/SQL variables directly.
    So if you want the SQL engine to access that variable directly, you need to create a PL/SQL function that returns the variable value. Which is not really a great approach:
    create or replace function SillyFunc return varchar2 is
    begin
      return( p1.sDebugMode );
    end;The following SQL can then be used:
    SQL> select * from foo_table where foo_switch = SillyFunc();

  • Accessing database package variables from Forms

    I have a database package that populates a table of values, i.e.
    type t_route_list is table of rt_route.RTR_ID%type;
    route_list t_route_list
    route_list gets populated by a package function and I want to access route_list in the Form.
    While I can access other package variables by writing a function that returns the variable, Forms doesnt seem to like functions that return a user defined datatype as above. I have also tried using a procedure with an OUT param instead of a function but it also fails with same error.
    i.e.
    declare
    v_route_list pkg_bulk_route_replace.t_route_list;
    begin
    pkg_bulk_route_replace.init;
    pkg_bulk_route_replace.get_route_list(v_route_list);
    message(v_route_list(1));
    end;
    This will not compile, but removing the index (1) from the last line makes it compile but crash with ORA-0600.
    The code above with message replaced with dbms_out.put_line works fine on TOAD.
    So my question is......
    Can my database package return a plsql table to a form and if so, how?!

    Actually I've got this to work now!
    Thde main culprit appears to be a difference in the version of sql or pl/sql used on forms (version 5) and the database (8.1.7).
    I had defined my table as a nested table. By redefining this as a indexed table, simply by adding on 'index by binary_integer' on my server package, I am suddenly able to access the elements of the table on my form. Fortunately this did not break the server code either - the table was populated using bulk collect and that still works.
    Still got a bit of coding to do, but things are looking up now.

  • To view package variables in Forms 6i debugger

    Can anyone tell me how to view the value of the variables declared in the package spec(from forms side)? i can see only the local variables and global variables(declared using :GLOBAL) in the debugger window.

    In the 6i Debugger the visible Package variables are restricted to the Variables defined in the package body and these are only visible whilst you are instanciating the package for the first time - e.g. running through the anonymous block that you can have at the bottom of the package Definition.
    Otherwise they are invisble. Variables defined within Program units inside the Package are of course visble.
    The new Debugger in Forms 9i has fixed this problem and you can always view (and watch!) Variables defined both in the package Spec and Body.

  • Referencing Package Variables

    Running Forms 6i and Oracle 8.1.6
    Can you reference server side package variables directly from Forms, or do you still have to write a wrapper procedures to "set" and "get" them.
    CREATE OR REPLACE package test_pkg as
    v_pkgvar varchar2(10) := 'TEST';
    TYPE r_emp_rec IS RECORD
    (empno emp.empno%TYPE,
         ename emp.ename%TYPE,
         mgr emp.mgr%TYPE,
         deptno emp.deptno%TYPE,
         dname dept.dname%TYPE,
         loc dept.loc%TYPE
    TYPE t_emp_rec IS TABLE OF r_emp_rec INDEX BY BINARY_INTEGER;
    end;
    DECLARE
    data_blk test_pkg.t_emp_rec;
    v_test varchar2(100) := test_pkg.v_pkg_var;
    BEGIN
    null;
    END;
    It seems funny that i can reference test_pkg.t_emp_rec;
    but not test_pkg.v_pkg_var;
    Thanks for your help

    You have to use wrapper setters and getters to reference package variables on Server side PL/SQL from client side PL/SQL (Forms) this will not change no matter what the versions concerned

  • Package variables urgent

    Hi,
    I want to use certain variables which have been declared in the package ie global variables .
    These variables are to be accessed in a trigger.
    how do i do this.
    any method is welcome,either through functions or procedures.
    please do provide the solution

    Thanks both for the reply.
    Now the scenario has changed a bit.
    what i have done is that i have defined a package variable in the package.
    Now The package has 4 sps and i function.
    I assign a value to the package variable in one of the sps.
    using this value, I insert it into a temporary which i create inside the sp.(using execute immediate)
    can i do this.i get an error of previalges which was sorted out.
    Now i am accesiing the data in the temp table inside the function.the function returns me an id which is retrieved from another table using the value in the temp table.
    This function is called inside a trigger,which gives me an error ora-04601-existing state of package being discarded.
    pls help.

  • Packaged variables and triggers

    I am creating a trigger taht will update the values of packaged variables.
    I need some help getting the variables to work correctly...here's the code and issues:
    -------------PACKAGE SPECIFICATION------
    CREATE OR REPLACE PACKAGE discount_pkg
    IS
    pv_disc_num  NUMBER;
    pv_disc_txt  VARCHAR2(50);
    END;
    ------------DECLARE VARIABLES-----------
    BEGIN
    discount_pkg.pv_disc_num:=5;
    discount_pkg.pv_disc_txt:='N';
    end;
    --------------TRIGGER 9:5----------------
    CREATE OR REPLACE TRIGGER bb_discount_trg
    AFTER UPDATE OF orderplaced ON bb_basket
    FOR EACH ROW
    BEGIN
    IF :NEW.orderplaced=1 THEN
    IF discount_pkg.pv_disc_num=5 THEN
      discount_pkg.pv_disc_txt:='y';
    END IF;
    END IF;
    END;
    /And the resulting test reveals the following errors:
    SQL> update bb_basket
      2  set orderplaced=1
      3  where idbasket=13;
    1 row updated.
    SQL> print pv_disc_num;
    SP2-0552: Bind variable "PV_DISC_NUM" not declared.
    SQL> print discount_pkg.pv_disc_num;
    SP2-0552: Bind variable "DISCOUNT_PKG" not declared.Any idea why this is happening?

    SQL> print pv_disc_num;
    Print statement can only be used to display the value of environment variable. In your case, you are trying to display the value of a variable in a package. To display a value of a variable in a package, you need to retrieve it using pl/sql block. Try this:
    begin
    dbms_output.put_line(discount_pkg.pv_disc_num);
    end;
    if you want to use the PRINT syntax, you need to declare an environment variable to store the value:
    SQL>variable pv_disc_num NUMBER
    SQL>begin
    :pv_disc_num := discount_pkg.pv_disc_num;
    end;
    SQL> print pv_disc_num

  • How to get values from a stored package variable of type record ?

    Sir,
    In my JClient form, I need to get values from a database stored package variable of type record. And the values are retained in the JClient form for the whole session. The values are copied only once when the form is started.
    What is the best way to do that ?
    Thanks
    Stephen

    Stephen,
    not sure what your model is, but if it is Business Components, I think I would expose the properties as a client method on the application module. This way all JClient panels and frames will have access to it. You could use a HashMap to store the data in teh app module.
    If JDBC supports the record type, then you should be able to call it via a prepared SQL statement. If not, you may consider writing a PLSQL accessor to your stored procedure that returns something that can be handled.
    Steve Muench provides the following examples on his blog page
    http://otn.oracle.com/products/jdev/tips/muench/stprocnondbblock/PassUserEnteredValuesToStoredProc.zip
    http://otn.oracle.com/products/jdev/tips/muench/multilevelstproc/MultilevelStoredProcExample.zip
    Frank

  • 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.S

    Hi 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.

  • Error trying to run SSIS Package via SQL Server Agent: DTExec: Could not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object

    Situation:
    SSIS Package designed in SQL Server 2012 - SQL Server Data Tools
    Windows 7 - 64 bit.
    The package (32 bit) extracts data from a SQL Server db to an Excel Output file, via an OLE DB connection.
    It uses 3 package variables:
    *) SQLCommand (String) to specify the SQL Statement to be executed by the package
    Property path: \Package.Variables[User::ExcelOutputFile].Properties[Value]
    Value: f:\Output Data.xls
    *) EXCELOutputFIle (String) to specify path and filename of the Excel output file
    Property path: \Package.Variables[User::SQLCommand].Properties[Value]
    Value: select * from CartOrder
    *) VarObjectDataSet (Object) to hold the data returned by SQL Server)
    Property path: \Package.Variables[User::VarObjectDataSet].Properties[Value]
    Value: System.Object
    It consists out of 2 components:
    *) Execute SQL Task: executes the SQL Statement passed on via a package variable. The resultng rows are stored in the package variable VarObjectDataSet
    *) Script Task: creates the physical output file and iterates VarObjectDataSet to populate the Excel file.
    Outcome and issue:The package runs perfectly fine both in SQL Server Data Tools itself and in DTEXECUI.
    However, whenever I run it via SQL Server Agent (with 32 bit runtime option set), it returns the errror message below.
    This package contains 3 package variables but the error stating that a package variable can not be set, pops up for the VarObjectDataSet only.  This makes me wonder if it is uberhaupt possible to set the value of a package variable
    of type Object.
    Can anybody help me on this please ?
    Message
    Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  6:40:20 PM  DTExec: Could
    not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object.  Started:  6:40:20 PM  Finished: 6:40:21 PM  Elapsed:  0.281 seconds.  The package execution failed.  The step failed.
    Thank you very much in advance
    Jurgen

    Hi Visakh,
    thank you for your reply.
    So, judging by your reply, not all package variables used inside a package need to be set a value for when run in DTEXEC ?
    I already tried that but my package ended up in error (something to do with "... invocation ...." and that error is anything but clearly documented. Judging by the error message itself, it looks like it could be just about anything. that is why I asked my
    first question about the object type package variable.
    Now, I will remove it from the 'set values' list and try another go cracking the unclear error-message " ... invocation ...". Does an error message about " ... invocation ..." ring any bells, now that we are talking about it here ?
    Thx in advance
    Jurgen
    Yes exactly
    You need to set values only forthem which needs to be controlled from outside the package
    Any variable which gets its value through expression set inside package or through a query inside execute sql task/script task can be ignored from DTExec
    Ok I've seen the invocation error mostly inside script task. This may be because some error inside script written in script task. If it appeared after you removed the variable then it may because some reference of variable existing within script task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Package variable g_security_group_id must be set

    Hi all,
    i have the following problem.
    I have a form based on an interactive report.
    all standard made out of the apex possibilities.
    i have a number of validations, all automatically created by apex, in the form because of the not possible being null of certain columns in my database.
    when i press the insert button or save button when i didn't fill in all the necessary fields, i get the following error:
    ORA-20001: Package variable g_security_group_id must be set.
         Error      ERR-1023 Unable perform validations.
    OK      
    i allready checked my validations and i can't find something wrong with it.
    they haven't been modified neither after being automatically created by apex
    anyone any clue?
    thanks in advance,
    Mr. T

    Desmedt,
    Can you please demonstrate this on apex.oracle.com?
    Scott

  • Help needed for loss of package variables!

    Seem to have an annoying problem which may just be a misundertanding about libraries.
    I have two forms. Initially form 1 created initialised two package variables (of type ora_java.jobject) using the ora_java.new_global_ref function and these persisted across multiple user interactions and existed when form 2 was called (as new form / sharing libraries. Form 2 could call form 1 and the package variables still had values OK.
    These package variables were placed in library which only contained this package and was attached to both forms.
    I needed more functionality on form 2 so I created a menu module which had to run some code from form 2. I put most of the code (actually imported as it's mostly java classes) into the same library as the package containing the variables and attached the expanded pll to both forms and the menu module. Now when I run form 1 values for the package variables exist for the life of form 1 and form 2, but when I try to reference them after the initial display of form 2 they have disappeared!
    Also if form 1 is called again then it behaves differently in that references to the variable are lost after the form is first displayed.
    All forms and menus have shared libraries.
    I have spent some time playing with different variables and it's the same regardless of the variable type.
    Must be something to do with the library I think but don't know what - please help before I tear all my hair out!

    Ian,
    Ensure you have set the SHARE_LIBRARY_DATA parameter in your CALL_FORM statement.
    Also deleting the .fmx files, disconnecting from the database and re-building the form usually helps when everything else fails and you have not made any other changes you can think of that may have caused it to break.
    Also check that the forms are pointing to the right version of your .pll. Removing the attached library, adding it back and recompiling should do the trick.
    Hope this helps, before you lose your hair!

  • 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

Maybe you are looking for

  • 8$ paypal to whoever helps me fix my itunes prob. external hd help

    I recently bought a seagate external hard drive, which I immediately started moving all of my music, videos and pictures to. It was recognized as my E: drive. after a few weeks of normal use with itunes to play my music, my computer began to recogniz

  • Can't load images: nullPointerException

    This one is baffling me. NetBeans nor my hard-coded Image seems to feel like showing itself and throws a nullPointerException instead. The stacktrace/full error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException         at maps.ma

  • How to avoid that FalshPlayer use the disk C:\ for installation?

    I got a new PC Clone system and for several reasons the hard disk where I have the Windows XP is not the C:\. When I try to install FlashPlayer version 10 always try to install it on the C:\ (that is a card reader) and find there is no space and then

  • I need to fix a "B100" error on a Pixma MP560

    As the subject says I need to fix a "B100" error on a Pixma MP560. How do I fix it?  Please help!!!  Thank you

  • REFRESHING CONTENT PANE IN BRIDGE

    While reviewing pictures via the content pane, I right-click on a duplicate photo but it takes several minutes for the picture to delete from the hard drive.  How do I refresh the content pane after deleting photo's from the hard drive?