Global variable access behaving differently

Hi There,
I am kind of confused at the way the output of this sql;
select
proc1.get_id(dwg_no, rev_id),
proc1.get_adcn(1) from
table t1,
table2 t2
where
t1.pkey = t2.fkey;
PL/SQL (Proc1)
create package proc1
function get_id(
dwg_no varchar2(10),
rev_id varchar2(4)
function get_adcn(
a number
create package body proc1 ..
--declare/set the global variable
v_adcn_no varchar2(4) := null;
funciton get_id (dwgno, revid) as
v_rev_id varchar2(12) := null;
select 'AB', '55' into v_rev_id, v_adcn_no from dual;
return v_rev_id;
funciton get_adcn (a number) as
return v_adcn_no;
My expectation is th get_id function would be executed and the global variable v_adcn_no would be set to '55' so that this value would be returned when get_adcn fucntion is called.
But it doesn't happen so.(i validated this)
[at times i returns 55, at times it returns null]
Actually i simulated my problem with a simple example.
and I do not want to execute the same sql again when get_adcn function is called.
Any help is highly appreciated.
Regards,
Srini

Thx for your reply,
that does not meet my requirement, bcos there is no guarantee that get_rev_id function would be called first before get_adcn.
But my requirement is i want the rev_id function to be executed first, how would i ensure that.
regards,
Srini

Similar Messages

  • Global Variable Access in OWB.

    Hi All,
    OWB Client 9.0.2.56.0
    OWB Repository 9.0.2.0.0
    Is it possble to have variables whose values can be accessed and updated across mappings?
    eg global variables which can be referred/modified in any mappings
    Thanks in Advance.
    Regards,
    Vidyanand

    To implement this, you could persist a value in a temporary table from a certain mapping and then read the value from another mapping that uses that value as an input parameter (if they run sequentially from a process flow, for example).
    Regards:
    Igor

  • Global Variable translated to different characters

    We recently upgraded BODS from 4.2 SP1 to 4.2 SP4. Now we are facing issues in those DataFlows where are used Hierarchy Flattering functions, that Global Variables are wrongly translated from text to weird Asian characters. E.g. varchar variable: 'abc' is transformed to '扡c'. As data source/target is used HANA. The issue is caused whenever there is any table from HANA datastore 'directly' connected to HANA (attached picture). When used ODBC connection to HANA than it works fine, but then we are loosing Bulk load options.
    Attached ATL (with .txt extenstion) has password: abc
    Versions:
    DS: 4.2 SP4
    HANA: 1.0 SP09
    HANA Client ODBC: 1.00.09 (tested also on 1.)

    Hi Vanda,
    668 is the build number. If you search the SAP Notes/KBAs for 14.2.4.668, you'll find the KBA release notes for that version. 14.2.4.668 corresponds to SP4 (patch 0).
    SAP Data Services 4.2 Support Pack 4 (Version 14.2.4.668) Announcement
    Regards,
    Karen

  • Using column_name%TYPE to define variable type behaves differently..

    CREATE TABLE a_table(a_column VARCHAR2(10))
    PROCEDURE x(in_arg a_table.a_column%TYPE)
    IS
    tmp_arg a_table.a_column%TYPE;
    BEGIN
    tmp_arg := in_arg;
    END x;
    EXEC x('this string is longer than 10 chars');
    -> x:Line 1:Error, buffer too small.
    Why?
    Presumption: using table.column%TYPE in the args list takes only the TYPE. Using it to declare a temp variable, takes the TYPE AND the SIZE of the column..

    You have declared a 10 char max column here
    CREATE TABLE a_table(a_column VARCHAR2(10))And inside your procedure you declare an x variable sized the same as your column, with a maximum 10 characters length, but you declared a constant string with more than 10 characters, so the result is a buffer too small or a string too big.
    EXEC x('this string is longer than 10 chars');
    -> x:Line 1:Error, buffer too small.~ Madrid

  • UserId with same access behaving differently in ( Quality and Sandbox )

    A user exists in quality and sandbox systems with the same profiles, However, when I try to execute Tcode IW22 and enter notifications, A screen appears where I can view Services for Object Icon. When I click in the Create Attachment in the Services for Object in the Quality system, A dialog box appears to upload the documents from my desktop. However the same does not happen in my sandbox system.....The profiles are same for the user in both the systems...
    The PID values are same for both the users. Authorizations and Transactions are same for the UserIds.
    I am stuck with this..Please help me with this.

    Hello Ravi
    Try the following
    1. Delete the user and recreate the same user with the same roles or create a new user with the same roles and check.
    2. Since this is a sandbox try giving SAP_ALL and SAP_NEW profile, if that works then defenitely there is some difference in the roles from Q box. Even if that doesn't work then it is not authorisation problem.
    Thanks & regards
    bala

  • How can I pass a value field to a global variable?

    I have a doubt,
    I wnat to know if is possible to pass a value field to a global variable inside of DataFlow?
    That a try to do is at the time to execute a JOB on line (real time), depending of the value field that i receive, only certain DATAFLOWS will be executed  depending of the value field.
    I hope you can help me.
    Kind regards!!!

    It can be done via various ways, your approach is kind of odd, though.
    You are saying you have one kind if Input message, depending on the flag you want to do different transformations. The way you envision that is by loading that flag into a global variable and use different dataflows then.
    Can you use different dataflows within one Realtime Job? Yes, usually the first loads an in-memory datastore.
    Can you write into a global variable? Yes and No. Not directly, but you can write the value into e.g. a database and using the sql() function read it from there. But why would you. You could write it into the in-memory datastore. And then you run your n dataflows, each has a filter. So only one of these dataflows will actually process the data.
    Are there other approaches? I would have a Case transform at the beginning and route the data into different queries depending on the data. So all in one dataflow. Your approach is fine for a batch dataflow where a dataflow is started, does something and then ends. But that's not how it works in Realtime!

  • How to creat a global variable?

    I want to creat a start button of global variable to control different programs in the sequence structure. But I do not know how to creat it. Thanks for answering.
    Solved!
    Go to Solution.

    Perry Liu wrote:
    Thanks for answering. I attached the code below.
    What I want to do is to combine Get Voc/Isc and GO buttons (shown in the front panal) to one button, and also combine Setup Linear Stair Sweep and start sweep together. I do now find a good way to do that. Thanks so much for your kind help.
    There is no "Get Voc/Isc" or "GO" button anywhere on the front panel, and I have no idea what you mean by "Setup Linear Stair Sweep" and "start sweep". Are you sure you uploaded the correct code?
    Other VI comments:
    You are abusing/misusing global variables. 
    You already have a state machine, so you can actually code this using just the state machine without actually needing the separate event structure loop. Even if you do keep it, that still does not require you to use global variables.
    Why do you have a loop around the Write to Spreadsheet File? This serves no purpose and actually stops your code in that loop until the Stop global is set. This doesn't make much sense.
    Since you do not have a path wired to the Write to Spreadheet File VI, you will be asked for a path each time the loop iterates. Use a shift register to hold the value of the path from iteration to iteration.
    Get rid of the Build XY Graph Express VI and those Convert to Dynamic Data functions. Replace with a single Bundle function.

  • How can I run two different vi's in same project which are accessing same global variable with out effecting the speed of the execution of both the vi's

    Hi
    I have build an Labview project with FPGA target .  I have configured an FPGA VI and an host Vi to acquire data and logged the data to a file and stored the latest data in a global variable simultanously. I have configured one more VI in the same project  to access the global variable.  I have build a dll to access both the VI as functions in LabWindows/CVI code.  My task in CVI is to update configured GUI with latest data periodically and run the  host VI continously for a long time and log the data to a file. GUI should update for every one second with latest data for this I am using the second VI in which I am accessing the global varibale in which the latest data has been stored in host VI.

    Duplicate Post (go here)

  • How can I handle global variables from different DLLs created based on VIs that access those variables

    My goal is to break apart an entirely LabView created application so I can still use parts of it (builded as Shared DLLs upon on some VIs) in my new .Net application. My problem is that some others VIs (that I am not intending using) are changing those global variables (in the natural data flow of the application).  I could , of course, send the values of those global variables as parameters, but I don't know how should I pass those data types (and their size)... There are some clusters there...
    Any help is well appreciated

    vulpe wrote:
    My goal is to break apart an
    entirely LabView created application so I can still use parts of it
    (builded as Shared DLLs upon on some VIs) in my new .Net application.
    My problem is that some others VIs (that I am not intending using) are
    changing those global variables (in the natural data flow of the
    application).  I could , of course, send the values of those
    global variables as parameters, but I don't know how should I pass
    those data types (and their size)... There are some clusters there...
    Any help is well appreciated
    Your
    problem is of course the use of globals. That is almost always a bad
    idea and asking for troubles once your application gets bigger.
    Avoiding race conditions and undesired influences between different
    parts of your application will take up more and more of your
    development time as your project grows.
    You should look into Functional Globals (LV2 style globals) and shift
    registers for data storage and queues for passing information between
    different parts of your applciation. Using these techniques
    consequently, will require you to spend some more time initially but
    will allow you to grow your application without increasing the
    complexity of managing such things exponentially.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How do I store VI References in global variables and access them later

    From what I know, Labview automatically deletes VI references when they go out of use. Is there a way for me to override this so that I can access a set of preloaded references in a separate VI? Essentially I would like to open the VI's dynamically into the memory, store the references in global variables and access them at a later time. The VI's I'm referencing won't be known until runtime. I know its not the safest way to do it, but it would be the most productive on my end.
    Thank you
    Clay Upton

    I'm not sure what you mean by "a later time", but a VI reference will remain valid as long as the VI is in memory. If you don't unload the VIs, the references will remain valid.
    If you do need to unload the VIs, for whatever reason, I would suggest the following:
    Create a functional global as your interface for obtaining the references.
    Feed the paths to the VIs into the VI when initializing it (since you don't know which VIs in advance).
    When calling the VI to obtain the references, have the VI check them first (using the Not a Number... primitive). If it sees that they're invalid, it can open a new reference and return that.
    You should note that when a VI is removed from memory, the data space is used is released, so if those VIs are expected to hold data (using shift registers, etc.) this will be a problem.
    The description I've given will only be usable in certain instances (and it has its intricacies), but you didn't really give any details about what you're actually trying to accomplish.
    Try to take over the world!

  • How can I access global variables in a loaded Applescript?

    How can I access global variables in a loaded script, in Xcode, ApplescriptObjC? Basically, I have a global variable defined in my parent script using "property", and I need to modify objects connected to those variables inside of a loaded script.
    Example:
    Parent script:
    script AppDelegate
    property myTextField : missing value
    //linked to a text field object
    tell myScript to myAwesomeHandler_()
    end script
    Loaded script:
    on myAwesomeHandler_()
    myTextField's setStringValue_("The new Xcode is so glitchy ugh")
    //changes value of linked text field of parent script
    end myAwesomeHandler_
    The problem is, the variable is undefined in the Loaded script, and I need it to have the same value as the parent script, and I don't want to pass the variable through the Handler. Any ideas?

    I think want you are looking to do will need to be done in two steps. Because myTextField needs to be a property for the ObjectiveC part of the code you cannot turn it into a global.
    However if you make a temporary variable global assign the string to it in the handler then set myTextField off of it.
    global myTextFieldGlobal
    script AppDelegate 
    property myTextField : missing value 
    //linked to a text field object 
    tell myScript to myAwesomeHandler_() 
    myTextField's setStringValue_(myTextFieldGlobal)
    end script 
    on myAwesomeHandler_() 
    set myTextFieldGlobal to "The new Xcode is so glitchy ugh"
    //changes value of linked text field of parent script 
    end myAwesomeHandler_ 
    I know you stated you did not want the handler to return a value but I have to ask why? Global's, imo, are not a good idea and really should be used as a last resort.
    One other possibility is to pass a reference to the property to the handler. Not sure if that works in AS of if that would satisfy our requirement of not passing the variable through the handler
    <edit>
    Another though have you tried to define the property outside the script?  That is
    property myTextField : missing value
    script AppDelegate
    Not sure if that will work.
    You might also want to have a look at Scope of Properties and Variables Declared in a Script Object

  • Can I Access the Value of a Global Variable in a Trigger

    I'm using a Global variable in a Package which i use in the BIU Trigger to populate a column. After assigning the value for that global variable, I run an INSERT in the same package. But I find only the default value of the Global variable populated in the column. Can I use a Global Variable in a Trigger? Is there any way to put in a common value across all the tables in an application for all DMLs of a particular session?

    Helios,
    I'm already having the same setup mentioned in the thread. And I'm doing exactly whats given there. But the issue seems to be something different. I'm assigning the value to the Global Variable in the Package through Apex. Here's the Package Code:
    CREATE OR REPLACE PACKAGE Schema1.SPMS_SECURITY_PKG
    AS
    X_app_user_id NUMBER DEFAULT -1;
    FUNCTION USER_ID RETURN NUMBER;
    END SPMS_SECURITY_PKG;
    CREATE OR REPLACE PACKAGE BODY Schema1.spms_security_pkg
    AS
    FUNCTION user_id
    RETURN NUMBER
    IS
    BEGIN
    -- RAISE_APPLICATION_ERROR(-20001,'USER ID'||'*'||X_app_user_id);
    RETURN NVL (x_app_user_id, -1);
    -- RETURN NVL (sys_context('USERENV', 'CURRENT_USER'), -1);
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN -1;
    END;
    And Here is the Trigger Code:
    CREATE OR REPLACE TRIGGER Schema1."USER_DETAILS_TRIGGER"
    BEFORE INSERT OR UPDATE
    ON PMS_SICAL.SPMS_USER_DETAILS REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    IF INSERTING
    THEN
    :NEW.created_by := spms_security_pkg.user_id;
    :NEW.created_date := SYSDATE;
    :NEW.START_DATE := SYSDATE;
    ELSIF UPDATING
    THEN
    :NEW.updated_by := SPMS_SECURITY_PKG.X_app_user_id;--spms_security_pkg.user_id;
    :NEW.updated_date := SYSDATE;
    END IF;
    END;
    But I always get -1 in the both in the table after the DMLs.

  • Call function in LabView from a DLL, then access global variable from DLL

    I have created a DLL in LabWindows with a function and a structure.  I want to call the function from within LabView and then access the global structure.  I am able to call the function from the DLL with a "Call Library Function Node" and can access the return value, but I cannot figure out how to access the global structure.  The structure is declared in the DLL header file with __declspec(dllimport) struct parameters.
    Is there any way of accessing this structure without using the Network Variable Library?
    Solved!
    Go to Solution.

    dblok wrote:
    When you say "access to" or "the address of" the global variable, do you mean to pass the variable as an argument to the function call in the DLL?  If so, then I was not really sure how to pass a cluster from LabView by using the "Call Library Function Node".
    Yes, that's exactly right.  I would include a pair of helper functions in the DLL to read and write the global variable.  Alternatively you might write separate helper functions for each field inside the global structure, depending on the number of fields and whether you want to do any validation on the values.
    You can pass a cluster by reference to a function that expects a struct by setting the parameter to Adapt to Type, so long as the cluster does not contain any variable-length elements (strings or arrays).  The cluster needs to match the struct exactly, and sometimes that involves adding extra padding bytes to make the alignment work.  Variable-length elements in LabVIEW need to be converted to clusters containing the same number of elements as the struct definition (for example, if your struct contains char name[12], you would create a cluster of 8 U8 values, and you could use String to Array of Bytes followed by Array to Cluster to convert a LabVIEW string into that format).  If the struct contains pointers it gets more complicated, and it may be easier to write functions in the DLL to access those specific elements individually.
    If you can't get this working or need help, post your code and an explanation of the error or problem you're seeing.
    EDIT: it is also possible to include a single function in the DLL that returns the address of the global variable, which LabVIEW can then use to access and modify the data, but that's more complicated and likely to lead to crashes if you don't get the memory addressing exactly right.

  • Access global variable in fpga from rt-target

    Hi All,
    I have a realtime PC with NI-FPGA 7852R.
    Generally I used programmatic front panel communication to access variables from FPGA to rt-system since I need the data for control and not for data logging.
    The thing is, I bumped into a tutorial and suggested me to use global variables to save resources of your FPGA. My question is, is it possible to access global variable that belongs to FPGA from rt-system? As far as I tried, this does not seem possible.
    Thanks,
    Auralius

    Could you point us towards this tutorial?
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • Accessing Var from main Nib/Class - [global variables]

    I'm sure this is a simple solution and the problem is I'm just not thinking right. I just started programming in Objective C but have come a long way in the past 2 weeks. Pretty extensive knowledge in C# and some java.
    Anyways, I've been creating an app and have streams working, CFNetwork working, network services discovery working and a tab bar with a custom View controller linking to one of the tab-bar buttons.
    So when you click on one of the tab bar items it opens a new nib file. That nib loads a table view. When nib loads it hits a method which starts looking for network services and updates the table when it finds some.
    Now the idea is is to have a selector on the cell and when you choose the service it adds same variable info, ip and port, back to a global variable which can be used through the entire app and all extra loaded nib files.
    Out of all this, I don't know how to access global variables....prob should be the simplest thing to do out of all I've done. I have ideas of how it should be done but don't know how to access it.
    Idea would be:
    MainWindowNib has NSString var that is public with a getter setter. But how can I access that MainWindowNib var from a SecondView.nib file/class. There a way to get the parent of the secondView.Nib? I have no clue.
    Any help would be great!
    Thanks!

    I'm still a bit confused how you access that method.
    Main.nib class : UIApplication
    NSString *port
    SetupView.nib : NSViewController
    view
    -TableView added to view
    -Seperate NSObject for TableViewDelegates
    -When item selcted, pass NSString to [main port]
    How do I get a pointer to port. I don't really understand how to do this with objective C.
    In C# I would be something like: [Not exact syntax but u get the idea]
    public Main : Form
    public string port{get;set;}
    Main()
    sView SeconddForm = new SecondForm(this);
    public SecondForm : Form
    SecondView(Main main)
    main.Port = "8080";
    Message was edited by: Clarke76
    Message was edited by: Clarke76

Maybe you are looking for

  • Subclassing nested (private ns) classes at runtime

    A question for the AVM2 engineers here. I am the author of asmock, a dynamic object mocking framework, and am looking at a few features to add before 1.0. One of the biggest features I'd like to support is the ability to mock a "nested" (private name

  • Problem with time stamp conversion

    Hi All, I am using the below code to convert timestamp to date and time  , its working fine when i print it with write statement  . But i want to convert and pass the time and date with format to excel sheet , but  its it taking again as string not i

  • Executable won't re-connect to shared variable engine when it breifly goes offline

    Hi, I have shared variables that are hosted on a field-point controller. I read these variables from executables that run on a PC. When the shared variable engine on the field point controller goes offline and then comes back online (for instance, if

  • Rman backup in oracle 10.2.3

    Dear friends, I'm trying to take a full online database backup using rman. I used the below script. run { configure snapshot controlfile name to 'C:\RMAN_BACKUP\EBMS\FULL\c-%d_%t_%s_%p.ora'; allocate channel c1 type disk; BACKUP DATABASE PLUS ARCHIVE

  • Editing EP 6.0 Logon Page

    Iam trying to Modify the EP 6.0 Logon page.. I read forums tips to do that but endup creating an error page. Actual par file: com.sap.portal.runtime.logon.par I juss tried 2 replace sapLogo.gif with my company logo..then placed the par file back in t