Use of variable in a package execution

Hi all,
I've a procedure to call in this way
exec schema.procedure('VAR').
There's a really simple sql that asks the user to input the value and have to convert is using UPPER and pass to procedure.
I've done as:
exec :myvar := upper(&INPUT)
exec schema.procedure(:myvar) ;
I get the error that bind variable is not declared and my not sure that package is executed correcly...
I've also tried to
declare
myvar varchar2(255) := upper(&INPUT)
begin
schema.procedure(:myvar) ;
end;
But is not working, I get PLS-00201 and PLS-00320 ...
Any hint?
Thanks
Ste

I've done as:
exec :myvar := upper(&INPUT)
exec schema.procedure(:myvar) ;If you take this approach then you must declare myvar. You can do it like this
VAR myvar VARCHAR2(255)
exec :myvar := upper(&INPUT)
exec schema.procedure(:myvar)
I've also tried to
declare
myvar varchar2(255) := upper(&INPUT)
begin
schema.procedure(:myvar) ;
end;
/If you want this then you need to pass the variable without the : symbol. In PL/SQL are variable are bind variable by itself. So you dont have to specify the :symbol.
declare
myvar varchar2(255) := upper(&INPUT)
begin
schema.procedure(myvar) ;
end;
/

Similar Messages

  • Setting/using a variable in a package in SQL Developer

    The 10g db I'm working with has a package that contains a variable and routines to set and get the value of the variable. The variable is used in a number of views to tailor data displayed according to the variable value. This all works well in applications, which set the variable after a connection is opened and then issue queries against the views, and then close the connection.
    This also works well in Toad - I can open Toad, run a package routine to set the value and then open views (or run queries against views) in Toad to see how different variable values effect the data displayed. The package variable maintains its value so long as Toad is open, which seems to imply that Toad keeps a connection open.
    But I can't use SQL Developer in the same way. I can run the SET routine, but it has no effect in on views subsequently run. When running the SET routine, setting the value to 1, the output is:
    Connecting to the database HERC DB.
    Process exited.
    Disconnecting from the database HERC DB.
    I can then run the GET routine, but the value of the variable is always zero:
    Connecting to the database HERC DB.
    v_Return = 0
    Process exited.
    Disconnecting from the database HERC DB.
    The implication seems to be that a connection is made, the routine is run and then the connection is closed. The closing of the connection resets the variable. Is there some way I can have SQL Developer behave like Toad, such that the package variable value is maintained for my SQL Developer session? I've looked at connection roperties and application preferences, but I've not seen anything that seems to be related keeping a connection open.
    BTW, I have tried the "connection startup script", but to no avail. Perhaps I've doen this improperly; the script simply attempts to invoke the package set routine, like so: myPkg.set_identity(1)
    Thanks.
    Edited by: user483973 on Oct 20, 2009 9:20 AM

    When running stored PL/SQL through the IDE context node or editor, indeed a new session is opened and consequently closed on completion after committing. Although great for having the IDE free to continue working, it does have its drawbacks when you want variables to persist and changes to be visible in the IDE before committing.
    To prevent the new session and the commit, just call the PL/SQL from a worksheet (in a call, query or anonymous block).
    The startup script should work in that respect, but make sure to wrap your call in an anonymous block, else you'll get a syntax error.
    Hope that helps,
    K.

  • How do I use bin variable in package without asking a user?

    hi,
    I would like to write an SQL but I want to use bind variable in package as a static without asking user? Like below?
    I would like to ask you, below there is a emp_id variable? Is this BIND variable?
    DECLARE
    bonus NUMBER(8,2);
    emp_id NUMBER(6) := 100;
    BEGIN
    SELECT salary * 0.10 INTO bonus FROM employees
    WHERE employee_id = emp_id;
    END;
    If not, like this SQL how can define a BIND variable as static inside a code? not asking a user?
    db version. 9.2.0.8
    regards and thanks

    OracleADay wrote:
    I would like to ask you, below there is a emp_id variable? Is this BIND variable?
    DECLARE
    bonus NUMBER(8,2);
    emp_id NUMBER(6) := 100;
    BEGIN
    SELECT salary * 0.10 INTO bonus FROM employees
    WHERE employee_id = emp_id;
    END;
    /In the query "SELECT salary * 0.10 INTO bonus FROM employees WHERE employee_id = emp_id" emp_id is turned into a bind variable because
    if you are coding static SQL in PL/SQL then PL/SQL wil automatically use bind variables: please read http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/overview.htm#sthref145.
    This can also be proved with SQL trace. The following code:
    alter session set sql_trace=true;
    declare
    v number;
    c number;
    begin
    select count(*) into c
    from t
    where x=v;
    end;
    show errors
    alter session set sql_trace=false;generates following raw trace file section with 10G XE:
    =====================
    PARSING IN CURSOR #2 len=79 dep=0 uid=69 oct=47 lid=69 tim=33338762257 hv=2860574766 ad='3c10120c'
    declare
    v number;
    c number;
    begin
    select count(*) into c
    from t
    where x=v;
    end;
    END OF STMT
    PARSE #2:c=46800,e=329811,p=0,cr=9,cu=0,mis=1,r=0,dep=0,og=1,tim=33338762253
    =====================
    PARSING IN CURSOR #1 len=35 dep=1 uid=69 oct=3 lid=69 tim=33338788761 hv=3539261652 ad='3c10053c'
    SELECT COUNT(*) FROM T WHERE X=:B1
    END OF STMT
    PARSE #1:c=0,e=216,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=1,tim=33338788755
    =====================Edited by: P. Forstmann on 17 mai 2011 17:47
    Edited by: P. Forstmann on 17 mai 2011 17:55

  • How can I use variable for a package filename and target file inODIFileMove

    I want to use a variable for paths so that when I migrate from Dev to QA to Prod I don't have to do a lot of editing.
    Specifically, I want a variable to be the first part of the path for the filename (\\sundev1\fnd1-hypd1) and join this with the rest (\update\log\*.log or specific filename) using several different objects like the ODIFileMove, ODI OS Command, OS Command, etc.
    Thank you!

    Hi,
    you could set up a database table holding processing parameters (i.e. Column1 - ParamName, Column2 - ParamValue).
    One row could then be ParamName = FilePath, ParamValue = \\<server>\folder\
    So, the refreshing query (attached to a logical schema) would be something like SELECT ParamValue FROM <your table> WHERE ParamName ='FilePath'
    Then, create a variable which can refresh from the database and in the package, drop the variable onto the flow and set it's type to 'Refresh Variable' in the properties.
    Hope this helps.
    geeo

  • Using global variable in package

    Hi. I have created a function (Retrieve_SerialNo) which returns a variable, which I use throughout my package. I would like to assign this variable as a global variable to be used by all functions and procedures in the package. Can someone help me in the declaration of this variable as a global variable? Also, is it necessary for me to initialize this variable whenever the package executes. If yes, how would I do this?
    CREATE OR REPLACE PACKAGE BODY Supply_Item_Interface AS
    FUNCTION Retrieve_SerialNo RETURN VARCHAR2 IS
        v_serial_no VARCHAR2(20);
        CURSOR Serial_Code IS
          SELECT S.Serial_Code
            FROM Spare_Parts s, Orders r
           WHERE s.serial_code = r.serial_code;
      BEGIN
        OPEN Serial_Code;
        LOOP
          FETCH Serial_Code
            INTO v_serial_no;
          EXIT WHEN Serial_Code%NOTFOUND;
          v_serial_no := v_serial_no;
        END LOOP;
        CLOSE Serial_Code;
        RETURN v_serial_no;
      EXCEPTION
        WHEN OTHERS THEN
          RETURN NULL;
      END;

    user13415143 wrote:
    Hi. I have created a function (Retrieve_SerialNo) which returns a variable, which I use throughout my package. I would like to assign this variable as a global variable to be used by all functions and procedures in the package.All variables have scope or "visibility". A variable defined in a procedure is only visible within that procedure.
    A variable defines in a package body. is visible within that package body (i.e. procedures and functions in that package body can "see" that variable.
    A variable defined in the package definition? Well, who can see the definitions of procedures and function in a a package header/definition? Everyone else basically (other PL/SQL packages and procedures and functions). So this is also true for variables defined in the package interface. These are global variables that not only can be used by the code in that package's body, but also can be used by other packages and PL/SQL code.
    So when you create a global variable you need to decide on its scope:
    - define it in package header for global usage in all PL/SQL code
    - define it in package body for global usage within that package only
    CREATE OR REPLACE PACKAGE BODY Supply_Item_Interface AS
    ..snipped..Ugly code as there is no need to use an explicit cursor if returning a value from a single row. Also buggy code. If there are multiple rows returned by the cursor, the function returns the serial of the last random row. How does this make sense?
    This is what I would expect to see from a function like this. You pass it a unique identifier and it returns the applicable attribute (column) value for it.
    E.g.
    create or replace function GetSerialNo( orderNo number ) return number is
      serialNo number;
    begin
      select
        s.serial_code into serialNo
      from spare_parts s,
           orders o  
      where s.serial_code = o.serial_code
      and o.order_no = orderNo;
      return( serialNo );
    exception when NO_DATA_FOUND then
      return( null )
    end;Also note that there is no need to write ugly uppercase code. This is not a proper coding standard. Programming standards for all languages (ranging from C# to Java to Delphi to Visual Basic to C/C++) specify that camelcase should be used for variables and pascalcase for procedures/functions/methods. Uppercase is very seldom used and then only for constant names and compiler options/flags for example.
    Coding reserved words in uppercase? That is just plain silly - and not found in today's programming languages. Do yourself a favour and forget the idiotic standards used by some for PL/SQL and look at the standards for Java and .Net/C# - as the latter are the de facto standards for programming (and have been for the last 2 decades and more).

  • Query don't use the right index when using bind variables

    Hi people !
    I need some help because I have an issue with a query that don t use the right Indexes as it should
    First of all, I have mainly three tables :
    ORDER : Table that contains description for each Order (approximately 1 000 000 Records)
    ORDER_MVTS : Table that contains the tasks made (called movements) to set up each Orders
    with quantity of packages prepared for each product (approximately 10 000 000 Records)
    PRODUCT : Tables that contains the products (approximately 50 000 Records)
    When I launch the query with hard coded values, it brings back response very fast
    because it uses the right index (ORDER_DHR_VALID) which represent the date and hour of the order
    (with format 'DD/MM/YYYY HH24:MI:SS'). The selectivity for this index is good.
    NB 1: I have to use the trick " >= Trunc(date) and < trunc(date) +1 " to filter on a simple date because
    the index contains hour and minutes (I know it wasn't probably a bright idea at conception time).
    NB 2: The index on ORDER_MVTS.PRODUCT_CODE is'nt discriminating enough because there is'nt enough different products.
    It's the same for index on CUSTOMER_CODE and on MVT_TYPE so only the index on ORDER.DHR_VALID is good.
    Here is the correct explain plan when I execute the query with hard coded values :
    SELECT SUM(ORDER_MVTS.NB_PACKAGE)
    FROM ORDER_MVTS, PRODUCT, ORDER
    WHERE ORDER.DHR_VALID >= TRUNC(to_date('14/11/2008 10:04:56','DD/MM/YYYY HH24:MI:SS'))
    AND ORDER.DHR_VALID < TRUNC(to_date('14/11/2008 10:04:56','DD/MM/YYYY HH24:MI:SS')) + 1
    AND ORDER_MVTS.MVT_TYPE = 'DELIVERY'
    AND PRODUCT.CODE = ORDER_MVTS.PRODUCT_CODE
    AND ORDER_MVTS.ORDER_CODE = ORDER.CODE
    AND ORDER.CUSTOMER_CODE = 'ADIDAS'
    AND PRODUCT.CODE = 1234
    Rows Row Source Operation
    1 SORT AGGREGATE
    2 NESTED LOOPS
    4 NESTED LOOPS
    2 INDEX UNIQUE SCAN (object id 378548) --> PRODUCT_PK
    4 TABLE ACCESS BY INDEX ROWID ORDER
    777 INDEX RANGE SCAN (object id 378119) --> ORDER_DHR_VALID
    2 TABLE ACCESS BY INDEX ROWID ORDER_MVTS
    30 INDEX RANGE SCAN (object id 377784) --> ORDER_MVTS_ORDER_FK
    Now the problem is when the query is used in a Cursor with bind variables.
    It seems like Oracle don't use index on ORDER.DHR_VALID because he can't figure out that he have
    to actually filter on a short period of time (only one day).
    So Oracle uses the index on ORDER_MVTS.PRODUCT_CODE which is'nt a bright idea (it takes 10 secondes instead of just one)
    Here is the bad explain plan :
    Rows Row Source Operation
    1 SORT AGGREGATE
    2 NESTED LOOPS
    722 NESTED LOOPS
    2 INDEX UNIQUE SCAN (object id 378548) --> PRODUCT_PK
    722 TABLE ACCESS BY INDEX ROWID ORDER_MVTS
    1790 INDEX RANGE SCAN (object id 377777) --> ORDER_MVTS_PRODUCT_FK
    2 TABLE ACCESS BY INDEX ROWID ORDER
    1442 INDEX UNIQUE SCAN (object id 378439) --> ORDER_PK
    Now I have found two solutions to this problem :
    1) using a Hint to force the use of index on ORDER.DHR_VALID (with /*+ INDEX(ORDER ORDER_DHR_VALID) */ )
    2) Using Dynamic SQL and keeping the date hard coded (but not the other values except mvt_type)
    For example :
    QUERY :=
    'SELECT SUM(ORDER_MVTS.NB_PACKAGE)
    FROM ORDER_MVTS, PRODUCT, ORDER
    WHERE ORDER.DHR_VALID >= TRUNC(TO_DATE('''||To_char(P_DTE_VAL,'DD/MM/YYYY')||''',''DD/MM/YYYY'')) '||
    AND ORDER.DHR_VALID < TRUNC(TO_DATE('''||To_char(P_DTE_VAL,'DD/MM/YYYY')||''',''DD/MM/YYYY'')) + 1 '||
    AND ORDER_MVTS.MVT_TYPE = 'DELIVERY'
    AND PRODUCT.CODE = ORDER_MVTS.PRODUCT_CODE
    AND ORDER_MVTS.ORDER_CODE = ORDER.CODE
    AND ORDER.CUSTOMER_CODE = :CUSTOMER
    AND PRODUCT.CODE = :CODE ';
    These two solutions work but Number 1 is bad in theory because it uses a Hint
    and Number 2 may be difficult to code.
    So my question is : Does someone knows another solution to force the use of index ORDER_DHR_VALID that can be simple and reliable.
    Thank you very much for support
    Edited by: remaï on Apr 1, 2009 4:08 PM

    What version of oracle you have? CBO work is different in 9i and 10g.
    Usually cost based optimizer do not want to use index for >< condition with binding variables because optimizer can not use statistic to determine selectivity, and by default selectivity of <> operators is low.
    (As I remember '>' selectivity by default is 5%, you have two conditions > and <, therefore resulting selectivity will be 0.05*0.05=0.0025 as two independent events, but selectivity of other conditions
    ORDER_MVTS.MVT_TYPE = 'DELIVERY' or ORDER.CUSTOMER_CODE = 'ADIDAS' looks much better for CBO)
    The best solution I see is do not use binding variables. Actually your query looks as searching query, which executes not so often, therefore you will not have perfomance win along of skipping execution plan creation.
    Edited by: JustasVred on Apr 1, 2009 10:10 AM

  • Error when using the variable System::ErrorDescription

    HI All,
    When I try to use the variable System::ErrorDescription I get the following error:
    The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there.
    Do I need to declare it or it's a variable that always is available to get exceptions from the execution states?

    if this is in a Script Task then:
    - add the variable in the Script task property ReadOnlyVariables list
    - in the Script Code refer to it as
    string ErrorDesc = (string) Dts.Variables["System::ErrorDescription"].Value;
    Jan D'Hondt - SQL server BI development

  • Variable Scope at package or interface level

    Hi,
    Can we set the ODI Project variable scope to package or interface level
    because in my project im using a last rundate refresh variable this variable value will be changed at the time of execution of each package.
    Thanxs
    Madhavi

    you can create it as "Not Persistent" and then its value exist per ODI session.
    In this way, several sessions can keep independent value to the same variable.

  • Regarding usage of constants while using bind variables

    Hi All,
    Can some one please help me out of this situation?
    I wrote a query in a package in which i am using bind variables for faster execution of the query in loops.
    In the above said scenario i am trying to insert a set of data into a table say 'A' by selecting from some other table say 'B'. But i also need to insert some data which is constant.
    Something like this:
    constant_val varchar2(1):='N';
    for i in 1 .. tab.count
    loop
    insert into A(Col1, Col2) values (select constant_val, B.value from B where B.value = tab(i));
    end loop;
    I wrote the query using bind variables in the manner:
    for i in 1 .. tab.count
    loop
    execute immediate 'insert into A(Col1, Col2) values (select constant_val, B.value from B where B.value = :1)' using tab(i);
    end loop;
    This compiles, but does not run ... error said is PLSQL statement not properly ended.
    I also tried the option of giving constant_value in the using clause and replacing the same in query using a bind variable. It still doesnt work.
    Is there someway by which i can squeeze in the constant value also. Can someone please advise me on this?
    Thanks in advance,
    Praveen G S

    but i was told that if i succeed
    in reducing the hard parsing of queries .. i will get
    better performance results .. Would i say too, at least for OLTP like systems
    but if i cant or rather dont have to use it while
    looping PLSQL tables and accessing data from other
    tables using this data ... then what do we use it
    for?? PL SQL is capable of bulk operations, so loop is less performant method to process data, however, if you can't do it bulk - for whatever reasons - do it in loop.
    My remark was related mostly to dynamic sql, as shoblock already said, it seems to be no reason in your code to use dynamic sql, if you can use static...
    What i not understand as well, why do you select a value from the table, if this value is already in your collection?
    values (select constant_val, B.value from B where B.value = :1)' using tab(i);Best regards
    Maxim

  • Error in using a variable

    Hi All,
    I have got 2 packages, A & B. Package A includes package B and some variables.
    My question out here is that i am using assigning some values to variables in the package B, i want those values to be reflected and be usable in the package A.
    Can you please help.
    Thanks,
    Nithesh B

    Hi Nitesh,
    Please try the below steps and let me know still you face issue on this :-)
    You can ping me on [email protected]
    Steps :-
    Ist create a Gobal variable say GLOBTest (historise , to veiw the result)
    create a local variable say LocTest (historise , to veiw the result)
    Now in first pcakage say PKG1
    step 1 : drag and drop the GLOBTest Variable and select the mode as declare variable
    step 2: call the second package scenario (say PKG2)
    step 3: drag and drop the variable LocTest as assign variable :- and in assign tab put #Global.GLOBTest
    Now in pcakge 2 (PKG2)
    Drag and drop the global variable GLOBTest as assign mode and put the value as "This is a test case"
    generate the scenarios and start the package 1 (PKG1)
    once its executed without error , open the LocTest and check the historise tab , you can see the value of the global variable whcich you assigned from the child package.
    Regards,
    Rathish A M

  • Error in using a variable in filter condition in an Interface

    Hi All,
    I am using a variable in my interface in a filter condition. I have an EMP table of scott schema and want to pull all the records wiht hiredate date lying between 2 dates, incremental pull.For this I have created 2 variables and using them in the filter condition. I am getting an error inthe interface when I run in a package after declaring and refresing the variables.
    com.sunopsis.sql.SnpsMissingParametersException: Missing parameter
         at com.sunopsis.sql.SnpsQuery.completeHostVariable(SnpsQuery.java)
         at com.sunopsis.sql.SnpsQuery.updateExecStatement(SnpsQuery.java)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Regards,
    Krishna

    Hi Krishna,
    What is the datatype of the Variable lastupdate ?
    In my case
    Variable
    Name : LastUpdateDate
    Datatype : Alphanumeric
    Action : Historize
    Query : select to_char(to_date(sysdate,'DD-MON-YY'),'DD-MON-YY') from sys.dual
    Then in filter I used
    EMP.HIREDATE>to_date('#LastUpdateDate','DD-MON-YY')
    Thanks
    Sutirtha

  • Report Using Bind Variables

    Hey Everyone,
    I'm having a bit of trouble creating a report. I need the FROM part of the code to use bind variables. I have come up with this peice of code below but im getting the following error:
    failed to parse SQL query:
    ORA-06550: line 1, column 8:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin function package pragma procedure subtype type use
    form
    current cursor
    The symbol "" was ignored.
    ORA-06550: line 2, column 24:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin function package pragma procedure subtype type use
    form
    current
    Can anyone see where im going wrong?
    Thanks in advance,
    -N.S.N.O.
    Code*
    DECLARE
    x VARCHAR2 (4000);
    BEGIN
    x := x || 'select *';
    x := x || 'from ';
    x := x || :p13_schema;
    x := x || '.ddl_log@';
    x := x || :p13_db_name;
    x := x || '_DBAAPEX.TNTEWW.COM';
    RETURN (x);
    END;

    Hey Roel and Daylocks,
    After getting frustrated for a while i deleted the page and started again. I put in the exact same code and it worked just how i wanted in the first place :S
    The only thing i did different is when i was creating the report region the first time around i used a normal SQL query, For Example:
    select sysdate from dual;
    Then i modified it to
    DECLARE
    x VARCHAR2 (4000);
    BEGIN
    x := x || 'select ';*
    x := x || 'from ';
    x := x || :p14_schema;
    x := x || '.ddl_log@';
    x := x || :p14_db_name;
    x := x || '_DBAAPEX.TNTEWW.COM';
    RETURN (x);
    END;
    Whereas on the second attempt i used the peice of code in question straight away. Its been a bit of a frustrating morning because i used a similar peice of code for a different application, nevermind tho :)
    Thanks for your replys, much appreciated.
    -N.S.N.O.

  • Using a variable from one class to another

    Hi !
    I've a class called ModFam (file ModFam.java) where I define a variable as
    protected Connection dbconn;
    Inside ModFam constructor I said:
    try
    String url = "jdbc:odbc:baselocal";
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    dbconn = DriverManager.getConnection(url);
    System.err.println("Connection successful");
    } ..... rest of code
    This class define a TabbedPane as follows:
    tabbedPane.addTab("Welcome",null,new Familias(),"Familias");
    As you can see it call a new instance of the Familias class (file Familias.java).
    This constructor will try to connect with the DB to populate a combo box with some data retireved from the DB.
    If I do
    Statement stmt;
    stmt = dbconn.createStatement();
    inside Familias constructor I receive the message
    Familias.java:50: cannot resolve symbol
    symbol : variable dbconn
    location: class fam.Familias
    stmt = dbconn.createStatement();
    at compile time.
    While I can�t use a variable defined as "protected" in one class of my package on another class of the same package ?
    How could I do ?
    Thanks in advance
    <jl>

    Familias doesn't have a reference to ModFam or the Connection.
    So change the constructor in Familias to be
    public class Familias {
      private ModFam modFam;
      public Familias(ModFam m) {
        modFam = m;
    // ... somewhere else in the code
    Statement stmt = modFam.dbconn.createStatement();
    }or
    public class Familias {
      private Connection dbconn;
      public Familias(Connection c) {
        dbconn = c;
    // ... somewhere else in the code
    Statement stmt = dbconn.createStatement();
    }And when you instantiate Familias it should then be
    new Familias(this) // ModFam reference
    or
    new Familias(dbconn)

  • Using a variable inside another variable

    I'm trying to use one two variable in a package with one variable feeding its value to another variable as follows:
    Variable 1 = Count
    Variable 2 = File_Name
    Variable 1 counts up from 1;I would like to use this value as an input to Variable 2 as follows:
    SELECT LOAD_FILENAME FROM DIMSTATS_FILENAME WHERE (SELECT ROW_NUMBER() OVER (Order by FILE_ID) AS RN FROM DIMSTATS_FILENAME) = #DIMSTATS_TEST.count.
    How ever I am getting the following Error :
    +ODI-1228: Task File_Name (Variable) fails on the target  connection DDBSTAGE.
    Caused By: java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver][SQLServer]The multi-part identifier "#DIMSTATS_TEST.count" could not be bound.+
    I have also noticed that the value of Variable 1 is not being passed to the Select statement above through SQLServer Profiler. If I hard-code the value of #DIMSTATS_TEST.count (Variable1) the query is successful.
    How can I get the value of Variable 1 to be passed to Variable 2?
    Could someone please help
    Thanks

    You did not mentioned how you are using those variable .
    You need to have these variable inside a package .
    It will be like
    Variable 1 (Refresh) -------OK-------->Variable 2(Refresh) ------------OK-----> Some other operation .
    Thanks,
    Sutirtha

  • Variable refreshing in package header

    Hello Experts,
    Through a function in my package header I fill up a global variable. The function gets the value out of a table in my database:
    PV_FILENAME PARAMETERS.VALUE%TYPE DL$PARAMETERS.VALUE_BY_NAME('FILE_NAME'); This works fine, however when I change the value in the table and commit the changes the problem begins.
    When I execute the following statement to check if the value changed:
    select DL$PARAMETERS.VALUE_BY_NAME('FILE_NAME') from dual;It shows me the new value...
    But the variable in the package still contains the old value. When I restart sql developer the variable adjusts.
    Does anyone know what I can do? It seems like the package is caching the value or something. Or is it obligatory to put global variables in the body?
    greets
    Edited by: iadgroe on May 21, 2012 6:37 AM

    Hello Arun,
    I can check this because the return value I use in the function is the name of an xml file (e.g. 'xmlfile_1.xml'):
    SELECT .....
    FROM XMLTABLE('/employees/employee' PASSING XMLTYPE(BFILENAME(PV_DIRECTORY, -->PV_FILENAME<--), NLS_CHARSET_ID('AL32UTF16'))
    COLUMNS USERNAME VARCHAR2(20) PATH './name/userName' , TIMEREG XMLTYPE PATH './timeRegistration/days' ) H,
        XMLTABLE('days/day' PASSING H.TIMEREG COLUMNS TIMESHEET_DATUM In the above code I use the name to retrieve the xml file. I insert the data in the xml file into one of my own tables.
    When I change the value of the xml-name(e.g. 'xmlfile_2.xml') in my table that the function returns, the variable should reference another xml-file. However when I execute the procedure in my package it still insert data from the previous xml(xmlfile_1.xml) file into my table.
    I this clear enough? :-)
    Thanks a lot!

Maybe you are looking for

  • Iphone shuts down when trying to sort email into folder.

    When I click on a specific email and try to sort it into one of my folders on my phone, the email program shuts down and goes back to the home screen. I did a hard reset and checked for updates for the iphone.  It was working yesterday and now it's n

  • Manually how to make payment to vendor who is also my customer.

    Hi Friends, I wanted to know how I will do manual posting for vendor who is also my customer as well. I mean if my customer needs to pay me 100 rs and vendor is going to get 150 from company, then how by doing manual posting I can give only 50 to my

  • Kernel security level changes on its OWN?

    Hi... using OS 10.3.9 on a G4 dual 533mhz with a gig of ram. It is wired into an Airport Extreme that firewalls for a wireless laptop as well, yes it is set encrypted and unauthorized NIC card addresses are excluded in the Airport Administration soft

  • MuseJSAssert: Error calling selector...

    I have developed a site that has "MuseJSAssert: Error calling selector function: TypeError: undefined is not an object (evaluating 'jQuery.browser.msie" I know that it is because i have inserted an Edge animate menu onto the page in Html and i am abl

  • FileChooser is not invoking the file Please Help

    Hi, I have created a menuItem when user selects from the menuItem the file chooser come's up after that when he select any file from the JFile chooser dilalog box the r not invoked.Here is the code, please tell me where am i wrong. Please Help me out