How to use oracle OCIANYDATASET?

Hi, All
When I try to update oracle example "Pipelined Table Functions Example: C Implementation" to return OCIANYDATASET, but from oracle documnet, I cannot find any example about how to use OCIANYDATASET, would you please help me out of this issue, any example or advice is benefit for this issue. thanks.
The PL/SQL below works OK now:
member function ODCITableFetch(self in out StockPivotImpl, nrows in number,  record_out out anydataset) return number is
  rc SYS_REFCURSOR;
  value  pls_integer;
  cur StockTable%ROWTYPE;
  begin
    record_out := null;
     DBMS_ODCI.RestoreRefCursor(rc, self.cur_n);
    if row_was_returned = 1 then
      return ODCIconst.success;
    end if;
    row_was_returned := 1;
    anydataset.begincreate(dbms_types.typecode_object, self.row_types, record_out);
     loop
          fetch rc into cur;
          EXIT WHEN rc%NOTFOUND;
          record_out.addinstance;
        record_out.piecewise();
          -- Setting the returned values:
          record_out.setvarchar2(cur.ticker);
          record_out.setnumber  (cur.openprice);
          record_out.setnumber  (nrows);
          record_out.setvarchar2('new_column');
     end loop;     
     close rc;
    record_out.endcreate;
    return odciconst.success;
  end;But how to implement below C function, especially how to append value into OCIAnyDataSet and return it?
-- Create table function
CREATE FUNCTION StockPivot(p refcur_pkg.refcur_t) RETURN anydataset
PIPELINED USING StockPivotImpl;
SELECT * FROM TABLE(StockPivot(CURSOR(SELECT * FROM StockTable)));
  MEMBER FUNCTION ODCITableFetch(self IN OUT StockPivotImpl, nrows IN NUMBER,
                                 record_out out anydataset) RETURN PLS_INTEGER
    AS LANGUAGE C
    LIBRARY StockPivotLib
    NAME "ODCITableFetch"
    WITH CONTEXT
    PARAMETERS (
      context,
      self,
      self INDICATOR STRUCT,
      nrows,
      record_out,
      record_out INDICATOR,
      RETURN INT
int ODCITableFetch(OCIExtProcContext* extProcCtx, StockPivotImpl* self,
                       StockPivotImpl_ind* self_ind, OCINumber* nrows,
                       OCIAnyDataSet* outSet, short* outSet_ind)Edited by: BluShadow on 11-Apr-2013 10:42
added {noformat}{noformat} tags for readability.  Please read the FAQ: {message:id=9360002} and learn to do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Thanks for your reply, Yes, I have read the doc, but it seems like that doesn't work in my code. I'm not sure whether I missed something. My steps below:
int ODCITableFetch(OCIExtProcContext* extProcCtx, StockPivotImpl* self,
                    StockPivotImpl_ind* self_ind, OCINumber* nrows,
                    OCIAnyDataSet* outSet, short* outSet_ind)
OCIAnyData* myData = (OCIAnyData*)0;
status = OCIAnyDataSetBeginCreate(handles.svchp, handles.errhp, OCI_TYPECODE_OBJECT, (OCIType *)self->out, OCI_DURATION_SESSION, &outSet);
status = OCIAnyDataSetAddInstance(handles.svchp, handles.errhp, outSet, &myData);
//AAA
OCIStringAssignText(handles.envhp, handles.errhp, (text *)"CA", 2, &str);
checkerr(&handles, OCIAnyDataAttrSet(handles.svchp, handles.errhp, (OCIAnyData*)myData, (OCITypeCode)OCI_TYPECODE_VARCHAR2,(OCIType *)0, (dvoid *)&indp, (void*)str, sizeof(str), FALSE)); // Crashed here
//BBB
status = OCIAnyDataSetEndCreate(handles.svchp,handles.errhp, outSet);
//CCC
return ODCI_SUCCESS;
It crashed in function OCIAnyDataAttrSet(), but when I added the function OCITypeByName() and OCIAnyDataBeginCreate() in AAA and OCIAnyDataEndCreate() in BBB, no error happened again and I can get the instance in CCC with function OCIAnyDataSetGetInstance() and I also can get the value via function OCIAnyDataAttrGet() after CCC from the instance, but when I run the query, it is no rows selected, why?

Similar Messages

  • How to use oracle fusion middleware for integration project ?

    hi all,
    in my projects, customer (a bank) already has many applications (bankend & frontend) that are complicatedly connected. I intend to use oracle fusion middleware to integrate all applications and make adding new applications in the future easier. I have worked through documents in the oracle website but I still have no idea how to use oracle fusion middleware to address the requirement, besides oracle fusion middleware includes a bundle of applications I don't know which one I would need.
    could anyone give me some instructions ? appreciate your help.
    thank very much,

    Hi,
    For this short description of environment, could be ODI is a incredible tool to help you...
    Take a look into my blog that has a lot of concepts and "how to do" instructions.... http://odiexperts.com
    However to try help you, what are the used technologies?
    Where are you from?
    Cezar Santos
    http://odiexperts.com

  • How to use Oracle partitioning with JPA @OneToOne reference?

    Hi!
    A little bit late in the project we have realized that we need to use Oracle partitioning both for performance and admin of the data. (Partitioning by range (month) and after a year we will move the oldest month of data to an archive db)
    We have an object model with an main/root entity "Trans" with @OneToMany and @OneToOne relationships.
    How do we use Oracle partitioning on the @OneToOne relationships?
    (We'd rather not change the model as we already have millions of rows in the db.)
    On the main entity "Trans" we use: partition by range (month) on a date column.
    And on all @OneToMany we use: partition by reference (as they have a primary-foreign key relationship).
    But for the @OneToOne key for the referenced object, the key is placed in the main/source object as the example below:
    @Entity
    public class Employee {
    @Id
    @Column(name="EMP_ID")
    private long id;
    @OneToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ADDRESS_ID")
    private Address address;
    EMPLOYEE (table)
    EMP_ID FIRSTNAME LASTNAME SALARY ADDRESS_ID
    1 Bob Way 50000 6
    2 Sarah Smith 60000 7
    ADDRESS (table)
    ADDRESS_ID STREET CITY PROVINCE COUNTRY P_CODE
    6 17 Bank St Ottawa ON Canada K2H7Z5
    7 22 Main St Toronto ON Canada     L5H2D5
    From the Oracle documentation: "Reference partitioning allows the partitioning of two tables related to one another by referential constraints. The partitioning key is resolved through an existing parent-child relationship, enforced by enabled and active primary key and foreign key constraints."
    How can we use "partition by reference" on @OneToOne relationsships or are there other solutions?
    Thanks for any advice.
    /Mats

    Crospost! How to use Oracle partitioning with JPA @OneToOne reference?

  • How to use Oracle refcursor dataset output parameter from SP

    Can I request for help on how to use Oracle Output parameter from a stored procedure as a source. I need the output tobe stored in a flat file
    Thanks
    Abhijit
    Message was edited by:
    Abhijit77

    yes I would like to use it for ODI.. I would like the ouput of the refcursor to be fed to a text file using ODI. How to handle the records returned by the refcursor and map with txt file.

  • How to Use Oracle 8i with MapX?

    I am trying to work with oracle 8i 1.6 and mapX 4.5 but un-able to do so. I tried by adding server layer but couldn't do so.
    Help !!

    Crossposted: Re: How to use Oracle partitioning with JPA @OneToOne reference?

  • How to use Oracle Table Type values in Select Statement.

    Hi,
    I am fetching initial set of values into Oracle Table of Records Type and want to use list of values in the Select statement.
    For example, try something like the following:
    TYPE t_record IS RECORD (
    ID TABLEA.ID%type,
    NO TABLEA.NO%type,
    v_record t_record;
    TYPE t_table IS TABLE OF v_record%TYPE;
    v_table t_table;
    -- Code to populate the values in v_table here.
    SELEC ID,NO, BULK COLLECT INTO <some other table variabes here> FROM TABLEA
    WHERE ID IN v_table(i).ID;
    I want to know how to use the values from Oracle Table Type in the Select Statement.

    Something like this:
    create or replace type t_record as  object (
    id number,
    no number
    CREATE or replace type t_table AS TABLE OF t_record;
    set serveroutput on
    declare
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    begin
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /Untested!
    P;
    Edited by: bluefrog on Mar 5, 2010 5:08 PM

  • How to use oracle collection type with JDBC?

    I try to use oracle collection type in java program. So I made some package and java program, however Java program was not found "package.collectiontype"(JDBC_ERP_IF_TEST.NUM_ARRAY) . please, show me how to use this.
    Java Version : Java 1.4
    JDBC Driver : Oracle Oci Driver
    DB: Oracle 9i
    No 1. Package
    ===========================================
    create or replace package JDBC_ERP_IF_TEST AS
    type NUM_ARRAY is table of number;
    procedure JDBC_ERP_IF_ARRAY_TEST(P_NUM_ARRAY IN NUM_ARRAY, ERR_NO OUT NUMBER, ERR_TEXT OUT VARCHAR2);
    procedure TEST(ABC IN NUMBER);
    END JDBC_ERP_IF_TEST;
    ==================================================
    No 2. Package Body
    ===============================================
    CREATE OR REPLACE package BODY JDBC_ERP_IF_TEST is
    procedure JDBC_ERP_IF_ARRAY_TEST(p_num_array IN NUM_ARRAY,
    ERR_NO OUT NUMBER,
    ERR_TEXT OUT VARCHAR2) is
    begin
    ERR_NO := 0;
    ERR_TEXT := '';
    dbms_output.enable;
    for i in 1 .. p_num_array.count() loop
    dbms_output.put_line(p_num_array(i));
    insert into emp (empno) values (p_num_array(i));
    commit;
    end loop;
    EXCEPTION
    WHEN OTHERS THEN
    ERR_NO := SQLCODE;
    ERR_TEXT := ERR_TEXT ||
    ' IN JDBC INTERFACE TEST FOR ORACLE ERP OPEN API..';
    ROLLBACK;
    RETURN;
    end JDBC_ERP_IF_ARRAY_TEST;
    procedure TEST(ABC IN NUMBER) IS
    begin
    insert into emp(empno) values (ABC);
    commit;
    end TEST;
    end JDBC_ERP_IF_TEST;
    ===============================================
    NO 3. Java Program
    ===============================================
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("JDBC_ERP_IF_TEST.NUM_ARRAY", getConnection());
    ARRAY array = new ARRAY(descriptor, getConnection(), arrs);
    cstmt = getConnection().prepareCall(LQueryFactory.getInstance().get("Meta/Basic/testJdbcErpArrayIf").getSql());
    cstmt.setArray(1, array);
    cstmt.registerOutParameter(2, Types.INTEGER);
    cstmt.registerOutParameter(3, Types.VARCHAR);
    ====================================================
    couldn't find this phase => JDBC_ERP_IF_TEST.NUM_ARRAY
    what can i do for this package and program? please help me..

    Something like this:
    create or replace type t_record as  object (
    id number,
    no number
    CREATE or replace type t_table AS TABLE OF t_record;
    set serveroutput on
    declare
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    begin
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /Untested!
    P;
    Edited by: bluefrog on Mar 5, 2010 5:08 PM

  • How to use Oracle database in CR XI R2!!!

    Hi All,
    I am having Oracle database in onsite machine.
    I need to design the report without DSN and installing Oracle in my machine.
    I dont know how to use connection String and Find DSN file option.
    Please anyone help me to solve the issue.
    Thanks in advance
    Saravanakumar.

    hI,
    Thank you for your reply.
    1. I tried to give connection string, but i couldnt succeed.
    2.If is give OLE(ODBC) I dono how the connection is established. Will it refer to TNSNAMES.ORA file, because it is simpy asking data source, use ID and password.
    it will be helpful if you clarify me on the doubts.
    Thank you,
    Saravanakumar.

  • How to use Oracle text

    I'm storing files in a blob field in a 9i database, sometimes I need to query using the details stored in the database about the file and sometimes I need to search the files to find matches with some text (like search engine), I was told that oracle text can help me accomplish this functionality , however I don't know if it supports arabic text and I don't know how to use it from my application developed in 9i.
    Regards.

    Friend by using these step you can easily use Oracle inter text media
    j a h a n z e b
    [email protected]
    Oracle Developer
    6th Floor, State Bank of Pakistan
    I.I.Chundrigar Road, Karachi.
    Please note that in SqlPlus you can use '?' in stead of $ORACLE_HOME, and this works on Unix and Windows so if you want to execute $ORACLE_HOME/rdbms/admin/catalog.sql you can simply use:
    on Unix sql> @?/rdbms/admin/catalog.sql
    on Windows sql> @?\rdbms\admin\catalog.sql
    5.2.1 Explanation of installation steps
    1. Connected to database as SYSDBA and create CTXSYS user:
    Ctxsys user is created by calling following script:
    @?/ctx/admin/dr0csys.sql <ctxsys> <system> <temp>
    Where:
    change_on_install - is the ctxsys user password
    DRSYS - is the default tablespace for ctxsys
    TEMP - is the temporary tablespace for ctxsys
    This will create user CTXSYS and grants full privileges to CTXSYS in order to create and insert into result tables, execute callbacks, rewrite queries, and perform system cleanup. At this point CTXSYS will not own any objects.ss
    2. Connected to database as CTXSYS and create all necessary objects
    All necessary object are creates by calling following script:
    connect CTXSYS/change_on_install
    @?/ctx/admin/dr0inst <replace with $ORACLE_HOME>/ctx/lib/libctxx9.so;
    Please not that you have to put full path to your ORACLE_HOME, for example home as paramter
    On Solaris/Aix/Linux with $ORACLE_HOME of /u01/app/oracle/product/8.1.7
    @?/ctx/admin/dr0inst.sql /u01/app/oracle/product/8.1.7/ctx/lib/libctxx8.so
    On HP-UX with $ORACLE_HOME of /u01/app/oracle/product/8.1.7
    @?/ctx/admin/dr0inst.sql /u01/app/oracle/product/8.1.7/ctx/lib/libctxx8.sl
    Windows NT/2000 with D:\oracle\product\8.1.7
    @?/ctx/admin/dr0inst.sql D:\oracle\product\8.1.7\bin\oractxx8.dll
    This will installs all Oracle database objects required by the Oracle Text system. This includes:
    a) Data dictionary tables, views, sequence, packages
    b) Server management tables, views and packages
    c) Dispatcher packages
    d) Service queue objects
    3) Install appropriate language-specific default preferences.
    The next step is to install appropriate language-specific default preferences.When you use CREATE INDEX to create an index or ALTER INDEX to manage an index, you can optionally specify indexing preferences in the parameter string. There are seven preference classes:
    - Lexer, defines the language being indexed. ( language specific )
    - Wordlist, defines the expantion of stem and fuzzy queries. ( language specific )
    - Stoplist, defines words and themes that are not be indexed. ( language specific )
    - Datastore, defines document storage.
    - Filter, defines standards for converion of documents to plaintext.
    - Storage, defines the storage of the index tables.
    - Section group, enables possibilities to define document sections.
    There is script which creates language-specific default preferences for every language Oracle text supports in <ORACLE_HOME>/ctx/admin/defaults directory, such as English(US), Danish(DK), Dutch(NL), Finnish(SF), French(FR), German(DE), Italian(IT), Portuguese(PR), Spanish(ES), and Swedish(S). They are named in the form drdefXX.sql, where XX is the language code. To manually install US default preferences, for example, log into sqlplus as CTXSYS, and run 'drdefus.sql' as described below:
    @?/ctx/admin/defaults/drdefus.sql
    create user textuser identified by textuser
    default tablespace users
    temporary tablespace temp;
    -- You must grant 'ctxapp' role to textuser
    grant connect, resource, ctxapp to textuser;
    connect textuser/textuser
    drop table quick;
    create table quick (
    quick_id number
    constraint quick_pk primary key,
    text varchar2(80) );
    insert into quick ( quick_id, text ) values (1,'The cat sat on the mat');
    insert into quick ( quick_id, text ) values (2,'The quick brown fox jumps over the lazy dog' );
    insert into quick ( quick_id, text ) values (3,'The dog barked like a dog');
    commit;
    create index quick_text on quick ( text )
    indextype is ctxsys.context;
    col text format a45
    col s format 999
    select text, score(42) s from quick
    where contains ( text, 'dog', 42 ) > 0
    order by s desc;

  • How to use Oracle Spatial in this scenario

    My scenario is like that:
    I'm very new to Oracle Spatial
    I'm building an application that will be based on asp.net.(I am
    confident about .net)
    As per my client requirement there are some kml file in one archive
    folder.
    Let me give an example:
    say there is a kml file for region A.(latitude say 36 n to 40 n and
    longitude is 110 w to 115 w) already in the archive folder.
    Now if a new kml file(say A1.kml) that has been created by the user
    and say its latitude and longitude are respectively 37n and 112w. As we clicked A.kml, google earth is opened up for the region A and as
    we move our mouse cursor to more deeper more polygons are visible.
    eventually polygon for A1.kml is also visible and definitely which is
    inside the polygon for region A.
    How can I achieve this thing by using oracle spatial 10g? ---(it's one of my senior's advice to use "oracle spatial 10g" in this scenario)
    I'm not too sure whether I can able to make it clear to u about my
    situation; plz xcuse me if I'm wasting ur valuable time.

    Hi,
    This link helped me a lot!
    http://www.oracle.com/technology/pub/articles/rubio-mashup.html
    Hope it could help you too.
    Best regards,
    Luiz

  • [Solved] How to use Oracle Java 6 for specific applications

    I use an IDE called PyCharm. On its download page, it recommends using Java 6 instead of OpenJDK. I currently have jdk7-openjdk installed, and from what I had read in the Arch Wiki on Java, it should be possible to install Oracle Java 6 along side OpenJDK 7.
    However, after installing jdk6-compat and jre6-compat, I still see that I am running OpenJDK 7 when I run the following:
    % java -version
    java version "1.7.0_09"
    OpenJDK Runtime Environment (IcedTea7 2.3.3) (ArchLinux build 7.u9_2.3.3-1-x86_64)
    OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
    ...even after I have set JAVA_HOME and added /opt/java6/bin to my path.
    How can I get PyCharm (or other applications) to use Oracle Java 6 instead of OpenJDK?
    Thanks, and apologies if I've posted in the wrong place.
    Other information that might be helpful:
    Running zsh as default shell
    Using Gnome 3 as DE
    Last edited by Nikorasu (2012-11-17 20:54:33)

    I found the solution.
    For Pycharm, I just needed to add an environment variable PYCHARM_JDK. For running specific applications, I asked this question on the Unix / Linux StackExchange and got an answer there.
    Also, after running PyCharm in Java 6... I would not recommend it. OpenJDK works fine
    Last edited by Nikorasu (2012-11-17 20:55:01)

  • How to use oracle.sql.* package?(in nls_charset12.zip)

    is there anyone could tell me how to use the method in this package? for i want to convert a character set from the database (solaris)default character set to the client(win2000) while storing data into ResultSet.
    or anyway that could chnage it would be appricate.
    thanks in advice,

    Hello Gaurav,
    First off, not sure why you are calling
    call.addNamedArgument("JOB_ID", "JOB_ID_I");
    call.addNamedArgumentValue("JOB_ID", jobId);
    You should call the first statement to indicate you will be adding in a "JOB_ID_I" argument to the query, or the second statement to add the value directly to the call, but not both. Calling both indicates your procedure is expecting two parameters called "JOB_ID" and you will get an exception if you do not define the "JOB_ID_I" argument on the query and pass in a parameter for it.
    TopLink does not currently create Oracle objects such as Structs and VARRAYs for you from java objects - atleast not for stored procedures arguments, as it does not know how or what to convert them to. You will need to create the Oracle object type yourself, and pass it into the query. I have not tested it, but it would look something like:
    UnitOfWork unitOfWork = getUnitOfWork();
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("DSM_JOB_PKG.INSERT_JOB_RUN_LOG");
    String jobId = jobIdItr.next().toString();
    call.addNamedArgumentValue("JOB_ID_I", jobId);
    Timestamp sysdate = BeanConvertUtil.getCurrentTimestamp();
    call.addNamedArgumentValue("ORDER_DATE_I", sysdate);
    call.addNamedArgumentValue("USER_ID_I", userId);
    Connection con = getSession().getAccessor().getConnection();
    oracle.sql.ArrayDescriptor anArrayDescriptor = new oracle.sql.ArrayDescriptor("GENERIC_STRING_TYPE",con);
    oracle.sql.ARRAY anARRAYin = new ARRAY(anArrayDescriptor, con, paramTypeIds );
    call.addNamedArgumentValue("JOB_PARAM_TYPE_IDS_I", anARRAYin );
    oracle.sql.ARRAY anARRAYin2 = new ARRAY(anArrayDescriptor, con, paramValues);
    call.addNamedArgumentValue("JOB_PARAM_VALUES_I", anARRAYin2 );
    session.executeSelectingCall(call);

  • How to use oracle thin driver?...pls help

    Hello. I am trying to insert a word file into my Oracle 9i database using JSP. I have tomcat running as my standalone server. So far, i have been using the sun.jdbc.odbc driver to implement all my DB accesses. Recently however, i found out that in order to use Oracle specific objects such as BLOBS or BFILES, i have to use the oracle thin driver or OCI driver.
    So far, i have downloaded the thin driver and put it into the tomcat shared/common folder and also put the .jar file into my classpath. Now, i am having trouble as to how to call the oracle thin driver inside my JSP code.
    My previous code read as:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:Andy","user","pass");
    How do i switch over to the oracle thin driver in JSP? Any help would be much appreciated. Thank you
    Andrew

    Class.forName ("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@hostname:port:SSID", "user", "password");

  • How to use Oracle Direct Connector for HDFS(DCH)?

    hi all,
    I am trying to use Oracle database to access HDFS through DCH. Now I installed Oracle database 11.2, hadoop-0.20.2 and DCH on the same linux machine.
    I also configured hdfs_stream properly and created Oracle directory HDFS_BIN_PATH according to README.txt file within DCH.
    Now I encountered a problem, how I create a external table which access data residing on HDFS?
    Can anyone help me ?
    Thanks in advance.
    Chopsun
    Edited by: user1745344 on 2012-5-21 下午11:30

    I figure out the way which access HDFS data from Oracle External Table through DCH as below, but still face some problems
    Step 1
    Created Oracle directories as following:
    CREATE OR REPLACE DIRECTORY hdfs_bin_path AS '/home/oracle/orahdfs/bin';
    CREATE OR REPLACE DIRECTORY data_dir AS '/user/hadoop';
    where /user/hadoop is HDFS directory in which data file test.txt located.
    Step 2
    Created Oracle external table as following:
    create table xqs_ext_test(col1 varchar2(100))
    organization external (
    TYPE oracle_loader
    DEFAULT DIRECTORY data_dir
    ACCESS PARAMETERS (
    records delimited by newline
    preprocessor hdfs_bin_path:'hdfs_stream'
    badfile hdfs_bin_path:'empxt%a_%p.bad'
    logfile hdfs_bin_path:'empxt%a_%p.log'
    fields terminated by ','
    LOCATION ('test.txt'))
    reject limit unlimited
    parallel 2;
    when run SQL statement : select * from xqs_ext_test; the following error was prompted:
    SELECT * FROM xqs_ext_test
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file test.txt in DATA_DIR not found
    who can help me out with this problem?
    Best Regards
    Chopsun
    Edited by: user1745344 on 2012-5-22 上午1:02

  • How to use oracle Bean

    Hi All,
    I am currently customize oracle form in Form Builder i just wanna use oracle functionality of oracle form which enable column position changes how can i use this functionality please advice.
    Thanks
    Edited by: 877432 on Dec 23, 2012 10:07 PM

    Please review link how to use custom form in oracle EBS
    http://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T458265.htm
    MOS note:
    Customization in Oracle Applications [ID 743490.1]
    thanks

Maybe you are looking for

  • Exporting sounds in Pages document to PC users

    Is it possible to export a Pages document with sound clips embedded, to a PC user? I tried exporting as a PDF but even when I opened this on my iMac with Preview or Adobe Reader, the sound clip icon was missing. I exported as a Word document (which c

  • HR ABAP: Selecton-screen

    I am new to HR ABAP. I am using PNP LDB and managed to supress all the LDB selections except Company Code & PERNR using Report category. But now, 1. how do I know what are the names of these fields on selection screen 2. how do i default 1000 for buk

  • Generate !DOCTYPE in outbound http

    Hello, What is the best way to generate a !DOCTYPE tag in an outbound message? Is there a doc or thread that describes how to do this? I've read about XSL and java mapping for this but was wondering if there maybe was another way. Isn't it possible t

  • HT1414 when i plug my iphone into itunes its not responding or connecting, how do i resolve this issue?

    im having problems with my iphones connecting to itunes. ive just upgraded from 4s to 5s and wanted to back it up before using it. but when i plug it in its just not responding, as usually when u plug in it it starts loading. ive tried installing itu

  • Select data from another database

    Hi, Is it possible to retrieve data from a table from another database? For instance, I have two databases db_1 and db_2 I login to the database db_1 using sqlplus username/psw@db1 and to the database db_2 using sqlplus username/psw@db2 In SQL> db1 I