Variables in Oracle Datastore

Hi, i've different mirroring table, for example LMA_CU_001, LMA_CU_ABC etc . So i'm working to create a unique package able to switch between my mirrors (001 & ABC)
I've created a project variable ACTUAL_MIRROR in the project PR01;
i'm using the "SQL FILE TO SQL CONTROL APPEND" because i don't need any control in this step. At the step "insert new row" i obtain this execution plan
insert into     USRDWH."LMA_CU_#PR01".ACTUAL_MIRROR
     C1,
     C2
) select     
     C1_CULECD,
     C2_CUCUCD
from     USRDWH.C$_0LMA_CU_GENERIC
where     
(1=1)
so i need to remove the quotes (" ") from the 'insert into' command, because oracle translates the name wrongly. Any suggestion? i'm not able to find out the position of the mask.
Regards
Edited by: DecaXD on 24-apr-2009 7.10

Ikm sql control append. i0ve modified step "load data"

Similar Messages

  • Global Variable in Oracle Forms 6i

    Hi,
    How & where to define global variable in Oracle form 6i and also let me know how to access it.
    Thanks in advance
    Regards,
    Sanket

    hi
    Global variable are forms specifice variable.
    it can store character value upto 255 for all usages.
    We can initialize it when we declare otherwise give error if we did not assign it any value.
    Oracle 10g it can take upto 4000 bytes
    GLOBAL.ur_globalvar := TO_CHAR(15);
    or
    :GLOBAL.ur_globalvar:= '15';
    or
    Remmber numeric values are implicitly converted by oracle 2 character
    :GLOBAL.ur_globalvar:= 15;
    -- which can then subsequently be accessed using...
    :GLOBAL.ur_globalvar;
    -- To destroy a global variable and release its memory, use the ERASE built-in procedure:
    Erase('GLOBAL.my_var'); Regards,
    Abdetu...

  • Vertical variable in oracle developer report 6i

    Hi
    I want to define a vertical variable in oracle report 6i but this ''Only text and boilerplate can be rotated''
    what can I do that?

    Hello,
    Only Text Boilerplate can be rotated but you can reference a variable in a Boilerplate using a "lexical reference" :
    ex:
    if your SQL query is :
    select ename from emp
    Set the boilerpate text to :
    &ename
    to display the value of ename.
    Of course, the boilerplate must be in the repeating frame having the SQL query group as source.
    Regards

  • How to pass bind variable into oracle reports 6i - Parameter form

    Hello All,
    I want to pass bind variable into Oracle Reports 6I - Parameters.
    I have tried out that but got the below error :-
    rep-0781 : Bind variables are not allowed in the select statement
    Kindly help me is there any option which allow me to pass bind variables into Oracle reports 6I.
    Thanks
    HARSH SHAH

    Hi,
    may be its not possible to use :P_PARAM1 in user parameter of oracle 6i reports
    but u can full fill user requirement using oracle forms
    create a form as like as report parameter window
    then create parameter list and run report
    PROCEDURE Run_Emp_Report IS
      pl_id ParamList;
    BEGIN
      pl_id := Get_Parameter_List('tmpdata');
      IF NOT Id_Null(pl_id) THEN
        Destroy_Parameter_List( pl_id );
      END IF;
      pl_id := Create_Parameter_List('tmpdata');
      Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
      Run_Product(REPORTS, 'empreport', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
    END;
    thanks
    mostafiz mitul
    Dhaka Bangladesh

  • How to access environment variables from Oracle Forms

    Hi,
    Any idea how to use the Environment variables from Oracle Forms.
    My basic problem is that from Oracle form I am calling Batch file which calls excel file with a macro.
    So i want to check whether the macro was successful or not.
    So in my batch file i will set %errorlevel% which I should be able to read from Oracle Forms.
    I am able to read the registry from oracle forms, so is there anyway to read environment variable as well?
    Thanks!
    Avinash.

    Hello,
    Use the TOOL_ENV.Getvar() built-in
    Francois

  • Where can found lists all system variables of oracle?

    Hi all,
    Where can be found all systems variables of oracle (all version include)
    Thanks in advance
    g.

    http://tahiti.oracle.com for the docs.
    Demos showing how to use them in Morgan's Library at www.psoug.org

  • Query on using Variables in Oracle Query

    Hi
    i am new to Oracle, i have tried extracting data from the Oracle Database using the following Query which includes 1 variable SYSDATE_UTS, however when i try to execute the Query i get an error. Please let me know what am i doing wrong and how can i correct it.
    Error Message
    ORA-06550: line 4, column 1:
    PLS-00428: an INTO clause is expected in this SELECT statement
    Oracle Query
    DECLARE SYSDATE_UTS NUMBER := (sysdate-to_date('19700101','yyyymmdd'))*86400;
    BEGIN
    SELECT
    INCIDENT_NUMBER,
    to_date(to_char((1/86400*REPORTED_DATE)+to_date('19700101','yyyymmdd'),'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as REPORTED_DATE_TIME,
    ,GROUP_TRANSFERS
    ,LAST_MODIFIED_BY
    ,to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * LAST_MODIFIED_DATE,'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as LAST_MODIFIED_DATE
    ,(to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) as AGE
    ,CASE
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 0 AND 1 THEN '0-1 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS, 'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 2 AND 4 THEN '2-4 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 5 AND 9 THEN '5-9 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 10 AND 19 THEN '10-19 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) >20 THEN '20+ Days'
    ELSE 'UNKNOWN'
    END AS AGE_GROUP
    FROM IncidentDataBase
    and STATUS not in (4,5,6)
    and rownum <10;
    END;

    Hi Frank
    i am using the following Oracle Version
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE     10.2.0.5.0     Production
    TNS for Linux: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    and Quest Toad for Oracle to write and execute the queries:
    Toad for Oracle Xpert
    Version 10.1.1.8
    The code i am using is:
    variable SYSDATE_UTS NUMBER;
    exec SYSDATE_UTS := (sysdate-to_date('19700101','yyyymmdd'))*86400;
    SELECT
    INCIDENT_NUMBER,
    to_date(to_char((1/86400*REPORTED_DATE)+to_date('19700101','yyyymmdd'),'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as REPORTED_DATE_TIME
    ,GROUP_TRANSFERS
    ,LAST_MODIFIED_BY
    ,to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * LAST_MODIFIED_DATE,'mm/dd/yyyy hh24:mi:ss'),'mm/dd/yyyy hh24:mi:ss') as LAST_MODIFIED_DATE
    ,(to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) as AGE
    ,CASE
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 0 AND 1 THEN '0-1 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS, 'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 2 AND 4 THEN '2-4 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 5 AND 9 THEN '5-9 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) BETWEEN 10 AND 19 THEN '10-19 Days'
    WHEN (to_date(to_char(to_date('01011970','ddmmyyyy')+1/24/60/60 * :SYSDATE_UTS,'mm/dd/yyyy'),'mm/dd/yyyy')) - (to_date(to_char(+to_date('19700101','yyyymmdd')+1/86400*REPORTED_DATE,'mm/dd/yyyy'),'mm/dd/yyyy')) >20 THEN '20+ Days'
    ELSE 'UNKNOWN'
    END AS AGE_GROUP
    FROM IncidentDataBase
    WHERE STATUS not in (4,5,6)
    and rownum <10;
    Notes:
    1. When i put the cursor before "variable" (starting of the query) and execute the script i get an Error: ORA-00900: invalid SQL statement.
    2. When i put the cursor just before "SELECT" i get a pop up.
    a. it is a Toad window which displays the available variables (in this case :SYSDATE_UTS).
    b. gives me a dropdown option to select the type (by default VARCHAR2 is selected).
    c. there is a value field where i need to enter the value for the Variable.
    d. the SQL statement shown in this dilog box does not include the 1st 2 lines
    variable SYSDATE_UTS NUMBER;
    exec SYSDATE_UTS := (sysdate-to_date('19700101','yyyymmdd'))*86400;
    Q: is there something wrong in the syntax i am using?
    Sven W. - I have been using your method all these days, which works just fine. i wanted to know how i could use a variable instead.
    Business Requirement - My whole intent is to calculate the Age of an incident (Difference between "Reported Date" and current date) and to assign Age Groups (0-1 Days, 2-4 Days,....,20+ Days).
    Edited by: 921713 on Mar 19, 2012 12:23 PM

  • What are the systems variables in oracle

    Hai All
    In oracle what is called system variable and types of system variables
    Good answer hepls me
    Thanks & Regards
    Srikkanth.M

    SET System Variable Summary
    Source:http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm
    Oracle environment variables
    The following environment variables are valid for Oracle::
    ORACLE_HOME
    ORACLE_BASE (optional)
    ORA_NLS (optional)
    NLS_LANG (optional)
    TNS_ADMIN (optional)
    Source:http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.websphere.ii.foundation.conn.fw.orc.doc/configuring/iiylsorcenvvars.html
    ORACLE_SID is the name of the database instance that you are using.
    T2KDEV is set to the type of terminal you are using; sun if you are using openwindows; xsun if you are using X windows.
    TERM is set to the type of terminal you are using. Note: If you are using openwindows, you may have to redefine the variable TERM to sun (instead of cmd-sun) and you should execute ORACLE from a shelltool.
    TWO_TASK is set to the location where ORACLE server can be found and will normally be the name of the database instance. This variable helps simplify the command line for starting ORACLE tools.
    Source:http://ugweb.cs.ualberta.ca/~c391/manual/chapt3.html
    HTH
    Girish Sharma
    Edited by: Girish Sharma on Mar 3, 2010 9:16 AM
    Link and Text added.

  • Using bind variables in Oracle SQL developer

    Hi all,
    i am using Oracle SQL developer. i want to use the bind variable in my sql.
    variable myid number :=1;
    select * from mds_3618_request where id = :myid;
    but i am getting the below error.
    Error starting at line 2 in command:
    select * from mds_3618_request where id = :myid
    Error report:
    SQL Error: Missing IN or OUT parameter at index:: 1
    Does Oracle SQL developer support bind variables in the SQL statements?
    thanks in Advance
    Vali Shaik

    You are probable going to get a quicker answer on this forum : SQL Developer
    -- Andy

  • Using variables in Oracle

    Hi,
    I am using java and oracle and I want to know the way to achieve the "user-defined variables" functionality of mysql
    [http://dev.mysql.com/doc/refman/4.1/en/user-variables.html]
    Basically I want my update query/PL-SQL block to first define a variable and then refer it multiple times in the query.I also want to return the number of updated rows to my application code in java
    I saw DEFINE variable,bind variables etc,but dont know what exactly should I use
    Thanks in advance
    Ananth

    I am looking to use the variables in the query
    itself.
    Ex: select @t1:=100,@t2:=@t1+10 from tbl_name where
    col_name > @t1 and col_name < @t2
    [This is a simple ex.I want to use current timestamp
    instead of 100 as first variable's value]
    Also,as I have mentioned,I need to use these in
    update statements also and return the no. of updated
    rows to java codeUse Declare on the beginning of a PL/SQL block to declare variable names and types. Then just use them in the code (including update statements) without any prefix (@ is not needed in oracle). As a clear difference from MySQL, you don't need to use select to set a variable value if it does not depend on a query, just use the := operator. To read values from a query into variables, use "select ... into" syntax.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/selectinto_statement.htm#LNPLS01345
    gojko adzic
    http://gojko.net

  • Bind variable with Oracle sequence

    can we insert oracle sequence with the bind varaible
    some thing like
    seq       number(5);
    begin
    select myseq.nextval
            into seq        from dual;
    dbms_sql.parse( l_cursor,insert into mytable (c1,c2,c3) values (seq,:1,:2),dbms_sql.native );
    dbms_sql.bind_variable( l_cursor, :1,58);
    dbms_sql.bind_variable( l_cursor, :2,9);
    l_status := dbms_sql.execute( l_cursor );
    end;
    Thanks!

    What are you trying there..
    Why dynamic SQL?
    Where is the exception block?
    you have to use 'using ' to work with these kind of dynamic variables. Something like this (ugly code below)
    CREATE SEQUENCE myseq;
    create table mytable (c1 number,c2 number, c3 number;
    DECLARE
       seq   NUMBER (5);
       A number;
       b NUMBER;
    BEGIN
       SELECT myseq.NEXTVAL INTO seq FROM DUAL;
       a := 1;
       b := 58;
       EXECUTE IMMEDIATE 'insert into mytable (c1,c2,c3) values (:seq,:1,:2)'
          USING seq, a, b;
       a := 1;
       b := 100;
       EXECUTE IMMEDIATE 'insert into mytable (c1,c2,c3) values (:seq,:1,:2)'
          USING seq, a, b;
       COMMIT;
    END;  --- Check you need to have proper exception block.
    Cheers,
    Manik.

  • Global variables in Oracle 8.1.6 on NT

    I am running Oracle 8.1.6 on Windows NT.
    Does anybody know how can I create and maintain global variables or even constants, so that the same variables and constants could be used by all connections to the database.
    The main feature is that I can store their values in database table or external file, but have not to read these values from table or file every time I need them.
    All readings from the source file or table must occur only one time, for example, during database server startup, after it all the values must be supplied directly from phisical memory rather than from the table or external file (to speed up this process).
    Thank you.

    Your answer lies in one of the new features introduced in the Oracle8i: New Features for Administrators course. You can create a function that executes as soon as the user logs in, loading the variables that are required.

  • Bind Variable in Oracle Standard Report

    hi experts
    i'm using oracle 10g r2 , working on oracle erp r12 ebs
    i have a standard report where i add some bind variables but the code is too complex and most of the data retrieved from formula column define in oracle standard report . how to add bind variable in this scenrio??

    I think you want to post in the appropriate EBS sub forum. This one is specifically to do with SQL and PL/SQL, so not everyone here will have knowledge of EBS.

  • Session database variables in Oracle 8i

    I have a need for storing values in variables that has scope for the duration of the connection. How can this be done in Oracle 8i?

    Thats not what I meant, I'll try to rephrase the question.
    I need to store values in the database that are only visible to the each connection.
    An alternative is to construct a package, which would have eg. functions set_emp_id and get_emp_id. What I wondered was if I instead can create a database variable eg. @user_id in Oracle 8i.

  • Increase Scope of Custom variables in Oracle JVM

    We on our project are facing the following problem, any suggestions to work around this would be appreciated :
    We our using Oracle 9i JVM for development
    Our Sample problem flow is as follows :
    A package PKG1 has three procedures PROC1/PROC2/PROC3
    A java class JC1 is invoked by a procedure PROC1 - JC1 is running under oracle JVM.
    JC1 does the task of mapping a custom user defined java object to an oracle collection and invokes a procedure PROC2 (we are using thin client connection object in JAVA by means of simple JDBC calls to connect to the database.) which takes the oracle collection as input parameter and does processing over it.
    A procedure PROC3 does the task of calling PROC1 and then tries to access global variables defined in the package set by PROC2 , which comes out as a failed operation throwing the error as:
         ORA-06531: Reference to uninitialized collection
    The reason for the above behavior is : In the parent oracle session invoked by PROC1 the class JC1 opens another child database session for PROC2 and thus values set in the child thread are not visible to the parent.
    Required support: Is there a means for setting up of some property in ORACLE or Java which can enforce the JAVA CLASS to use its parent / invoking oracle session or if there is any other approach to overcome the above situation.

    Anand,
    I believe the Java in the Oracle Database forum is more appropriate for your question.
    You said:
    The reason for the above behavior is the parent oracle session opens
    another child database session
    How do you do this? And why? And what evidence makes you certain that this is the problem?
    Good Luck,
    Avi.

Maybe you are looking for

  • How to post a header using GUI_DOWNLOAD

    hello: i would like to ask one favor, i trying to download a fiel to a PC i am using the GUI_DOWNLOAD function when i sent the it_table to the function this works well , but now i need to sent the name of the colums for each colums, i sending a table

  • CS3 on windows 2000?

    There I was, just about to upgrade to CS3, having not upgraded to 8, and notice it says Windows XP and Vista. Does this mean that : a. bad luck, it won't run on Windows 2000, or b. of course it will run on Windows 2000, there's just no official suppo

  • How to transport an inner table to a subroutine with change return content?

    now ,i want to perform a subroutine with a inner table,and i will delete some records from the inner table in the subroutine,but i don't want the change in the subroutine break into my main program.in other words,the content of the inner table which

  • Forest trust unable to find Active Directory Domain Controller

    I have two domains with a two-way forest trust. We'll call them ForestA and ForestB. They're on seperate subnets. ForestA's DCs are in one physical location. ForestB's DCs are in two locations, one of which is shared with A. I'm unable to route traff

  • Exit in va01

    Hi All, I want to call a subscreen of a standard TCode as popup while saving sales order. Req : When we click on Bill to Party partner,in Partner's tab in sales order,we get a subscreen displaying information about the same. Is this possible to get t