Embedding SQL*LOADER within Pro-C

Hello,
I have searched this forum, and I cannot find any supporting evidence that embedding SQLLOADER functionality within a Pro-C application to manage a permanent Oracle table is possible. The only similar methodology that I can identify is to define "External" tables using the "Organize External" directive.
I am using Oracle 9i with Pro-C version 9.2.0.7.0. Unless I have missed something, I will proceed with either a system call-out to SQLLOADER, or create a segment which will mimic the intended actions of "read flatfile data/format data/Insert into Table".
Any constructive assistance would be appreciated.
Thank You

I issued FULL DB EXPORT / IMPORT privilege to the related Oracle user account and it works now.

Similar Messages

  • PRO*C에서 EMBEDDED SQL STATEMENTS를 사용해서 LOB DATATYPES에 접근하는 예제

    제품 : PRECOMPILERS
    작성날짜 : 2001-07-12
    PRO*C에서 EMBEDDED SQL STATEMENTS를 사용해서 LOB DATATYPES에 접근하는 예제
    ==========================================================================
    Pro*C에서 LOB를 사용하는 방법에는 다음 3가지가 있습니다.
    (1) PL/SQL blocks에서 DBMS_LOB package를 이용하는 방법
    (2) OCI function을 이용하는 방법
    (3) Embedded SQL statements을 이용하는 방법
    다음은 (3)번째 방법에 대한 pro*c에서 지원하는 명령어들입니다.
    o APPEND: Appends lob value at the end of another LOB.
    EXEC SQL LOB APPEND :src TO :dst;
    o ASSIGN: Assigns LOB or BFILE locator to another.
    EXEC SQL LOB ASSIGN :src TO :dst;
    o CLOSE: Close LOB or BFILE.
    EXEC SQL LOB CLOSE :src;
    o COPY: Copy all or part of LOB value into another LOB.
    EXEC SQL LOB COPY :amt FROM :src [AT :src_offset] TO :dst [AT dst_offset];
    o CREATE TEMPORARY: Creates a temporary LOB.
    EXEC SQL LOB CREATE TEMPORARY :src;
    o ERASE: Erase the given amount of LOB data starting from a given offset.
    EXEC SQL LOB ERASE :amt FROM :src [AT :src_offset];
    o FILE CLOSE ALL: Closes all the BFILES open in the current session.
    EXEC SQL LOB FILE CLOSE ALL;
    o FILE SET: Set DIRECTORY alias and FILENAME in a BFILE locator.
    EXEC SQL LOB FILE SET :file DIRECTORY = :alias, FILENAME = :filename;
    o FREE TEMPORARY: Free the temporary space for the LOB locator.
    EXEC SQL LOB FREE TEMPORARY :src
    o LOAD FROM FILE: Copy all or part of BFIL into an internal LOB.
    EXEC SQL LOB LOAD :amt FROM FILE :file [AT :src_offset]
    INTO :dst [AT :dst_offset];
    o OPEN: Open a LOB or BFILE for read or read/write.
    EXEC SQL LOB OPEN :src [ READ ONLY | READ WRITE ];
    o READ: Reads all or part of LOB or BFILE into a buffer.
    EXEC SQL LOB READ :amt FROM :src [AT :src_offset]
    INTO :buffer [WITH LENGTH :buffer];
    o TRIM: Truncates the LOB vlaue.
    EXEC SQL LOB TRIM :src to :newlen;
    o WRITE: Writes contents of the buffer to a LOB.
    EXEC SQL LOB WRITE [APPEND] [FIRST | NEXT | LAST | ONE ]
    :amt FROM :buffer [WITH LENGTH :buflen] INTO :dst [AT :dst_offset];
    o DESCRIBE: Retrieves the attributes from a LOB.
    EXEC SQL LOB DESCRIBE :src GET attribute1 [{, attributeN}]
    INTO :hv1 [[INDICATOR] :hv_ind1] [{, :hvN [[INDICATOR] :hv_indN] }];
    Attributes can be any of the following:
    CHUNKSIZE: chunk size used to store the LOB value
    DIRECTORY: name of the DIRECTORY alias for BFILE
    FILEEXISTS: whether BFILE exists or not
    FILENAME: BFILE name
    ISOPEN: whether BFILE with this locate is OPEN or not
    ISTEMPORARY: whether specified LOB is temporary or not
    LENGTH: Length of BLOBs and BFILE in bytes, CLOBs and NCLOBs
    in characters.
    다음은 LOB를 사용하는 sample을 실행하는 방법입니다.
    1. 먼저 scott user에서 다음을 실행합니다. (create directory를 할 수 있는 권한이
    있어야 하며, directory는 사용하시는 환경에 맞도록 수정해 주십시요.)
    drop table lob_table;
    create table lob_table (key number, a_blob BLOB, a_clob CLOB);
    drop table lobdemo;
    create table lobdemo (key number, a_blob BLOB, a_bfile BFILE);
    drop directory dir_alias;
    create directory dir_alias as '/users/app/oracle/product/8.1.7/precomp/demo/proc';
    insert into lob_table values(1, utl_raw.cast_to_raw('1111111111'), 'aaaaaaaa');
    commit;
    2. 다음 코드는 out.gif 파일을 위에서 지정한 directory에 만들고 lob_table의
    내용에 들어있는 BLOB의 내용을 저장하는 sample입니다.
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <sqlda.h>
    #include <sqlcpr.h>
    /* Define constants for VARCHAR lengths. */
    #define UNAME_LEN 20
    #define PWD_LEN 40
    /* Declare variables. No declare section is
    needed if MODE=ORACLE. */
    VARCHAR username[UNAME_LEN]; /* VARCHAR is an Oracle-supplied struct */
    varchar password[PWD_LEN]; /* varchar can be in lower case also. */
    /* The following 3 lines avoid inclusion of oci.h during precompilation
    oci.h is needed only during compilation to resolve calls generated by
    the precompiler
    #ifndef ORA_PROC
    #include <oci.h>
    #endif
    #include <sqlca.h>
    OCIBlobLocator *blob;
    OCIClobLocator *clob;
    FILE *fp;
    unsigned int amt, offset = 1;
    #define MAXBUFLEN 5000
    unsigned char buffer[MAXBUFLEN];
    EXEC SQL VAR buffer IS RAW(MAXBUFLEN);
    /* Declare error handling function. */
    void sql_error(msg)
    char *msg;
    char err_msg[128];
    size_t buf_len, msg_len;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    printf("\n%s\n", msg);
    buf_len = sizeof (err_msg);
    sqlglm(err_msg, &buf_len, &msg_len);
    printf("%.*s\n", msg_len, err_msg);
    EXEC SQL ROLLBACK RELEASE;
    exit(EXIT_FAILURE);
    void main()
    /* Connect to ORACLE--
    * Copy the username into the VARCHAR.
    strncpy((char *) username.arr, "SCOTT", UNAME_LEN);
    /* Set the length component of the VARCHAR. */
    username.len =
    (unsigned short) strlen((char *) username.arr);
    /* Copy the password. */
    strncpy((char *) password.arr, "TIGER", PWD_LEN);
    password.len =
    (unsigned short) strlen((char *) password.arr);
    /* Register sql_error() as the error handler. */
    EXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE error--\n");
    /* Connect to ORACLE. Program will call sql_error()
    * if an error occurs when connecting to the default database.
    EXEC SQL CONNECT :username IDENTIFIED BY :password;
    printf("\nConnected to ORACLE as user: %s\n", username.arr);
    /* Allocate the LOB host variables and select the BLOB value */
    EXEC SQL ALLOCATE :blob;
    EXEC SQL ALLOCATE :clob;
    EXEC SQL SELECT a_blob INTO :blob FROM lob_table WHERE key=1;
    /* Open external file to which BLOB value should be written */
    fp = fopen("out.gif", "w");
    EXEC SQL WHENEVER NOT FOUND GOTO end_of_lob;
    amt = 5000;
    EXEC SQL LOB READ :amt FROM :blob AT :offset INTO :buffer;
    fwrite(buffer, MAXBUFLEN, 1, fp);
    EXEC SQL WHENEVER NOT FOUND DO break;
    /* Use polling method to continue reading the next pieces */
    while (TRUE)
    EXEC SQL LOB READ :amt FROM :blob INTO :buffer;
    fwrite(buffer, MAXBUFLEN, 1, fp);
    end_of_lob:
    fwrite(buffer, amt, 1, fp);
    printf("\nG'day.\n\n\n");
    /* Disconnect from ORACLE. */
    EXEC SQL ROLLBACK WORK RELEASE;
    exit(EXIT_SUCCESS);
    3. 다음 코드는 위에서 만든 out.gif file을 lobdemo에 저장하는 sample입니다.
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <sqlda.h>
    #include <sqlcpr.h>
    /* Define constants for VARCHAR lengths. */
    #define UNAME_LEN 20
    #define PWD_LEN 40
    /* Declare variables. No declare section is
    needed if MODE=ORACLE. */
    VARCHAR username[UNAME_LEN]; /* VARCHAR is an Oracle-supplied struct */
    varchar password[PWD_LEN]; /* varchar can be in lower case also. */
    /* The following 3 lines avoid inclusion of oci.h during precompilation
    oci.h is needed only during compilation to resolve call generated by
    the precompiler
    #ifndef ORA_PROC
    #include <oci.h>
    #endif
    #include <sqlca.h>
    OCIBlobLocator *blob;
    OCIBFileLocator *bfile;
    char *alias = "DIR_ALIAS";
    char *filename = "out.gif";
    unsigned int amt = 50;
    unsigned int filelen;
    /* Declare error handling function. */
    void sql_error(msg)
    char *msg;
    char err_msg[128];
    size_t buf_len, msg_len;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    printf("\n%s\n", msg);
    buf_len = sizeof (err_msg);
    sqlglm(err_msg, &buf_len, &msg_len);
    printf("%.*s\n", msg_len, err_msg);
    EXEC SQL ROLLBACK RELEASE;
    exit(EXIT_FAILURE);
    void main()
    /* Connect to ORACLE--
    * Copy the username into the VARCHAR.
    strncpy((char *) username.arr, "SCOTT", UNAME_LEN);
    /* Set the length component of the VARCHAR. */
    username.len =
    (unsigned short) strlen((char *) username.arr);
    /* Copy the password. */
    strncpy((char *) password.arr, "TIGER", PWD_LEN);
    password.len =
    (unsigned short) strlen((char *) password.arr);
    /* Register sql_error() as the error handler. */
    EXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE error--\n");
    /* Connect to ORACLE. Program will call sql_error()
    * if an error occurs when connecting to the default database.
    EXEC SQL CONNECT :username IDENTIFIED BY :password;
    printf("\nConnected to ORACLE as user: %s\n", username.arr);
    /* Allocate the LOB locator */
    EXEC SQL ALLOCATE :blob;
    EXEC SQL ALLOCATE :bfile;
    /* Initialize the DIRECTORY alias of the BFILE and FILENAME */
    EXEC SQL LOB FILE SET :bfile
    DIRECTORY = :alias, FILENAME = :filename;
    EXEC SQL INSERT INTO lobdemo values (1, EMPTY_BLOB(), :bfile);
    EXEC SQL SELECT a_blob, a_bfile INTO :blob, :bfile FROM lobdemo
    WHERE key = 1;
    EXEC SQL LOB OPEN :bfile;
    /* Get the BFILE length */
    EXEC SQL LOB DESCRIBE :bfile
    GET LENGTH INTO :filelen;
    printf("File length is: %d\n", filelen);
    amt = filelen;
    /* Read BFILE and write to BLOB */
    EXEC SQL LOB LOAD :amt FROM FILE :bfile INTO :blob;
    EXEC SQL LOB CLOSE :bfile;
    printf("\nG'day.\n\n\n");
    /* Disconnect from ORACLE. */
    EXEC SQL COMMIT WORK RELEASE;
    exit(EXIT_SUCCESS);
    4. 다음은 실행한 결과 입니다.
    첫번째 sample :
    Connected to ORACLE as user: SCOTT
    G'day.
    두번째 sample :
    Connected to ORACLE as user: SCOTT
    File length is: 10
    G'day.

  • Compiling embedded SQL into a Win32 program using PRO*C/C++

    Hello,
    I have desperately been trying to precompile a Win32(C++) including embedded SQL with the pro*c editor. When I try to build my project I get linker errors telling me that sqliem was already declared in sqlcpr.h (which it wasn't). And I only seem to get these errors when I try to declare external variables or files in my program.
    Any help would be greatly appreciated.
    THANKS!!

    Hi,
    I hadn't got errors.
    Bit, i solved my problem using dynamic sql.
    exemple:
    void function(char name[50]){
    EXEC SQL BEGIN DECLARE SECTION;
    char *varsql;
    EXEC SQL END DECLARE SECTION;
    char toto[150]="CREATE TABLE test AS SELECT * FROM tutu WHERE employe='";
    varsql=strcat(toto,name);
    strcat(varsql,"'");
    EXEC SQL EXECUTE IMMEDIATE :varsql;
    I hope that could help somebody.
    Bye and thank you for your answer.
    Edited by: 899981 on 20 déc. 2011 05:28

  • SQL Loader and APEX

    Is it possible to use the SQL Loader within APEX? I want to have a table updated from a csv file... normally I would use the WWV_FLOW_FILES table, but with this file it mixes tabs and commas within the data, so creating a reliable upload script is getting to be a complete nightmare. I'd like to leverage the sql loader so I can specify the delimiter, optional quotes etc. The file will be in the same location on the file system so a scheduled, automated process would be perfect.
    If so, does anyone know of a tutorial that might help me out?

    I really hate computers. I do. I should know by now that it would of course install properly once support is engaged.
    It installed properly just now. I was installing to get the error message to send to you. No changes were made yesterday, it's the same schema, same options for installing. I didn't restart any services or reboot the server.
    It just works now.
    I've been working with computers since 1982 and their capacity for knowing when support people are around continues to astonish me.
    I am getting 'no data found' but I was really only installing it to get the error message, so I may have skipped a step.
    Thanks all for the prompt replies.

  • Migration of embedded SQL's in PowerBuilder appn

    Hi all,
    Well I am relatively new to PowerBuilder and we are trying to establish a PoC on migrating a large Powerbuilder Application with a Sybase database to an Oracle Database. Specifically, I am looking for more info on the migration of the embedded SQL's within the PB codes.
    Is there an established methodology for the same?
    Currenlt , I am accomplishing the same by extracting the PBL codes into .srd and .srw files and then running tools to convert the embedded SQL's in them. Could anyone elaborate on the presence/absence of embedded SQL's in these file types? And regarding the migration, does Oracle provide any assistance?
    Or are there any open source tools to accomplish the same???
    Looking forward to some asssistance from the OTn community!

    I've seen several attempts at tools over the years to migrate PB to something else, but nothing like what you are looking for.
    In SQL Developer 3.0, we have added an application scanner which identifies specific database calls or third party calls to the database. Right now, we only support CTLIB and DBLIB but there is no reason why you could not write rules to identify what you need. I take it from you message, that you are only changing the SQL, and if that is teh case, then the rule set would be very compact. We have plans to allow users to call the scratch editor for SQL translations at some point, but those features are just planned at the moment.
    If you are proceeding manually, you can use SQL Developer 3.0 to help you convert the syntax and replace it in the code.
    Thanks
    B

  • Can window and aggregate SQL functions used in Pro*C embedded SQL?

    It appears that the window functions such as dense_rank() over(partition by ... order by ...) are not available in Pro*C embedded SQL. Can somebody please confirm that that is really the case?
    Thanks
    Rawender Guron

    Please refer to this thread: "Is this forum also used for Pro*'C Questions? "
    Is this forum also used for Pro*'C Questions?

  • Use of Pro*C with embedded SQL

    Is it possible to reuse existing Pro*C with embedded SQL written for an Oracle 9i database on an Oracle Lite running on Windows CE/PocketPC plattform? Wich steps and tools are required to transform (compile, precompile) this code?
    Can the functionality then be easily accessed from java code?
    Thanks in advanced!

    Oracle already did. Pradeep is an Oracle developer working in Oracle9i Lite group. This is this Product Manager speaking

  • Can window and aggregate SQL functions be used in Pro*C embedded SQL?

    It appears that window functions such as dense_rank() over(partition by ... order by ...) can not be used in Pro*C embedded SQL? Can somebody confirm that that is really the case?
    Thanks
    Rawender Guron

    Please refer to this thread: "Is this forum also used for Pro*'C Questions? "
    Is this forum also used for Pro*'C Questions?

  • Executing code within a SQL*LOADER session for RLS

    We are using RLS, and have a need to load some data using sql*loader. More specifically, we need to do the following:
    set the context (sys_context)
    load the data, using sys_context('xxx','xxx') in the data.
    This would require the execution of a package procedure within the session that loads the data. I do not know if this is possible using sql*loader.
    I have a workaround; creating a load user and creating a login trigger that calls the package procedure. This is not a very elegant solution for us and we would like to perform the procedure call within sql*loader.
    We are running Oracle 10g release 1 on linux.
    Thank you in advance.

    Ok -
    I have figured out how to do this, although it is somewhat inefficent. I am populating a table that contains carrier information: British Airways for example. The table is similar to the following:
    carrier_id number(35)
    carrier_code varchar2(3)
    carrier_name varchar2(30)
    modification_date date
    There is a unique id, called a site_id, assigned to each site in our streams environment. The primary key, carrier_id, is built using this ID.
    I have a function that will set the context, and then use sys_context to get the value of the siteid. I also have a function that will get the site_id from a table using the global name. Finding the site_id using these functions and inserting it through sql loader is just a matter of putting the following in the controlfile:
    carrier_id "get_siteid||:carrier_id"
    where carrier_id is a number from 1-n where n is the number of carriers.
    If you have a more elegant way of doing this, please let me know.
    Jamie McLaughlin

  • SQL Loader - double quote within data

    Hi,
    I'm putting together some SQL loader scripts to load source data into a DB. The data we are receiving is comma delimited, optionally enclosed by double quotes (").
    e.g. "abc","123","this is a "test"","987"
    The problem I've got is that some data items contain double quotes ("test") as part of the data and this cause the SQL Loader to fall over with the error:
    Record 14644: Rejected - Error on table x, column y.
    no terminator found after TERMINATED and ENCLOSED field
    Is it possible to load this without changing the extraction process from the source system?
    My .ctl file looks like this:
    LOAD DATA
         INFILE '../data/toload/BR_ADDRESS.CSV'
         APPEND INTO TABLE STA_COMP_BRADD
         FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
         etc....
    Message was edited by:
    MaximumStagg

    Hi,
    Look in to this in Oracle documentation:
    "If two delimiter characters are encountered next to each other, a single occurrence of the delimiter character is used in the data value. For example, 'DON''T' is stored as DON'T. However, if the field consists of just two delimiter characters, its value is null."
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm
    Thanks,
    Kishore

  • Loading from text file using Sql Loader

    I need to load data from a text file into Oracle table. The file has long strings of text in the following format:
    12342||||||Lots and lots of text with all kinds of characters including
    ^&*!#%#^@ etc.xxxxxxxxxxxxxxxxxxxxxxx
    yyyyyyyyyyyyyyyyyyyyyyyyytrrrrrrrrrrrrrrrrrrr
    uuuuuuuuuuuuuuuuuuurtgggggggggggggggg.||||||||
    45356|||||||||||again lots and lots of text.uuuuuudccccccccccccccccccccd
    gyhjjjjjjjjjjjjjjjjjjjjjjjjkkkkkkkkkkkkklllllllllllnmmmmmmmmmmmmnaaa|||||||.
    There are pipes within the text as well. On the above example, the line starting with 12342 is an entire record that needs to be loaded into a CLOB column. The next record would be the 45356 one. Therefore, all records have a bunch of pipes at the end, so the only way to know where a new record starts is to see where the next number is after all the ending pipes. The only other thing I know is that there are a fixed number of pipes in each record.
    Does anyone have any ideas on how I can load the data into the table either using sql loader or any other utility? Any input would be greatly appreciated. Thanks.

    STFF [url http://forums.oracle.com/forums/thread.jspa?messageID=1773678&#1764219]Sqlldr processing of records with embedded newline and delimiter

  • Invokin SQL*Loader from a stored procedure

    I try to invoke SQL*LOADER from within a database package by using external C procedure (the procedure calls the system() C function) but the loader generates the following error in its log file :
    SQL*Loader -523: error -2 writing to file (STDERR)
    and no data is uploaded.
    I have tried to use system() from within database procedures to execute OS commands and it works. Does anyone know what is the problem with using system() to execute "sqlldr <parameters>"? Is there some other way to call the loader from within a stored PL/SQL procedure?
    Thank you very much for your help.
    Aneta Valova
    null

    Hi
    What is your task and why you are trying to invoke SQL*Loader from strorage procedure or package? Maybe the redirecting of stderr will resolve your problem but thik is it the best way to do your job.
    I am not sure, that invoking other executables from Oracle instance is good idea.
    Regards
    null

  • Problem with SQL*Loader and different date formats in the same file

    DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    System: AIX 5.3.0.0
    Hello,
    I'm using SQL*Loader to import semi-colon separated values into a table. The files are delivered to us by a data provider who concatenates data from different sources and this results in us having different date formats within the same file. For example:
    ...;2010-12-31;22/11/1932;...
    I load this data using the following lines in the control file:
    EXECUTIONDATE1     TIMESTAMP     NULLIF EXECUTIONDATE1=BLANKS     "TO_DATE(:EXECUTIONDATE1, 'YYYY-MM-DD')",
    DELDOB          TIMESTAMP     NULLIF DELDOB=BLANKS          "TO_DATE(:DELDOB, 'DD/MM/YYYY')",
    The relevant NLS parameters:
    NLS_LANGUAGE=FRENCH
    NLS_DATE_FORMAT=DD/MM/RR
    NLS_DATE_LANGUAGE=FRENCH
    If I load this file as is the values loaded into the table are 31 dec 2010 and 22 nov *2032*, aven though the years are on 4 digits. If I change the NLS_DATE_FORMAT to DD/MM/YYYY then the second date value will be loaded correctly, but the first value will be loaded as 31 dec *2020* !!
    How can I get both date values to load correctly?
    Thanks!
    Sylvain

    This is very strange, after running a few tests I realized that if the year is 19XX then it will get loaded as 2019, and if it is 20XX then it will be 2020. I'm guessing it may have something to do with certain env variables that aren't set up properly because I'm fairly sure my SQL*Loader control file is correct... I'll run more tests :-(

  • ORA-12899 error from function invoked from SQL*Loader

    I am getting the above error when I call a function from my SQL*Loader script, and I am not seeing what the problem is. As far as I can see, there should be no problem with the field lengths, unless the length of the automatic variable within my function is somehow being set at 30? Here are the details (in the SQL*Loader script, the field of interest is the last one):
    ====
    Error:
    ====
    Record 1: Rejected - Error on table TESTM8.LET_DRIVE_IN_FCLTY, column DIF_CSA_ID.
    ORA-12899: value too large for column "TESTM8"."LET_DRIVE_IN_FCLTY"."DIF_CSA_ID" (actual: 30, maximum: 16)
    =======
    Function:
    =======
    CREATE OR REPLACE FUNCTION find_MCO_id (di_oid_in DECIMAL)
    RETURN CHAR IS mco_id CHAR;
    BEGIN
    SELECT AOL_MCO_LOC_CD INTO mco_id
    FROM CONV_DI_FLCTY
    WHERE DIF_INST_ELMNT_OID = di_oid_in;
    RETURN TRIM(mco_id);
    END;
    ==============
    SQL*Loader Script:
    ==============
    LOAD DATA
    INFILE 'LET_DRIVE_IN_FCLTY.TXT'
    BADFILE 'LOGS\LET_DRIVE_IN_FCLTY_BADDATA.TXT'
    DISCARDFILE 'LOGS\LET_DRIVE_IN_FCLTY_DISCARDDATA.TXT'
    REPLACE
    INTO TABLE TESTM8.LET_DRIVE_IN_FCLTY
    FIELDS TERMINATED BY '~' OPTIONALLY ENCLOSED BY '"'
    DIF_DRIVE_IN_OID DECIMAL EXTERNAL,
    DIF_FCLTY_TYPE_OID DECIMAL EXTERNAL NULLIF DIF_FCLTY_TYPE_OID = 'NULL',
    DIF_INST_ELMNT_OID DECIMAL EXTERNAL,
    DIF_PRI_PERSON_OID DECIMAL EXTERNAL NULLIF DIF_PRI_PERSON_OID = 'NULL',
    DIF_SEC_PERSON_OID DECIMAL EXTERNAL NULLIF DIF_SEC_PERSON_OID = 'NULL',
    DIF_CREATE_TS TIMESTAMP "yyyy-mm-dd-hh24.mi.ss.ff6",
    DIF_LAST_UPDATE_TS TIMESTAMP "yyyy-mm-dd-hh24.mi.ss.ff6",
    DIF_ADP_ID CHAR NULLIF DIF_ADP_ID = 'NULL',
    DIF_CAT_CLAIMS_IND CHAR,
    DIF_CAT_DIF_IND CHAR,
    DIF_DAYLT_SAVE_IND CHAR,
    DIF_OPEN_PT_TM_IND CHAR,
    DIF_CSA_ID CONSTANT "find_MCO_id(:DIF_DRIVE_IN_OID)"
    ============
    Table Definitions:
    ============
    SQL> describe CONV_DI_FLCTY;
    Name Null? Type
    DIF_INST_ELMNT_OID NOT NULL NUMBER(18)
    AOL_MCO_LOC_CD NOT NULL VARCHAR2(3)
    SQL> describe LET_DRIVE_IN_FCLTY;
    Name Null? Type
    DIF_DRIVE_IN_OID NOT NULL NUMBER(18)
    DIF_INST_ELMNT_OID NOT NULL NUMBER(18)
    DIF_FCLTY_TYPE_OID NUMBER(18)
    DIF_ADP_ID VARCHAR2(10)
    DIF_CAT_DIF_IND NOT NULL VARCHAR2(1)
    DIF_CAT_CLAIMS_IND NOT NULL VARCHAR2(1)
    DIF_CSA_ID VARCHAR2(16)
    DIF_DAYLT_SAVE_IND NOT NULL VARCHAR2(1)
    DIF_ORG_ENTY_ID VARCHAR2(16)
    DIF_OPEN_PT_TM_IND NOT NULL VARCHAR2(1)
    DIF_CREATE_TS NOT NULL DATE
    DIF_LAST_UPDATE_TS NOT NULL DATE
    DIF_ITM_FCL_MKT_ID NUMBER(18)
    DIF_PRI_PERSON_OID NUMBER(18)
    DIF_SEC_PERSON_OID NUMBER(18)
    =========================
    Thanks for any help with this one!

    I changed one line of the function to:
    RETURN CHAR IS mco_id VARCHAR2(16);
    But I still get the same error:
    ORA-12899: value too large for column "TESTM8"."LET_DRIVE_IN_FCLTY"."DIF_CSA_ID" (actual: 30, maximum: 16)
    I just am not seeing what is being defined as 30 characters. Any ideas much appreciated!

  • Loading huge file with Sql-Loader from Java

    Hi,
    I have a csv file with aprox. 3 and a half million records.
    I load this data with sqlldr from within java like this:
               String command = "sqlldr userid=" + user + "/" + pass
                        + "@" + service + " control='" + ctlFile + "'";
                System.out.println(command);
                if (System.getProperty("os.name").contains("Windows")) {
                    p = Runtime.getRuntime().exec("cmd /C " + command);
                } else {
                    p = Runtime.getRuntime().exec("sh -c " + command);
                }it does what I want to, load the data to a certain table, BUT it takes too much time, Is there a faster way to load data to an oracle db from within java?
    Thanks, any advice is very welcome

    Have your DBA work on this issue - they can monitor and check performance of SQL*Loader
    SQL*Loader performance tips          [Document 28631.1]
    SQL*LOADER SLOW PERFORMANCE          [Document 1026145.6]
    Master Note for SQL*Loader          [Document 1264730.1]
    HTH
    Srini

Maybe you are looking for