Global PLSQL variable - Urgent

Hi All,
I have a table type variable declared in Package Spec.
CREATE OR REPLACE package pkg_monika
is
type t_grp_prod is table of grp_products%rowtype;
tabGrpProd t_grp_prod;
end;
Now, in a After Submit Process i populate this tabGrpProd variable with some data. Then i try accessing it in another After Submit Process. Here, i get an error saying :"Reference to uninitialized collection ".
Is there something i am missing.
Please help.
Thanks in advance.
Monika

Thanks Scott, for looking into my problem.
All the below on Same Page
=======================
After Submit Process 1 -
begin
select *
bulk collect into pkg_monika.tabGrpProd
from grp_products
where project_id = :P0_PROJECT_ID;
INSERT INTO TEST_MG VALUES ('LEVEL1'||pkg_monika.tabGrpProd(1).product_level_1_id);
end; -- This process gets called onChange=doSubmit() of a select list.
After Submit Process 2
begin
for i in 1..pkg_monika.tabGrpProd.last
loop
INSERT INTO TEST_MG VALUES ('LEVEL1'||pkg_monika.tabGrpProd(i).product_level_1_id);
-- Here I will eventually write an update statement. Just for testing sake, i have written an insert into my test table.
end loop;
end; -- This process gets called when user clicks "Cancel" on the same page.
Is there something else also, that i should mention to make the problem clearer.
Thanks
Monika

Similar Messages

  • Dealing with a turn based application with using a global static variable

    Hi there. I read some articles about JavaFX concurrency,so as a newbie i have to practice on it. Now i'm trying to implement a turn based application that can be played among 3-6 players. Moreover, i use a scene imported from a .fxml file and i have to update it correctly depends on some calculations of each thread (in other word players ). My main issue is, i don't wanna use a while loop which checks the state of game like;
    while( GameState != State.GAME_OVER ){
         currentPlayer = GameBoard.getNextPlayer();
         // do some actions,calculations etc.
    So, i want to use worker threads instead of this while loop. I guess using Service class for iterating and assigning the next player will be suitable instead of using the while loop and Tasks for doing each player's calculation,or waiting for some responses from Human players on UI based,however, i'm struggling with two problems.
    There should a global static variable ( like GameState which is an Enumarator ) determines the state of the game,so it should be updated and should be checked by each turn. Is there any way to do this ?
    How can i get rid off this while loop ?
    I will appreciate for every answer. Thanks anyway.

    It shouldn't make too much difference. The basic idea is that you have a model class representing your game state (the Game class in jsmith's example). When a player makes a move, you update the state of the game. Since this will result in changes to the UI, this update should be performed on the FX Application Thread.
    If the player making the move is a human player, the move will likely be made by a user action (button press or mouse click, etc); this will be handled on the FX Application thread anyway.
    When the state of the game changes so it is the turn of an "artificial" player to make a move, have the object representing the artificial player calculate its next move, and then update the game state. Since this is a response to the game state changing (it's now the turn of the artificial player), this will also be on the FX Application Thread.
    The only (slight) complexity comes if the calculation of the move for the artificial player takes a long time. You don't want to perform this long running calculation on the FX Application Thread. The cleanest way to manage this is to launch a Task which calculates the desired move, and then updates the game state when the move is ready. So, something like this:
    GameState game = ... ;
    // UI is bound to the game state.
    ExecutorService executorService = ... ;
    final Player currentPlayer = game.getCurrentPlayer() ;
    final Task<Move> calculateMoveTask = new Task<Move>() {
         @Override
         public Move call() {
              Move move = // compute next move...
              return move ;
    calculateMoveTask.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
         @Override
         public void handle(WorkerStateEvent event) {
              gameState.makeMove(currentPlayer, calculateMoveTask.getValue());
    executorService.submit(calculateMoveTask);
    If you're doing more threading than that, you're probably doing it wrong... . There should also be no need for anything to be held as a "global" static variable (the idea above is the only structural modification you need to the example posted by jsmith).

  • Global Container Variable

    Hi
    Give me idea on Global Container variable in Graphical mapping.
    Thanx in Advance

    Hi
    Ref this
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    http://help.sap.com/saphelp_nw04/helpdata/en/95/bb623c6369f454e10000000a114084/content.htm
    Design and Configuration [original link is broken]
    Thanks
    Sridhar

  • Global Constants / Variable in OSB

    I want to define global Constants / Variable in OSB and I want to access them in XSLT when I am tranforming the requests...
    Any idea how can I do that?
    I want to use these variables and constants for server name and ports (in different environment) and some other stuff.

    We have done a similar implementation for the same scenario. We have created a Xquery where we put in the configuration information as an XML and then in the pipeline stages we use the Assign the Xquery to a a temporary variable and then use the values of the xml using relative xpath expressions.
    This way any time we need to make any changes to the confguration we know once place we can change and it gets reflected in the complete code base.
    Below is how we have done it:
    - create a Xquery with xml configurations (say commonconfig.xq)
    - then using the Assign action get the output of this xquery into a temp var (say commonConfig)
    - then use the configurable values using the relative xpath in the Assign action (say Assign $commonConfig/param1/text() to param1Value
    Let me know if you need further information.
    Thanks,
    Patrick

  • Global Counter Variable - Graphical Mapping

    Hi there.
    Can anybody help with implementing a global counter variable in the graphical mapping please.
    I am trying to populate the "SEGMENT" field of an IDoc with the correct sequence, i.e. add 1 for each new segment. The IDoc has several segments, most of which are embedded. I have tried using the "<b>counter</b>" function but this seems to reset back to one for each instance of it being called.
    I would appreciate any pointers.
    Thank you.
    Mick.

    Hi see this for implementation
    <b>defining Global Variables</b>
    ArrayList arrVI;
    int counter =0;
    <b>Initialization Section</b>
    arrVI= new  ArrayList();
    <b>assignment</b>
    arrVI.add(sVI[iLoopCounter]);
    counter++;
    <b>
    fetch Values</b>
    for (int i =0;i<counter;i++)
    result.addValue(arrVI.get(i)+"");
    Mudit

  • Comma problem with global string variable

    Hi,
    I'm fiighting with comma problem for global string variable. I've on page string for example "7nndqrr52vzyb,0" and by dynamic column link I'm assigning this string to global variable. Then I'm trying to display value of that global variable on another page but I see only string till comma, nothings more. I'm not sure what I'm doing wrong because when I'm trying to assign that value normally by computation process as a constant value is fine and see on another page correct string. I'll be really glad for help.
    Thanks
    Cheers,
    Mariusz

    When it tries to display the string, it sees the comma and wants to believe the string is terminated. You could escape the , in the string or replace it with a different character..
    See this link: http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/concept.htm#BEIGDEHF
    Thank you,
    Tony Miller
    Webster, TX
    If vegetable oil is made of vegetables, what is baby oil made of?
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Global Application variable

    How do I set a global application variable in a Swing application?
    Namely
    MDI display opens a new window
    new window sets a variable
    close the new window and return to the MDI window
    MDI window needs to use the variable.
    Note: the new window is is its own class object.

    What are you talking about?
    Static variables are "global".
    In some class (it does not really matter which) define
    a static variable. O.K. now you have a "global"
    variable.
    Some people may say that this is "bad" programming
    practice, but it is what you asked for.public static variables of public classes are 'global' in the sense you can refer to them if anywhere in an application. Public classes are also 'global' in this sense.
    However, we don't call them global variables, they are class variables. A global variable is generally defined to be one that is associated with the running application. It has no context other than that. It can be used anywhere at any time without any qualifications. In other words, the are terrible.
    I had to maintain an application that had 50 or so global variables. Some of these variables represented the exact same piece of information so it was cruicial during modifications to make sure that they were kept in sync. Don't use this type of design.

  • Corrupt Global User Variable?

    We're running ICM 7.5 and over the weekend, calls stopped routing to one skill.  AT&T, our first line, worked with Cisco and after research/testing, came back with an answer that the global user variable was corrupt.  Has anyone experienced this?  It seems odd that out of the blue this becomes corrupt, especially over a weekend when call volume is low.
    My team, along with Network and AT&T did a process of elimination, removing translation route & global user to validate call routing and adding each piece back.  When the variable was added, call routing failed to backup routing.
    Thanks,
    Jill M Gorrie

    Hi,
    User variables are meant to be used in web forms and web forms only. You can certainly pass their values to business rules when you used them in POV or page section of the form during save. All you need to do is to create another business rule (local or global) variable in business rule on the corresponding dimension and use it in your business rule. If you enable running the business rule on save and using the form values for variables options in form properties, business rules would replace the values of business rule variables with the values that are set in user variables.
    Cheers,
    Alp

  • How to assign itemrender variables in global public variable of my applicaton.

    Hi Friends,
    How to assign internal item render values in global public variable. can u see below example.
    List have one itemrender,within the itemrender i am using data grid .The  dataGrid have itemrender.now i tried the data grid itemrender assign values to public variable of my application,but the Error came... How can u slove this Problem Any One can Help to me.
    Example:
    public var myData:arrayCollection;
    <mx:List variableRowHeight="true" dataChange="validateNow()"  width="900" id="Lst_userlist" verticalScrollPolicy="off"  horizontalScrollPolicy="off" 
         buttonMode="true">
    <mx:itemRenderer>
      <fx:Component>       
       <mx:VBox paddingTop="-5"  horizontalScrollPolicy="off" verticalScrollPolicy="off" >        
             <fx:Script>
              <![CDATA[        
               override public function set data(value:Object):void
              ]]>
             </fx:Script>
             <mx:VBox id="vbox_grid" horizontalScrollPolicy="off" verticalScrollPolicy="off" width="890"  paddingLeft="10" paddingTop="5"
                     backgroundColor="#317152" color="#FFFFFF">        
              <mx:DataGrid visible="false" includeInLayout="false" height="100%" id="membershipGrid" alternatingItemColors="[#DCDCDC,#F8F8FF]"
                  paddingLeft="5"  horizontalScrollPolicy="off" color="black"
                  horizontalGridLines="false" verticalScrollPolicy="auto"  verticalGridLines="false"   rowHeight="25"
                  borderSkin="{null}" showHeaders="true" borderVisible="false" dataProvider="{data.dataCollection}" width="900" >
               <mx:columns>
                <mx:DataGridColumn width="180" headerText="Name" minWidth="150" sortable="true"  wordWrap="true" >
                 <mx:itemRenderer>
                  <fx:Component>
                   <mx:HBox horizontalScrollPolicy="off"   >
                    <fx:Script>
                     <![CDATA[
                      override public function set data(value:Object):void
                      function Click_Name():void
                        outerDocument.myData=data;  //  Here Error  came                 
                     ]]>
                    </fx:Script>
                    <mx:Image id="fileimg"    buttonMode="true"  toolTip="This is the User's Home Organization"/>          
                    <s:Label  id="lbl_Gridcloumn_name"  width="200" buttonMode="true" textDecoration="underline"  click="Click_Name()"  />
                   </mx:HBox>
                  </fx:Component>
                 </mx:itemRenderer>
                </mx:DataGridColumn>
    </cloumn>
    </datagrid>
    Error:
            Access of possibly undefined property myData through a reference with static  type com.istmanagement.views:ProgramAcessRights_ComponentInnerClass3.
    Thanks,
    Magesh R.

    Hi Flex harUI ,
    Thanks man....because  of i was stugle in last one week.... once again Thanks.......

  • Accessing Tomcat Global Environment Variables

    Hello,
    I have tried to access Tomcat 5.0 (xx) Global Environment variables.
    I have the Integer simpleValue defined in the Tomcat Administrators panel under "Environment Entries"
    Here's my code:
    Context initContext = new InitialContext();
    Context envContext = (Context)initContext.lookup("java:comp/env");
    Integer i = (Integer)e.get("simpleValue");
    I have also tried and infiinite variation of this with no success (Accessing the Initialcontext directly)
    The Tomcat docs at: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html
    says:
    "<Environment> - Configure names and values for scalar environment entries that will be exposed to the web application through the JNDI InitialContext (equivalent to the inclusion of an <env-entry> element in the web application deployment "
    PLEASE HELP !!!
    Geir Ove

    This is a Tomcat bug. See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14228.

  • Avoid Global Public variables...

    Hello Experts,
    I have declared few variables in package specification (l_test , l_test_2)and i'm using across the API procedures.
    But when i run the TOAD expert it says "Avoid defining global public variables in the package specification."
    So i thought of moving the code from package specification to package body...
    Is this a good approach and will my code work as it was working before if i declare in the body...
    Plz suggest ...
    Thanks...
    Earlier
    Package Specification Part
    CREATE OR REPLACE PACKAGE PKG_TEST
    AS
    l_test NUMBER(1);
    l_test_2 NUMBER(2);
    END;New
    CREATE OR REPLACE PACKAGE BODY PKG_TEST
    AS
      l_test NUMBER(1);
    l_test_2 NUMBER(2);
       PROCEDURE process
       IS
       END process ;
       PROCEDURE process_2
       IS
       END process_2 ;
    END PKG_TEST;

    Linus,
    Just so you are aware, the scope of those variables are different depending on if they are defined in the PACKAGE (SPEC) or PACKAGE BODY.
    Declared in the PACKAGE (Spec): Globally accessible to everything on the Schema.
    Declared in the PACKAGE (Body): Globally accessible to everything with that particular Package.
    So as you can see, this quite a big difference. TOAD is warning you because putting globals in the PACKAGE is a pretty sloppy coding practice that can easily lead to difficult to maintain code. While you can ignore it, I'd suggest not doing that. ;)
    In fact, I'd suggest avoiding globals altogether when possible. Passing parameters may be more time consuming, but it makes it very clear what each procedure/function should be doing, and future programmers will thank you. Time you'll save on initial programming will be made up when doing maintenance. But admittedly globals are useful, just be careful when using them. Getting your code to work isn't enough; you should aim to make it clear and understandable too.

  • Global PATH variables?[solved]

    How do i set global path variables in archlinux??
    I need to do this because ie, I am using gmrun, and I just installed xarchiver. But gmrun cant find xarchiver since it is located in /opt/xfce4/bin/.. I can append this to my PATH in .zshrc/ .bashrc file, but this only helps when i run it through the terminal.
    I want to also be able to have a global alias file, to run the alias xterm = 'xterm -bg black -fg white' through gmrun.
    Couldnt find any documents on how this works in archlinux.
    Last edited by jinn (2007-02-04 10:56:40)

    For the path, run 'bash /etc/profile' to update the path for the current terminal. You can also logout then relogin to set them for the whole session. No files needs changing.
    For the alias, create a 'etc/profile.d/alias.sh' file. add the alias in it and give it executable permission. For the change to take effect, you'll need to run  'bash /etc/profile' or logout/relogin.

  • Accessing a Global package variable Via Select

    Hi All,
    I want to access a global variable i.e package global variable through a select query. Is this possible or not possible. Please share some inputs on this.
    Thanks

    Just to clarify that you can reference the global variable if your SQL is itself within PLSQL. It will be bound in.
    CREATE OR REPLACE PACKAGE p1
    AS
      my_global NUMBER := 1;
      FUNCTION f_get_my_global
      RETURN NUMBER;
      PROCEDURE p_do_something;
    END;
    CREATE OR REPLACE PACKAGE BODY p1
    AS
      FUNCTION f_get_my_global
      RETURN NUMBER
      AS
      BEGIN
         RETURN my_global;
      END;
      PROCEDURE p_do_something
      AS
        l1 NUMBER;
      BEGIN
        SELECT /*+ find_me */
               my_global
        INTO   l1
        FROM   DUAL;
      END;
    END;
    SQL>  exec p1.p_do_something;
    PL/SQL procedure successfully completed.
    SQL> select sql_text from v$sql where sql_text like '%find_me%';
    SQL_TEXT
    SELECT /*+ find_me */ :B1 FROM DUAL
    SQL>

  • Global package variable for the current rendering item

    I like to define a generic plsql function which handles all the page 0 item conditions. I will place this function call in all page 0 item conditions.
    Now I need a global (htmldb_application) package variable which I can use to identify for which item condition the function is executed.
    Which global variable can I use for this purpose or is there an other way to do this.
    I dont't want to give the the item names hardcode as argument of the function.

    Scott,
    I will try to clarify my question.
    I have lot of page 0 items.
    I like to give every item the same plsql condition such as htmldb_pck.show_item or
    htmldb_pck.show_item('#CURRENT_ITEM#').
    In my own htmldb_pck.show_item function I have all the display coding of the generic items.
    My problem is that I have to know from which item the function is called.
    Thanks,
    Fred.
    May be this is something for an enhancement. Not only for the items, but also for the buttons, tabs, tab sets and report columns. So you know in generic pl/sql from which object the pl/sql is called.

  • Creating text variable, urgent plz

    Hi friends,
               I would like to create a text variable on fiscalyear/period. the requirement is
    when user enters 001.2007   it has to display jan2007
                               002.2007   it has to display feb2007 so on.
       but when I am trying to create on fiscalyear/period it is not allowing me to create text variable. can any one suggest me please, it is an urgent requirement,
    I appreciate your help very much.....
    Ravi.

    Hi ravi
    we can do this with the text with replacement path and the var which u have created u to put display as text thats it...
    take a selection in the rows and create a variable in the text heading and give replacement fron the user entry default variable which the user enters.
    Assign points if it helps
    Khaja

Maybe you are looking for

  • Acrobat Forms - Make fillable text box appear after box checked or drop down menu item selected

    I have been asked to build an approvals form for my workplace however the approval processes vary considerably depending on the subject. I have been asked to create a list of topics in the form of check boxes or a drop down menu which will then popul

  • External XML files in Flash iPhone apps

    Hi everyone. I know that apple has loosened up on what is and isn't allowed on the app store these days, such as flash. I was thinking of writing an app that would call upon a web based xml file to call up pictures to display in the iPhone. I know Ap

  • Problem with Jasper Reports

    hi evrybody... i'm having a problem while using Jasper Reports. I'm trying to Export a jrxml file generated by JasperAssistant plug-in in eclipse. but all i'm having is an exception. the following is my code and the said exception: CODE: public class

  • When- When Validate Item Fails

    Hi Friends, I am having a problem. I have written some code for an item and trigger is WHEN-VALIDATE-ITEM. I am also using RAISE Form_Trigger_Failure; Now when wrong data enters and exception is raised; EXIT Button does not work. Like if a wrong entr

  • DateFormat is not sensitive to Windows locale setting

    Hi all, The DateFormat is not sensitive to Windows locale setting, that's why this piece doesn't work correclty. This bugs is already know (#4514389) SimpleDateFormat dateFormat; dateFormat=((SimpleDateFormat)DateFormat.getDateInstance(DateFormat.SHO