ODI SQL LDR issue

Hi Guys,
I am trying to load one csv file using sqlldr LKM and facing issue at Call Sqlldr step
Error Message is:
org.apache.bsf.BSFException: exception from Jython:
Traceback (most recent call last):
File "<string>", line 22, in <module>
Load Error: See Y:/BTLB_PLANS Product Codes ( A CODE LIST).log for details
     at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
     at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:322)
     at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2473)
     at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:48)
     at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
     at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:561)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
     at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
     at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
     at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
     at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:83)
     at java.lang.Thread.run(Thread.java:662)
Caused by: Traceback (most recent call last):
File "<string>", line 22, in <module>
Load Error: See Y:/BTLB_PLANS Product Codes ( A CODE LIST).log for details
     at org.python.core.PyException.fillInStackTrace(PyException.java:70)
     at java.lang.Throwable.<init>(Throwable.java:181)
     at java.lang.Exception.<init>(Exception.java:29)
     at java.lang.RuntimeException.<init>(RuntimeException.java:32)
     at org.python.core.PyException.<init>(PyException.java:46)
     at org.python.core.PyException.doRaise(PyException.java:219)
     at org.python.core.Py.makeException(Py.java:1166)
     at org.python.core.Py.makeException(Py.java:1170)
     at org.python.pycode._pyx0.f$0(<string>:59)
     at org.python.pycode._pyx0.call_function(<string>)
     at org.python.core.PyTableCode.call(PyTableCode.java:165)
     at org.python.core.PyCode.call(PyCode.java:18)
     at org.python.core.Py.runCode(Py.java:1204)
     at org.python.core.Py.exec(Py.java:1248)
     at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:172)
     at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
     at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:322)
     at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2472)
     at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:47)
     at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
     at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
     at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
     at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
     at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
     at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
     ... 1 more
and Code:
import java.lang.String
import java.lang.Runtime as Runtime
from jarray import array
import java.io.File
import os
import re
ctlfile = r"""Y:/BTLB_PLANS Product Codes ( A CODE LIST).ctl"""
logfile = r"""Y:/BTLB_PLANS Product Codes ( A CODE LIST).log"""
outfile = r"""Y:/BTLB_PLANS Product Codes ( A CODE LIST).out"""
oracle_sid=''
if len('UREPDEV')>0: oracle_sid = '@'+'UREPDEV'
loadcmd = r"""sqlldr 'REDW_DA_OWNER/<@=snpRef.getInfo("DEST_PASS") @>%s' control='%s' log='%s' > "%s" """ % (oracle_sid,ctlfile, logfile, outfile)
rc = os.system(loadcmd)
if rc <> 0 and rc <> 2:
     raise "Load Error", "See %s for details" % logfile
# Init Vars
nbIns = 0
nbRej = 0
nbNull = 0
strprt = ""
maxAllowedError = r"""0"""
c = 0
flag = 0
# Open log file
f = open(logfile, "r")
try:
     lines = f.readlines()
     for line in lines:
          if line.rstrip().upper().endswith(r"""REDW_DA_OWNER.TC$_0TEST:""".upper()):
               flag = 1
               c = 0
          if flag == 1:
               if c > 0 and c <= 4:
                    if c == 1 :
                         nbIns = int(re.findall("\d+", line)[0])
                    elif c == 2:
                         nbRej = int(re.findall("\d+", line)[0])
                    elif c == 4:
                         nbNull = int(re.findall("\d+", line)[0])
                         break
          c+=1
     strprt = "\n\tIns:\t%s\n\tReject:\t%s\n\tNullField:\t%s" % (nbIns, nbRej, nbNull)
finally:
     f.close()
# if some rows has been rejected due to invalide data, check KM option LOA_ERRORS
if rc == 2:
     if nbRej > int(maxAllowedError):
          raise strprt
          break
I am using LKM File to Oracle(SQLLDR)
Thanks in advance

error is saying:
org.apache.bsf.BSFException: exception from Jython:
Traceback (most recent call last):
File "<string>", line 22, in <module>
Load Error: See Y:/<file_name>.log for details
and no log file is created for that.
Few more things to add.
We have 2 different boxes. 1. ODI box (different server address)
2. DB box (different server address)
and Sql developer is installed on DB box. I am able to use SQLLoader utility through SQL Developer.
But when I am using ODI to use sql ldr through LKM SQL to Oracle (Sqlldr).
It is getting failed at 6th step i.e. Call sqlldr.
Error is : org.apache.bsf.BSFException: exception from Jython:
Traceback (most recent call last):
File "<string>", line 22, in <module>
Load Error: See<file_name>.log for details
but to my surprise all files were created at the folder except .log file.
Can anybody help me to solve this issue.
This is very urgent.
Is this because sqlldr is not accessible to ODI then how .ctl & .bad files are created.
I will really appreciate your help. it is bit urgent to solve this issue.
Edited by: 965549 on Oct 28, 2012 10:36 AM

Similar Messages

  • ODI 10g R2 LKM File to Oracle (sql*ldr)  ctl file

    Hi,
    ODI release 10.1.3.4
    I need to load a file into an oracle db. For big file I use the LKM file to oracle (sql loader). It is a delimited file with ' " ' enclosed text. I give in the datasotre all parameters record separator, field separator, text delimiter, decimal separator. Despite in the control file for sql*ldr it miss the line [optionnaly enclosed '"' ] so in my db it is loading "nn" instead of nn ...
    Do someone know this issue ?!
    Best regards,
    BL

    It would be best to you look in to the LKM code to see if its even there "optionally enclosed by"
    This is an old version of ODI and its quite possible that the support for this clause was not added to the step that builds the ctl file.
    If its not there, then you can add it your self.

  • SQL LDR LKM generating incorrect CTL file

    Hi,
    The LKM for SQL LDR is generating incorrect CTL file for a fixed length data file. Due to this the ODI is erring out.
    Here are the contents of the CTL file:
    SnpsOutFile "-File=//Myserver/myfile.ctl"
    OPTIONS (
         SKIP=0,
         ERRORS=0,
         DIRECT=TRUE
    LOAD DATA
    INFILE "//Myserver/myfile.RDY"
    BADFILE "//Myserver/myfile.bad"
    DISCARDFILE "//Myserver/myfile.dsc"
    DISCARDMAX 1
    INTO TABLE ORA_SCHEMA.C$_0RAW_TABLE
         C1_CHAR9     POSITION(:),
         C2_CHAR2     POSITION(:),
         C3_CHAR6     POSITION(:),
         C4_CODE          POSITION(:),
         C5_RAWG_CODE     POSITION(:),
         C6_E_NUMBER     POSITION(:),
         C7_T_NUMBER     POSITION(:),
         C8_C_COLOR     POSITION(:),
         C9_D_COLOR     POSITION(:),
         C10_R_CODE     POSITION(:)
    Why is "POSITION(:)" not getting the numbers before and after ":" ?
    I reverse engineered this file and have the correct values for "Physical Length" and "Logical Length"
    TIA,
    Ankit

    Hi Ankit,
    I think the column transformation mappings are set on the Source (radio button) in the Integration Interface Mapping window.
    Change the column transformation mappings to be executed on STAGE .
    It should resolve this issue.
    Thanks,
    Sutirtha

  • SQL Performance issue: Using user defined function with group by

    Hi Everyone,
    im new here and I really could need some help on a weird performance issue. I hope this is the right topic for SQL performance issues.
    Well ok, i create a function for converting a date from timezone GMT to a specified timzeone.
    CREATE OR REPLACE FUNCTION I3S_REP_1.fnc_user_rep_date_to_local (date_in IN date, tz_name_in IN VARCHAR2) RETURN date
    IS
    tz_name VARCHAR2(100);
    date_out date;
    BEGIN
    SELECT
    to_date(to_char(cast(from_tz(cast( date_in AS TIMESTAMP),'GMT')AT
    TIME ZONE (tz_name_in) AS DATE),'dd-mm-yyyy hh24:mi:ss'),'dd-mm-yyyy hh24:mi:ss')
    INTO date_out
    FROM dual;
    RETURN date_out;
    END fnc_user_rep_date_to_local;The following statement is just an example, the real statement is much more complex. So I select some date values from a table and aggregate a little.
    select
    stp_end_stamp,
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    stp_end_stampThis statement selects ~70000 rows and needs ~ 70ms
    If i use the function it selects the same number of rows ;-) and takes ~ 4 sec ...
    select
    fnc_user_rep_date_to_local(stp_end_stamp,'Europe/Berlin'),
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    fnc_user_rep_date_to_local(stp_end_stamp,'Europe/Berlin')I understand that the DB has to execute the function for each row.
    But if I execute the following statement, it takes only ~90ms ...
    select
    fnc_user_rep_date_to_gmt(stp_end_stamp,'Europe/Berlin','ny21654'),
    noi
    from
    select
    stp_end_stamp,
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    stp_end_stamp
    )The execution plan for all three statements is EXACTLY the same!!!
    Usually i would say, that I use the third statement and the world is in order. BUT I'm working on a BI project with a tool called Business Objects and it generates SQL, so my hands are bound and I can't make this tool to generate the SQL as a subselect.
    My questions are:
    Why is the second statement sooo much slower than the third?
    and
    Howcan I force the optimizer to do whatever he is doing to make the third statement so fast?
    I would really appreciate some help on this really weird issue.
    Thanks in advance,
    Andi

    Hi,
    The execution plan for all three statements is EXACTLY the same!!!Not exactly. Plans are the same - true. They uses slightly different approach to call function. See:
    drop table t cascade constraints purge;
    create table t as select mod(rownum,10) id, cast('x' as char(500)) pad from dual connect by level <= 10000;
    exec dbms_stats.gather_table_stats(user, 't');
    create or replace function test_fnc(p_int number) return number is
    begin
        return trunc(p_int);
    end;
    explain plan for select id from t group by id;
    select * from table(dbms_xplan.display(null,null,'advanced'));
    explain plan for select test_fnc(id) from t group by test_fnc(id);
    select * from table(dbms_xplan.display(null,null,'advanced'));
    explain plan for select test_fnc(id) from (select id from t group by id);
    select * from table(dbms_xplan.display(null,null,'advanced'));Output:
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1
       2 - SEL$1 / T@SEL$1
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$1" "T"@"SEL$1")
          OUTLINE_LEAF(@"SEL$1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "ID"[NUMBER,22]
       2 - "ID"[NUMBER,22]
    34 rows selected.
    SQL>
    Explained.
    SQL>
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1
       2 - SEL$1 / T@SEL$1
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$1" "T"@"SEL$1")
          OUTLINE_LEAF(@"SEL$1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "TEST_FNC"("ID")[22]
       2 - "ID"[NUMBER,22]
    34 rows selected.
    SQL>
    Explained.
    SQL> select * from table(dbms_xplan.display(null,null,'advanced'));
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$F5BB74E1
       2 - SEL$F5BB74E1 / T@SEL$2
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$F5BB74E1" "T"@"SEL$2")
          OUTLINE(@"SEL$2")
          OUTLINE(@"SEL$1")
          MERGE(@"SEL$2")
          OUTLINE_LEAF(@"SEL$F5BB74E1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "ID"[NUMBER,22]
       2 - "ID"[NUMBER,22]
    37 rows selected.

  • Summary SQL*LDR log file

    Hi,
    I need to get only a summary log file that show me records by error. for example if the log file has 5000 error for datatype and 300 for PK violation and 2000 for not null value, the problem that the log will show me this error row by row. can I get it summary like this
    -5000 rows rejected due to error for datatype
    -300 rows rejected due to PK violation
    -2000 rows rejected due to not null value
    Database: 9i
    O/S: Windows 2000 Server

    eng. Habeeli wrote:
    schavali wrote:
    Pl see your duplicate post here - big SQL*LDR log file
    Pl post what you have found in the documentation so far. AFAIK, there is no way to get a summary log file.
    Sriniits not duplicate ,I change to this form that specialized in sql loadre.
    I don't found any thing about summary log in the documnetPl post a link to the document you read. Did you see my comment above ?
    HTH
    Srini

  • How to track the sql commands issued against database

    Hello, We are using an interface developed by oracle forms. Its giving some error while pressing an icon. I can not able to trace out from where it arises. This error is displayed by form developed by oracle forms. I dont have source code to track it. I would like to know , which SQL statement rises the error, so that I can update the oracle object and can able to solve the problem if I can able to find the exect SQL statment issued before the error was displayed. kindly help me . thanks.

    habfat wrote:
    Hello, We are using an interface developed by oracle forms. Its giving some error while pressing an icon. I can not able to trace out from where it arises. This error is displayed by form developed by oracle forms. I dont have source code to track it. I would like to know , which SQL statement rises the error, so that I can update the oracle object and can able to solve the problem if I can able to find the exect SQL statment issued before the error was displayed. kindly help me . thanks.Hmm, well kind of a silly but still, if you don't have source code of the form( you said so) so even if you would come to know what statement is raising the error, how would you go and edit it ? Did I miss some thing? And you asked for a sql statement ? How did you come to know that its a sql statement that is causing the error? And if that's actually a sql statement error, isn't it associated with a meaningful message ?
    Find the developer who coded the application, he would be the best person to track the error and tell you its resolution IMO.
    HTH
    Aman....

  • PL/SQL speed issues when using a variable

    I have a very strange issue that is causing problems.
    I am running Golden connecting to a 11g database.
    I created a procedure to insert records into a table based on a query. The source query includes variables that I have populated prior to the insert statement. The problem is that if I use the variable for one very specific where statement, the statement goes from running in less than 1 second, to running in 15 minutes. It gets even more strange though. Not only does a 2nd variable not cause any problems, the exact same variable in the same statement works fine.
    This procedure takes 15 minutes to run.
    declare
        v_start_period date;
        v_end_period date;
    begin
        select add_months(trunc(sysdate,'mm'), -1), trunc(sysdate,'mm')
        into v_start_period, v_end_period
        from dual;
        insert into RESULTS_TABLE
                (first_audit_date, last_audit_date,
                data_column1, data_column2, data_column3)
            select
                a.first_audit_date, a.last_audit_date,
                b.data_column1, b.data_column2, b.data_column3
            from
                SOURCE_TABLE_1 b,
                (select marker_id, min(action_time) as first_audit_date, max(action_time) as last_audit_date
                    from SOURCE_TABLE_2
                    where action_time >= v_start_period and action_time < v_end_period
                    group by marker_id) a
            where b.marker_id = a.marker_id
                and exists (select 1 from SOURCE_TABLE_2
                    where marker_id = b.marker_id
                    and action_time >= v_start_period and action_time < v_end_period
                    and action_type = 'XYZ');
        commit;
    end;This procedure runs in less than 1 second, yet returns the exact same results.
    declare
        v_start_period date;
        v_end_period date;
    begin
        select add_months(trunc(sysdate,'mm'), -1), trunc(sysdate,'mm')
        into v_start_period, v_end_period
        from dual;
        insert into RESULTS_TABLE
                (first_audit_date, last_audit_date,
                data_column1, data_column2, data_column3)
            select
                a.first_audit_date, a.last_audit_date,
                b.data_column1, b.data_column2, b.data_column3
            from
                SOURCE_TABLE_1 b,
                (select marker_id, min(action_time) as first_audit_date, max(action_time) as last_audit_date
                    from SOURCE_TABLE_2
                    where action_time >= v_start_period and action_time < trunc(sysdate,'mm')
                    group by marker_id) a
            where b.marker_id = a.marker_id
                and exists (select 1 from SOURCE_TABLE_2
                    where marker_id = b.marker_id
                    and action_time >= v_start_period and action_time < v_end_period
                    and action_type = 'XYZ');
        commit;
    end;The only difference between the two is where I replace the first v_end_period variable with trunc(sysdate,'mm').
    I've been googling for possible solutions and keep running into something called "parameter sniffing". It appears to be a SQL Server issue though, as I cannot find solutions for Oracle. I tried nesting the insert statement inside it's own procedure with new variables populated by the old variables, but nothing changed.
    Edited by: user_7000017 on Jan 8, 2013 9:45 AM
    Edited by: user_7000017 on Jan 8, 2013 9:52 AM Put the code in code tags.

    You are not describing procedures. You are listing anonymous PL/SQL blocks.
    As for the code - this approach to assigning PL/SQL variables are highly questionable. As the functions are native PL/SQL functions too, there is no need to parse and execute a SQL cursor, do context switching, in order to assign values to PL/SQL variables.
    This is wrong:
    select
        add_months(trunc(sysdate,'mm'), -1), trunc(sysdate,'mm')
        into v_start_period, v_end_period
    from dual;This is correct:
    v_start_period := add_months(trunc(sysdate,'mm'), -1);
    v_end_period := trunc(sysdate,'mm');Just as you would not use +"select 1 into plVariable from dual;+", instead of a standard variable assignment statement like +"plVariable := 1;"+.
    As for the performance/execution difference. Does not make sense. I suggest simplifying the code in order to isolate the problem. For example, take that in-line SQL (aliased as a in the main SQL) and create a testcase where it uses the function, versus a PL/SQL bind variable with the same data type and value as that returned by the function. Examine and compare the execution plans.
    Increase complexity (if no error) and repeat. Until the error is isolated.
    The 1st step in any troubleshooting, is IDENTIFYING the problem. Without knowing what the problem is, how can one fix it?

  • Oracle 11g - External Table/SQL Developer Issue?

    Oracle 11g - External Table/SQL Developer Issue?
    ==============================
    I hope this is the right forum for this issue, if not let me, where to go.
    We are using Oracle 11g (11.2.0.1.0) on (Platform : solaris[tm] oe (64-bit)), Sql Developer 3.0.04
    We are trying to use oracle external table to load text files in .csv format. Here is our data look like.
    ======================
    Date1,date2,Political party,Name, ROLE
    20-Jan-66,22-Nov-69,Democratic,"John ", MMM
    22-Nov-70,20-Jan-71,Democratic,"John Jr.",MMM
    20-Jan-68,9-Aug-70,Republican,"Rick Ford Sr.", MMM
    9-Aug-72,20-Jan-75,Republican,Henry,MMM
    ------ ALL NULL -- record
    20-Jan-80,20-Jan-89,Democratic,"Donald Smith",MMM
    ======================
    Our Expernal table structures is as follows
    CREATE TABLE P_LOAD
    DATE1 VARCHAR2(10),
    DATE2 VARCHAR2(10),
    POL_PRTY VARCHAR2(30),
    P_NAME VARCHAR2(30),
    P_ROLE VARCHAR2(5)
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY P_EXT_TAB_D
    ACCESS PARAMETERS (
    RECORDS DELIMITED by NEWLINE
    SKIP 1
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' LDRTRIM
    REJECT ROWS WITH ALL NULL FIELDS
    MISSING FIELD VALUES ARE NULL
    DATE1 CHAR (10) Terminated by "," ,
    DATE2 CHAR (10) Terminated by "," ,
    POL_PRTY CHAR (30) Terminated by "," ,
    P_NAME CHAR (30) Terminated by "," OPTIONALLY ENCLOSED BY '"' ,
    P_ROLE CHAR (5) Terminated by ","
    LOCATION ('Input.dat')
    REJECT LIMIT UNLIMITED;
         It created successfully using SQL Developer
    Here is the issue.
    It is not loading the records, where fields are enclosed in '"' (Rec # 2,3,4,7)
    It is loading all NULL value record (Rec # 6)     
    *** If we remove the '"' from input data, it loads all records including all NULL records
    Log file has
    KUP-04021: field formatting error for field P_NAME
    KUP-04036: second enclosing delimiter not found
    KUP-04101: record 2 rejected in file ....
    Our questions
    Why did "REJECT ROWS WITH ALL NULL FIELDS" not working?
    Why did Terminated by "," OPTIONALLY ENCLOSED BY '"' not working?
    Any idea?
    Thanks in helping.

    I don't think this is a SQLDeveloper issue. You will get better answers in the Database - General or perhaps SQL and PL/SQL forums.

  • Sql ldr help

    Hi All,
    I'm having a problem with the sql ldr ...
    SQL> sqlldr control=xyz.ctl
    SP2-0734: unknown command beginning "sqlldr con..." - rest of line ignored.
    SQL> sqlldr hr/hr control=c:\users\nalla\desktop\xyz.ctl
    SP2-0734: unknown command beginning "sqlldr hr/..." - rest of line ignored.
    SQL>
    I have my control file and data file all good.
    Please help me
    Thanks!

    I don't think you need this reserved keyword userid
    userid=hr/hr
    Just sqlldr hr/hr@dbname control =abcd.ctl
    Nalla,
    OAD DATA
    INFILE 'C:\Documents and Settings\...............\abc.csv'
    BADFILE 'C:\Documents and Settings\...............\abc.bad'
    DISCARDFILE 'C:\Documents and Settings\\...............\abc.dis'
    APPEND INTO TABLE xyz REPLACE
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
    a     CHAR,
         b     CHAR,
         c     CHAR,
         d     CHAR
    Please advise.

  • Sql-ldr

    Hi Experts,
    I want to load the data from flat file to database tables with help of sql ldr .. the scenario is i want to load the flat file "name" (no need extention, name of the file only need to be loaded in to the table columns) in to one of the table column, can any one please help me how to load the file name in to tables, how to manually insert the singale file name to table column, please guide me with detail?
    Thanks,

    Hi,
    As I said earlier, you have to maintain the list of filename's "itemdescr" in different temp file and load it an and when required table instead of checking for round robin functionality. If you are looking forward that oracle sqlldr can able to access the filename as one of the parameter then - it might not possible AFAIK.
    else perform the direct insert on the table from sqlclient.
    - Pavan Kumar N

  • How to monitor  SQL statements issued by SIEBEL ?

    Hi,
    We have developed BI Siebel 10.1.3.3. application.
    One of the requirement is to persist/store in the database real SQL statement issued by BI Dashboards/Answers.
    The best solution would be having acces on-line to cursor cache.
    Could someone please tell me how to achive this ?
    Regards,
    Cezary

    Sounds like you're looking for Usage Tracking.
    OBIEE Server Administration Guide – Pages: 220
    OBIEE Installation and Configuration Guide – Pages: 229
    And this post here;
    http://oraclebizint.wordpress.com/2007/08/14/usage-tracking-in-obi-ee/
    A.

  • Trace SQL statement issued by BC4J

    Is there a way to see at runtime (in the console window or in a log file) the SQL statements issued by the BC4Js to the database?
    Perhaps there is a switch or a -D option to set to the OC4J startup command. This would be really helpfull during development.
    Thanks,
    Marco.

    Yes, you are right. that will be done by specify a Java virtual parameters - -Djbo.debugoutput=console.

  • How to retrieve last SQL statment issued

    Is there any way in code to get the last SQL statement issued? I want to know the exact statement issued so that I can log it with the error message when any DB errors occurr in our app.
    TIA

    If your Application is developed using Forms 4.5/6i, then you can use ":system.last_query" to bet most recently executed query with in that session. If your app is developed using some other tools, then you have to relay on V$ Views, say querying V$SESSION and V$SQLAREA by OSUSER, USERNAME etc.
    Is there any way in code to get the last SQL statement issued? I want to know the exact statement issued so that I can log it with the error message when any DB errors occurr in our app.
    TIA

  • A SQL tuning issue-sql runs much slower in test than in production?

    Hi Buddies,
    I am working on a sql tuning issue. A sql runs much slower in test than in production.
    I compared the two explain plans in test and production
    seems in test, CBO refuses to use index SUBLEDGER_ENTRY_I2.
    we rebuile it and re-gether that index statistcs. run, still slow..
    I compared the init.ora parameters like hash_area_size, sort_area_size in test, they are same as production.
    I wonder if any expert friend can show some light.
    in production,
    SQL> set autotrace traceonly
    SQL> SELECT rpt_horizon_subledger_entry_vw.onst_offst_cd,
    2 rpt_horizon_subledger_entry_vw.bkng_prd,
    3 rpt_horizon_subledger_entry_vw.systm_afflt_cd,
    4 rpt_horizon_subledger_entry_vw.jrnl_id,
    5 rpt_horizon_subledger_entry_vw.ntrl_accnt_cd,
    6 rpt_horizon_subledger_entry_vw.gnrl_ldgr_chrt_of_accnt_nm,
    7 rpt_horizon_subledger_entry_vw.lgl_entty_brnch_cd,
    8 rpt_horizon_subledger_entry_vw.crprt_melob_cd AS corp_mlb_cd,
    rpt_horizon_subledger_entry_vw.onst_offst_cd, SUM (amt) AS amount
    9 10 FROM rpt_horizon_subledger_entry_vw
    11 WHERE rpt_horizon_subledger_entry_vw.bkng_prd = '092008'
    12 AND rpt_horizon_subledger_entry_vw.jrnl_id = 'RCS0002100'
    13 AND rpt_horizon_subledger_entry_vw.systm_afflt_cd = 'SAFF01'
    14 GROUP BY rpt_horizon_subledger_entry_vw.onst_offst_cd,
    15 rpt_horizon_subledger_entry_vw.bkng_prd,
    16 rpt_horizon_subledger_entry_vw.systm_afflt_cd,
    17 rpt_horizon_subledger_entry_vw.jrnl_id,
    18 rpt_horizon_subledger_entry_vw.ntrl_accnt_cd,
    19 rpt_horizon_subledger_entry_vw.gnrl_ldgr_chrt_of_accnt_nm,
    20 rpt_horizon_subledger_entry_vw.lgl_entty_brnch_cd,
    21 rpt_horizon_subledger_entry_vw.crprt_melob_cd,
    22 rpt_horizon_subledger_entry_vw.onst_offst_cd;
    491 rows selected.
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=130605 Card=218764 B
    ytes=16407300)
    1 0 SORT (GROUP BY) (Cost=130605 Card=218764 Bytes=16407300)
    2 1 VIEW OF 'RPT_HORIZON_SUBLEDGER_ENTRY_VW' (Cost=129217 Ca
    rd=218764 Bytes=16407300)
    3 2 SORT (UNIQUE) (Cost=129217 Card=218764 Bytes=35877296)
    4 3 UNION-ALL
    5 4 HASH JOIN (Cost=61901 Card=109382 Bytes=17719884)
    6 5 TABLE ACCESS (FULL) OF 'GNRL_LDGR_CHRT_OF_ACCNT'
    (Cost=2 Card=111 Bytes=3774)
    7 5 HASH JOIN (Cost=61897 Card=109382 Bytes=14000896
    8 7 TABLE ACCESS (FULL) OF 'SUBLEDGER_CHART_OF_ACC
    OUNT' (Cost=2 Card=57 Bytes=1881)
    9 7 HASH JOIN (Cost=61893 Card=109382 Bytes=103912
    90)
    10 9 TABLE ACCESS (FULL) OF 'HORIZON_LINE' (Cost=
    34 Card=4282 Bytes=132742)
    11 9 HASH JOIN (Cost=61833 Card=109390 Bytes=7000
    960)
    12 11 TABLE ACCESS (BY INDEX ROWID) OF 'SUBLEDGE
    R_ENTRY' (Cost=42958 Card=82076 Bytes=3611344)
    13 12 INDEX (RANGE SCAN) OF 'SUBLEDGER_ENTRY_I
    2' (NON-UNIQUE) (Cost=1069 Card=328303)
    14 11 TABLE ACCESS (FULL) OF 'HORIZON_SUBLEDGER_
    LINK' (Cost=14314 Card=9235474 Bytes=184709480)
    15 4 HASH JOIN (Cost=61907 Card=109382 Bytes=18157412)
    16 15 TABLE ACCESS (FULL) OF 'GNRL_LDGR_CHRT_OF_ACCNT'
    (Cost=2 Card=111 Bytes=3774)
    17 15 HASH JOIN (Cost=61903 Card=109382 Bytes=14438424
    18 17 TABLE ACCESS (FULL) OF 'SUBLEDGER_CHART_OF_ACC
    OUNT' (Cost=2 Card=57 Bytes=1881)
    19 17 HASH JOIN (Cost=61899 Card=109382 Bytes=108288
    18)
    20 19 TABLE ACCESS (FULL) OF 'HORIZON_LINE' (Cost=
    34 Card=4282 Bytes=132742)
    21 19 HASH JOIN (Cost=61838 Card=109390 Bytes=7438
    520)
    22 21 TABLE ACCESS (BY INDEX ROWID) OF 'SUBLEDGE
    R_ENTRY' (Cost=42958 Card=82076 Bytes=3939648)
    23 22 INDEX (RANGE SCAN) OF 'SUBLEDGER_ENTRY_I
    2' (NON-UNIQUE) (Cost=1069 Card=328303)
    24 21 TABLE ACCESS (FULL) OF 'HORIZON_SUBLEDGER_
    LINK' (Cost=14314 Card=9235474 Bytes=184709480)
    Statistics
    25 recursive calls
    18 db block gets
    343266 consistent gets
    370353 physical reads
    0 redo size
    15051 bytes sent via SQL*Net to client
    1007 bytes received via SQL*Net from client
    34 SQL*Net roundtrips to/from client
    1 sorts (memory)
    1 sorts (disk)
    491 rows processed
    in test
    SQL> set autotrace traceonly
    SQL> SELECT rpt_horizon_subledger_entry_vw.onst_offst_cd,
    2 rpt_horizon_subledger_entry_vw.bkng_prd,
    3 rpt_horizon_subledger_entry_vw.systm_afflt_cd,
    4 rpt_horizon_subledger_entry_vw.jrnl_id,
    5 rpt_horizon_subledger_entry_vw.ntrl_accnt_cd,
    rpt_horizon_subledger_entry_vw.gnrl_ldgr_chrt_of_accnt_nm,
    6 7 rpt_horizon_subledger_entry_vw.lgl_entty_brnch_cd,
    8 rpt_horizon_subledger_entry_vw.crprt_melob_cd AS corp_mlb_cd,
    9 rpt_horizon_subledger_entry_vw.onst_offst_cd, SUM (amt) AS amount
    10 FROM rpt_horizon_subledger_entry_vw
    11 WHERE rpt_horizon_subledger_entry_vw.bkng_prd = '092008'
    12 AND rpt_horizon_subledger_entry_vw.jrnl_id = 'RCS0002100'
    AND rpt_horizon_subledger_entry_vw.systm_afflt_cd = 'SAFF01'
    13 14 GROUP BY rpt_horizon_subledger_entry_vw.onst_offst_cd,
    15 rpt_horizon_subledger_entry_vw.bkng_prd,
    16 rpt_horizon_subledger_entry_vw.systm_afflt_cd,
    17 rpt_horizon_subledger_entry_vw.jrnl_id,
    18 rpt_horizon_subledger_entry_vw.ntrl_accnt_cd,
    rpt_horizon_subledger_entry_vw.gnrl_ldgr_chrt_of_accnt_nm,
    rpt_horizon_subledger_entry_vw.lgl_entty_brnch_cd,
    rpt_horizon_subledger_entry_vw.crprt_melob_cd,
    rpt_horizon_subledger_entry_vw.onst_offst_cd; 19 20 21 22
    no rows selected
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=92944 Card=708 Bytes
    =53100)
    1 0 SORT (GROUP BY) (Cost=92944 Card=708 Bytes=53100)
    2 1 VIEW OF 'RPT_HORIZON_SUBLEDGER_ENTRY_VW' (Cost=92937 Car
    d=708 Bytes=53100)
    3 2 SORT (UNIQUE) (Cost=92937 Card=708 Bytes=124962)
    4 3 UNION-ALL
    5 4 HASH JOIN (Cost=46456 Card=354 Bytes=60180)
    6 5 TABLE ACCESS (FULL) OF 'SUBLEDGER_CHART_OF_ACCOU
    NT' (Cost=2 Card=57 Bytes=1881)
    7 5 NESTED LOOPS (Cost=46453 Card=354 Bytes=48498)
    8 7 HASH JOIN (Cost=11065 Card=17694 Bytes=1362438
    9 8 HASH JOIN (Cost=27 Card=87 Bytes=5133)
    10 9 TABLE ACCESS (FULL) OF 'HORIZON_LINE' (Cos
    t=24 Card=87 Bytes=2175)
    11 9 TABLE ACCESS (FULL) OF 'GNRL_LDGR_CHRT_OF_
    ACCNT' (Cost=2 Card=111 Bytes=3774)
    12 8 TABLE ACCESS (FULL) OF 'HORIZON_SUBLEDGER_LI
    NK' (Cost=11037 Card=142561 Bytes=2566098)
    13 7 TABLE ACCESS (BY INDEX ROWID) OF 'SUBLEDGER_EN
    TRY' (Cost=2 Card=1 Bytes=60)
    14 13 INDEX (UNIQUE SCAN) OF 'SUBLEDGER_ENTRY_PK'
    (UNIQUE) (Cost=1 Card=1)
    15 4 HASH JOIN (Cost=46456 Card=354 Bytes=64782)
    16 15 TABLE ACCESS (FULL) OF 'SUBLEDGER_CHART_OF_ACCOU
    NT' (Cost=2 Card=57 Bytes=1881)
    17 15 NESTED LOOPS (Cost=46453 Card=354 Bytes=53100)
    18 17 HASH JOIN (Cost=11065 Card=17694 Bytes=1362438
    19 18 HASH JOIN (Cost=27 Card=87 Bytes=5133)
    20 19 TABLE ACCESS (FULL) OF 'HORIZON_LINE' (Cos
    t=24 Card=87 Bytes=2175)
    21 19 TABLE ACCESS (FULL) OF 'GNRL_LDGR_CHRT_OF_
    ACCNT' (Cost=2 Card=111 Bytes=3774)
    22 18 TABLE ACCESS (FULL) OF 'HORIZON_SUBLEDGER_LI
    NK' (Cost=11037 Card=142561 Bytes=2566098)
    23 17 TABLE ACCESS (BY INDEX ROWID) OF 'SUBLEDGER_EN
    TRY' (Cost=2 Card=1 Bytes=73)
    24 23 INDEX (UNIQUE SCAN) OF 'SUBLEDGER_ENTRY_PK'
    (UNIQUE) (Cost=1 Card=1)
    Statistics
    1134 recursive calls
    0 db block gets
    38903505 consistent gets
    598254 physical reads
    60 redo size
    901 bytes sent via SQL*Net to client
    461 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    34 sorts (memory)
    0 sorts (disk)
    0 rows processed
    Thanks a lot in advance
    Jerry

    Hi
    Basically there are two kinds of tables
    - fact
    - lookup
    The number of records in a lookup table is usually small.
    The number of records in a fact table is usually huge.
    However, in test systems the number of records in a fact table is often also small.
    This results in different execution plans.
    I notice again you don't post version and platform info, and you didn't make sure your explain is properly idented
    Please read the FAQ to make sure it is properly idented.
    Also using the word 'buddies' is as far as I am concerned nearing disrespect and rudeness.
    Sybrand Bakker
    Senior Oracle DBA

  • EAS -  Rule File SQL retrieval Issue

    Hi All,
    We are using EPM 11.1.2 I have created ODBC DSN connection to a oracle database using data direct 6.0 oracle wire protocol. Iam using the DSN connection in the rule file to retrieve the information from the database.
    Currently the issue is that view has a filter condition to pull data greater than 2011 when I retrieve through the SQL client tools data retrieved is as per the filter condition and when I am retrieving the data from the same view thru EAS console it shows up information starting from 2008.
    Even if I tried by applying the filters it didn't help me out
    Why does EAS behave like this am I using correct driver ?
    Please put on your ideas if you have faced this issue before.
    Thanks in advance........

    I was not able to figure out this issue so I have created an ODI to update my dimensions.
    Thanks ....

Maybe you are looking for

  • HT1349 How can I import my music library from my computer to my laptop or iPad, my computer is no longer working

    My computer is no longer working and I had hundreds of songs in my iTunes library, but when I tried to join on my laptop I couldn't get my songs, it asked me if I wanted to change computers but I'm scared in case they get deleted .

  • Reverse engineering an iweb project

    I sort of inherited a website that was built with iWeb and need to make a few (hopefully), small (hopefully) changes.  I'm not an iWeb user.  The website has a navigation bar at the top that is tied via a .js to a file called "feed.xml".  What is the

  • Problem in workflow trigger

    Hi, I was trying to create a pretty simple workflow for "Sales Order Change". Whenever a sales order is changed, my workflow should get triggered and I should receive a workitem in my sap inbox displaying the salesorder number getting modified. Objec

  • Master Page Shuffling Error in InDesign CC

    I have used master pages all the time and have have never had a problem with it in CS5. I now am on a subscription for creative cloud and started having this error in CS6 and it has continued into CC. When I add a new page or change the position of a

  • Problem installing Oracle Database Instance

    Hi, I'm installing SAP Web AS 6.40 ABAP on Linux (SLES 9) with Unicode Oracle. The Central Instance setup was successful, but the install of the Database Instance failed. It stopped at task "Database Load". The Log Browser shows the following message