COBOL format into Oracle 11.1.0.6.0

hi
We encountered problem while writing into Oracle 11.1.0.6.0 database from Compressed values through COBOL. The problem occurred for some specific values.
Actual Values:
We encountered while writing amount +2000.000 (to +2007.000) COBOL format into Oracle 11.1.0.6.0 release. Amount written in the database is +2015.167 instead of +2000.000. The same is working fine with Oracle 10.2.0.1.0 release.
os is hpux 11.23
plz suggest.

user511621 wrote:
We encountered problem while writing into Oracle 11.1.0.6.0 database from Compressed values through COBOL. The problem occurred for some specific values.
Actual Values:
We encountered while writing amount +2000.000 (to +2007.000) COBOL format into Oracle 11.1.0.6.0 release. Amount written in the database is +2015.167 instead of +2000.000. The same is working fine with Oracle 10.2.0.1.0 release.
os is hpux 11.23Are you using Pro*Cobol? Has this been updated together with the new Oracle version used? If not, have you looked at the product certification matrix for the Pro*Cobol version you use against the new Oracle version?
As for using a COMP data type - Oracle does not support that as far as I know (it uses its own internal numeric format). You likely use COMP as the native COBOL type and when the OCI call is made to Oracle from COBOL, the COMP value is bound to a SQL bind variable. The data transformation to an Oracle compatible type (something that Oracle can understand) will occur there.

Similar Messages

  • Loading shapefiles into Oracle Spatial

    Fellow Oracle Spatiallers!
    Currently we edit Oracle Spatial data by checking data out into a shapefile,
    making our changes off-line, and reloading the shapefile back into Oracle.
    Instead of using the Oracle Spatial supplied tool, we decided to purchase
    a utility called the "Spatial Loader" from a company called Geometry Pty Ltd
    (http://www.geometryit.com). There are a number of reasons why we decided to
    go that way which might become evident from the command line parameters of
    this utility:
    Usage: Shp2Spt [Arguments] [Options]
    OR
    Usage: Java com.geometryit.spatialloader.oracle.AdvancedJavaSpatialTranslator [Arguments] [Options]
    [Arguments] must specify these values:
    -o create
    type of operation to perform
    create creates a new table, must not exist already
    recreate creates a new table, may exist already
    init drops existing table, creates a new one
    append appends data onto existing table
    -f <shape_file>
    the shape file or project to translate
    -l <table,column>
    target table and column for the geometry data
    -D <database>
    target database name
    -u <username>
    username for RDBMS
    -p <password>
    password for RDBMS
    [Options] values are not necessarily required:
    -s <server_name>
    name of server with database
    -port <port_number>
    the port to connect to on the server
    -ufi <column_name>
    specify the name of the UFI field (unique ID)
    -seq <sequence_name>
    specify the sequence to use for the spatial data unique IDs
    -a none
    attributes mode
    none no attributes will be transferred
    all all attribtues will be transfered as found
    file= file containing lines of the form:
    <shape_attribute><space/tab><rdbms_column>
    where
    <shape_attribute> selects the column to be output
    <rdbms_column> name of the column in RDBMS
    -srid <id>
    specify the Spatial Reference ID for the spatial data
    (this must be set to use Spatial Reference Transformations)
    -i [<level>] or -i rtree
    create an index for the generated table
    the <level> parameter is an optional integer
    representing the depth of the quadtree created
    if rtree is specified, the index created will be
    an rtree
    -c <commit_interval>
    number of rows to commit after
    -t <tolerance>
    tolerance value for metadata
    -r none
    used to determine number of decimal places to round vertices to
    if you use the tolerance-parameter option, specify the -t parameter before -r
    -igc
    ignore geometry collections
    -sgc
    split geometry collections
    -sgd f
    split geometry direction [forward | reverse]
    -update-metadata <true/false>
    update the Oracle Spatial Metadata table after loading data
    -validate <true/false>
    perform Oracle Spatial validation after loading data
    -v
    verbose mode on
    -h or -?
    display this help message
    The main things I like about this tool are:
    1. One step (no conversion to sqlloader form followed by a call to the sqlloader).
    2. The ability to round the coordinates of the shapes in the shapefile by applying
    the XY tolerance values held in the SDO_GEOM_METADATA table.
    This is quite important because our editing package - due to double/single precision
    issues - can actually move coordinates but those movements are sub the precision of
    the actual data. By rounding to the nominate precision we can detect situations where
    no actual change to the shape (and its attributes) was made and thus not create superfluous
    revisions within the database.
    3. It will correctly re-wind the coordinates of the outer/inner shells of polygons. This is
    important as ESRI shapefiles are agnostic on the winding order: an outer shell coordinates
    can be listed in either clockwise or anti-clockwise order.
    4. You can specify the primary key (UFI) column (numeric) and an Oracle Sequence number such
    that each new shape loaded can have its UFI assigned from that sequence.
    Because of this flexibility, and the excellent support (it is a purchasable product) from the
    developers, I can heartily recommend this loader to fellow Spatiallers. It is worth every
    penny I spent on it. Try the free version on their website and if, like me, you like it,
    purchase it!
    regards
    Simon

    Hi Shuan,
    As part of the zip file created for the next training course to be posted for Oracle Spatial on OTN (within the next few weeks) there is a free (unsupported, undocumented) version of a shape to sdo converter. This should work, but it is unsupported. It will create a layer that then needs to be migrated into 8.1.6 format.
    If you need it quite soon send email to [email protected] and I can get it to you.
    Hope this helps,
    dan

  • How can I load string type fielt into oracle table as a date?

    I have a date field in oracle table(target) and my source is ms sql server. In my source table I have string type field include date data like '20150501'. I wanna load that data into oracle as a date field. In my target table this field type is date. But I cant load that data. It seems empty.I use convert function and its format is mssql format. How can I achive this? thanks in advance

    시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]시흥 QIQ-9529-1551 정왕동출장안마 ‡ 정왕동출장마사지 월곶출장안마]

  • How to load excel-csv file into oracle database

    Hi
    I wanted to load excel file with csv extension(named as trial.csv) into
    oracle database table(named as dept),I have given below my experiment here.
    I am getting the following error,how should I rectify this?
    For ID column I have defined as number(5) datatype, in my control file I have defined as interger external(5),where as in the Error log file why the datatype for ID column is comming as character?
    1)my oracle database table is
    SQL> desc dept;
    Name Null? Type
    ID NUMBER(5)
    DNAME CHAR(20)
    2)my data file is(trial.csv)
    ID     DNAME
    11     production
    22     purchase
    33     inspection
    3)my control file is(trial.ctl)
    LOAD DATA
    INFILE 'trial.csv'
    BADFILE 'trial.bad'
    DISCARDFILE 'trial.dsc'
    APPEND
    INTO TABLE dept
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (ID POSITION(1:5) INTEGER EXTERNAL(5)      
    NULLIF ID=BLANKS,
    DNAME POSITION(6:25) CHAR
         NULLIF DNAME=BLANKS
    3)my syntax on cmd prompt is
    c:\>sqlldr scott/tiger@xxx control=trial.ctl direct=true;
    Load completed - logical record count 21.
    4)my log file error message is
    Column Name Position Len Term Encl Datatype
    ID           1:5 5 , O(") CHARACTER
    NULL if ID = BLANKS
    DNAME 6:25 20 , O(") CHARACTER
    NULL if DNAME = BLANKS
    Record 1: Rejected - Error on table DEPT, column ID.
    ORA-01722: invalid number
    Record 21: Rejected - Error on table DEPT, column ID.
    ORA-01722: invalid number
    Table DEPT:
    0 Rows successfully loaded.
    21 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Bind array size not used in direct path.
    Column array rows : 5000
    Stream buffer bytes: 256000
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 21
    Total logical records rejected: 21
    Total logical records discarded: 0
    Total stream buffers loaded by SQL*Loader main thread: 0
    Total stream buffers loaded by SQL*Loader load thread: 0
    5)Result
    SQL> select * from dept;
    no rows selected
    by
    balamuralikrishnan.s

    Hi everyone!
    The following are the steps to load a excell sheet to oracle table.i tried to be as simple as possible.
    thanks
    Step # 1
    Prapare a data file (excel sheet) that would be uploaded to oracle table.
    "Save As" a excel sheet to ".csv" (comma seperated values) format.
    Then save as to " .dat " file.
    e.g datafile.bat
    1,Category Wise Consumption Summary,Expected Receipts Report
    2,Category Wise Receipts Summary,Forecast Detail Report
    3,Current Stock List Category Wise,Forecast rule listing
    4,Daily Production Report,Freight carrier listing
    5,Daily Transactions Report,Inventory Value Report
    Step # 2
    Prapare a control file that define the data file to be loaded ,columns seperation value,name and type of the table columns to which data is to be loaded.The control file extension should be " .ctl " !
    e.g i want to load the data into tasks table ,from the datafile.dat file and having controlfile.ctl control file.
    SQL> desc tasks;
    Name Null? Type
    TASK_ID NOT NULL NUMBER(14)
    TASK_NAME VARCHAR2(120)
    TASK_CODE VARCHAR2(120)
    : controlfile.ctl
    LOAD DATA
    INFILE 'e:\datafile.dat'
    INTO TABLE tasks
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (TASK_ID INTEGER EXTERNAL,
    TASK_NAME CHAR,
    TASK_CODE CHAR)
    The above is the structure for a control file.
    Step # 3
    the final step is to give the sqlldr command to execute the process.
    sqlldr userid=scott/tiger@abc control=e:\controlfile.ctl log=e:\logfile.log
    Message was edited by:
    user578762

  • How to insert more than 32k xml data into oracle clob column

    how to insert more than 32k xml data into oracle clob column.
    xml data is coming from java front end
    if we cannot use clob than what are the different options available

    Are you facing any issue with my code?
    String lateral size error will come when you try to insert the full xml in string format.
    public static boolean writeCLOBData(String tableName, String id, String columnName, String strContents) throws DataAccessException{
      boolean isUpdated = true;
      Connection connection = null;
      try {
      connection = ConnectionManager.getConnection ();
      //connection.setAutoCommit ( false );
      PreparedStatement PREPARE_STATEMENT = null;
      String sqlQuery = "UPDATE " + tableName + " SET " + columnName + "  = ?  WHERE ID =" + id;
      PREPARE_STATEMENT = connection.prepareStatement ( sqlQuery );
      // converting string to reader stream
      Reader reader = new StringReader ( strContents );
      PREPARE_STATEMENT.setClob ( 1, reader );
      // return false after updating the clob data to DB
      isUpdated = PREPARE_STATEMENT.execute ();
      PREPARE_STATEMENT.close ();
      } catch ( SQLException e ) {
      e.printStackTrace ();
      finally{
      return isUpdated;
    Try this JAVA code.

  • How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?

    Hi
    How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?
    This is my Input data.
    11/25/2007.
    By using below query, it is inserted into database.
    sql>Insert into tblname values(to_date('11/25/2007','MM/DD/YYYY'));
    But using stored procedure, the same query is not running.
    It shows error like
    ORA-01843: not a valid month ORA-06512: at line 1
    Procedure:
    create or replace procedure Date_Test(datejoin in DATE) is
    begin
    insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    end Date_Test;
    I had used 'nls_date_language = american' also.
    Prcodeure is created but not worked in jsp. The same error is thrown.
    Pls provide a solution

    This might help you....
    SQL> Create Table DateTest(col1 Date);
    Table created.
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    BEGIN Date_Test('11/25/2007'); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    BEGIN Date_Test(To_Date('11/25/2007','mm/dd/yyyy')); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at "CTBATCH.DATE_TEST", line 3
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(datejoin);
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> Select * from DateTest;
    COL1
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in VarChar2) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'mm/dd/yyyy'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select * from DateTest;
    COL1
    25-NOV-07
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL>

  • Best method to load XML data into Oracle

    Hi,
    I have to load XML data into Oracle tables. I tried using different options and have run into a dead end in each of those. I do not have knowledge of java and hence have restricted myself to PL/SQL solutions. I tried the following options.
    1. Using DBMS_XMLSave package : Expects the ROWSET and ROW tags. Connot change format of the incoming XML file (Gives error oracle.xml.sql.OracleXMLSQLException: Start of root element expected).
    2. Using the XMLPARSER and XMLDOM PL/SQL APIs : Works fine for small files. Run into memory problems for large files (Gives error java.lang.OutOfMemoryError). Have tried increasing the JAVA_POOL_SIZE but does not work. I am not sure whether I am changing the correct parameter.
    I have read that the SAX API does not hog memory resources since it does not build the entire DOM tree structure. But the problem is that it does not have a PL/SQL implementation.
    Can anyone PLEASE guide me in the right direction, as to the best way to achieve this through PL/SQL ??? I have not designed the tables so am flexible on using purely relational or object-relational design. Although would prefer to keep a purely relational design. (Had tried used object-relational for 1. and purely relational for 2. above)
    The XML files are in the following format, (EXAMINEEs with single DEMOGRAPHIC and multiple TESTs)
    <?xml version="1.0"?>
    <Root_Element>
    <Examinee>
    <MACode>A</MACode>
    <TestingJID>TN</TestingJID>
    <ExamineeID>100001</ExamineeID>
    <CreateDate>20020221</CreateDate>
    <Demographic>
    <InfoDate>20020221</InfoDate>
    <FirstTime>1</FirstTime>
    <LastName>JANE</LastName>
    <FirstName>DOE</FirstName>
    <MiddleInitial>C</MiddleInitial>
    <LithoNumber>73</LithoNumber>
    <StreetAddress>SomeAddress</StreetAddress>
    <City>SomeCity</City>
    <StateCode>TN</StateCode>
    <ZipCode>37000</ZipCode>
    <PassStatus>1</PassStatus>
    </Demographic>
    <Test>
    <TestDate>20020221</TestDate>
    <TestNbr>1</TestNbr>
    <SrlNbr>13773784</SrlNbr>
    </Test>
    <Test>
    <TestDate>20020221</TestDate>
    <TestNbr>2</TestNbr>
    <SrlNbr>13773784</SrlNbr>
    </Test>
    </Examinee>
    </Root_Element>
    Thanks for the help.

    Please refer to the XSU(XML SQL Utility) or TransX Utility(for Multi-language Document) if you want to load data in XML format into database.
    Both of them require special XML formats, please first refer to the following docs:
    http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/xsu/xsu_userguide.html
    http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/transx/readme.html
    You can use XSLT to transform your document to the required format.
    If you document is large, you can use SAX method to insert data into database. But you need to write the code.
    The following sample may be useful:
    http://otn.oracle.com/tech/xml/xdk_sample/xdksample_040602i.html

  • Insert current date and time into Oracle date type field

    I have a JDBC current date and time insert into Oracle 9i that almost works. It submits the current date and a fixed time into the Oracle date type field. I am using Tomcat 6.0.20.
    For example if I insert the data at 7:24:04 PM on Feb 16, 2010 it will insert as: 16-Feb-2010 12:00:00 AM
    The date part works but the time always shows 12:00:00 AM no matter what date or time the data is inserted.
    Here is what I have for my JDBC inserts and I also tried something with DateFormat:
    PreparedStatement ps; Date mydate = new Date(new java.util.Date().getTime()); //insert statement here.... stmt.setDate(1,mydate);
    I also tried:
    PreparedStatement ps; java.sql.Timestamp mydate = new java.sql.Timestamp(new java.util.Date().getTime()); SimpleDateFormat fmt = new SimpleDateFormat(.... //insert statement here.... ps.setTimestamp(1,fmt.format(mydate));
    Both keep submitting the date into Oracle as 16-Feb-2010 12:00:00 AM
    Anyway to get the current date and time? For example if I insert the data at 7:24.04 pm today it should show as 16-Feb-2010 07:24.04 PM in Oracle.

    sportsMarkr wrote:
    Date mydate = new Date(new java.util.Date().getTime());Please see the javadocs for java.sql.Date and note the part that says "...to zero"
    [http://java.sun.com/javase/6/docs/api/java/sql/Date.html]
    If you want a date and time then use java.sql.Timestamp.

  • How to extract the cobol files into owb

    Hi
    How to extract the cobol files in owb,I am using OWB9.2.
    Ex:I am having 2 records DCEC4000100 9159000050C those values are 5 bytes 'RAVI and 6 bytes '15000'.
    Using contorl file i am trying to load these into Oracle,But i am not able into insert these records into Oracle.
    Can any tell me how to handle this kind of situation?
    Regards,
    Rupak

    Good morning Ashok,
    Your data is in a SQL*Loader supported datatype, so basically it should not be a problem.
    Have you checked the Database Utilities guide (for Oracle9i for instance: http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a96652/toc.htm) on how to handle this?
    I'll also repeat my previous question, have you ever been able to load data into the database using SQL*Loader (either using ASCII values or any other datatype)?
    For the OWB part, have you read "Importing Data Definitions" (typically chapter 4)? More specifically, "Specifying Field Properties" in "About Flat File Sources and Targets"?
    In "SQL*Loader Properties" it says the following:
    Type Describes the data type of the field for the SQL*Loader. You can use the Flat
    File Sample Wizard to import the following data types: CHAR, DATE, DECIMAL
    EXTERNAL, FLOAT EXTERNAL, INTEGER EXTERNAL, ZONED , AND ZONED
    EXTERNAL. For complete information on SQL*Loader field and data types, refer to
    Oracle9i Utilities. Currently, only portable datatypes are supported.
    If you check the database utitlities guide (chapter 6 Field List Reference) and look for "SQL*Loader Datatypes", you'll find (packed) decimal under the Nonportable Datatypes. This implies that OWB does not support it.
    This does not mean you can't use SQL*Loader, you'll only have to define everything separate from OWB and call it separately as well.
    Good luck, Patrick

  • Output Report in HTML format thru Oracle Forms. ASAP!!!

    Hi,
    How can i create a HTML output format thru Oracle Runtime Form?
    I have tried using the .REP and i was able to produce the HTML output format but when call the .REP using Oracle Form i was not able to produce the desired output.
    Attach below is the code. Seems like something is wrong with the code
    Thanks,
    Jen
    DECLARE
    pl_id ParamList;
    --subheader varchar2(1000);
    BEGIN
    ** Check to see if the 'tmpdata' parameter list exists.
    pl_id := Get_Parameter_List('tmpdata');
    ** If it does, then delete it before we create it again in
    ** case it contains parameters that are not useful for our
    ** purposes here.
    IF NOT Id_Null(pl_id) THEN
    Destroy_Parameter_List( pl_id );
    END IF;
    ** Create the 'tmpdata' parameter list afresh.
    pl_id := Create_Parameter_List('tmpdata');
    ** Add 1 data parameters to this parameter list
    */ -- subheader is a parameter created in Oracle Reports
    --subheader := :variable.txt_message_yes;
    --Add_Parameter(pl_id,'SUBTITLE',TEXT_PARAMETER,subheader );
    **Pass a Parameter into PARAMFORM so that a parameter dialog will not appear
    **for the parameters being passing in.
    Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
    ** Add the account_no parameters to this parameter list
    Add_Parameter(pl_id,'P_ACCOUNTNO',TEXT_PARAMETER,:account_no);
    * Run the report synchronously, passing the parameter list
    */ -- ABC is the report name
    Run_Product(REPORTS, 'c:\Fusion\FusionInvoice.rep',
    SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
    END;
    null

    Hi there,
    You have to add 3 parameters to param list :
    DESTYPE with value "FILE"
    DESNAME with value of desired filename
    DESFORMAT with value "HTML" or "HTMLCSS" (for cascading style sheets)
    Hope this helps.
    Regards, Kai

  • Can you import local tables into Oracle to query in Discoverer?

    long time lurker, first time poster...
    I've got a local list in excel of over 100k records. I want to bounce this list off our network's data in Oracle to add a few fields to my file. Is there a way to import the local list into Oracle (like I might using MS Access) so that I can query the data using Discoverer, and output my local list with the additional data I pull out of Oracle? Thanks so much for any assistance!

    Hi,
    Create an external table in the database that points to the excel workbook then you will be able to query the excel workbook like any other table in Discoverer. You will need to create a database directory which points to the directory containing the excel workbook. You will also have to save the workbook in a csv format. But once that is set up you will be able to make changes in the excel workbook save them, then refresh the Discoverer workbook and immediately see the changed data in Discoverer.
    Rod West

  • Configuring date format in Oracle 8.1.7

    I have just unloaded records from tables into an sql script file with insert statements. However, the date format for the records that I have unloaded is MM/DD/YYYY. When I try to run this sql script, oracle gives an error, saying it's not a valid month.
    Oracle date format is DD-MMM-YY. How can I change the date format in oracle, so that I could insert these records in?

    If your script does not have explicit TO_DATE conversions (which it should, by the way), like:
    insert into t values (to_date('11/21/2002', 'mm/dd/yyyy'));then you can set the default date format to match the format in your script. So, if your script looks like:
    insert into t values ('11/21/2002');then:
    alter session set nls_date_format = 'mm/dd/yyyy';prior to running the script.

  • How to insert date value into oracle?

    hi,
    iam reading date from xml using vb.net and inserting it into oracle table.
    the date value in xml file is in the format of "01012003".
    i want to insert into oracle table.but iam getting an error "ORA-1843: not a valid month".
    how to solve this problem.
    Any suggestions or examples...

    That's not a date. It's just a string. Convert it to a date using,
    DateTime d = DateTime.ParseExact("01022003", "MMddyyyy", null);
    or
    Dim d As DateTime = DateTime.ParseExact("01022003", "MMddyyyy", Nothing)
    and then bind it to a parameter. ODP.NET will take it from there.
    You should never be hard-coding the date literal into your SQL query.
    David

  • After running ridc to checkin file into Oracle Content Center Server there is error: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line

    Hi,
       I use ridc to check in file into Oracle Center Content server. There is no problem at the beginning. But after running for several days, there is following error.
    I must restart my program to solve this issue.
       Can anyone help me solve this problem?
    Thanks,
    Tony
    2013-07-11 12:24:31,189 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more
    2013-07-11 12:24:33,005 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more
    2013-07-11 12:24:37,870 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more
    2013-07-11 12:24:39,722 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more

    The following is my testing code.
    package ebilling;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.security.SecureRandom;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.List;
    import java.util.Properties;
    import java.util.concurrent.LinkedBlockingQueue;
    import java.util.concurrent.ThreadPoolExecutor;
    import java.util.concurrent.TimeUnit;
    import oracle.stellent.ridc.IdcClient;
    import oracle.stellent.ridc.IdcClientManager;
    import oracle.stellent.ridc.IdcContext;
    import oracle.stellent.ridc.model.DataBinder;
    import oracle.stellent.ridc.model.DataObject;
    import oracle.stellent.ridc.model.DataResultSet;
    import oracle.stellent.ridc.model.TransferFile;
    import oracle.stellent.ridc.protocol.ServiceResponse;
    import org.apache.commons.lang.StringUtils;
    public class UCMContentManager {
         * Check in a file into a Oracle WebCenter Content Server and return content id of uploaded content item in Oracle WebCenter Content Server.    
         * @param properties        The Oracle WebCenter Content Server connection properties.
         * @param contentFile       This file will be checked in a Oracle WebCenter Content Server.
         * @param path              The location path of checked in file in Oracle WebCenter Content Server. This path includes the file name.<br>
         *                             For example, "/folder1/folder2/file1.txt". The "file1.txt" is the file name part. <br>
         *                             The file name will be used as dDocName in Oracle WebCenter Server. It must be unique.<br>
         * @throws ContentException The exception when uploading file into Oracle WebCenter Content Server.
         * @return                  The content id of uploaded content item in Oracle WebCenter Content Server.
        public String saveContent(Properties properties, File contentFile, String path) throws ContentException{
            if(path.endsWith(SLASH)) {
                throw new ContentException("Require file name in Content Management Server");
            if(!path.startsWith(SLASH)) {
                throw new ContentException("The file store path in Content Management Server should be absolute.");
            if (path.indexOf("//") != -1) {
                path = path.replace("//", SLASH);
            String[] paths = path.split(SLASH);       
            String[] parents = new String[paths.length - 1];
            String itemName = paths[paths.length-1];
            System.arraycopy(paths, 0, parents, 0, paths.length-1);
            ServiceResponse response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                //create the parent folders if they don't exist
                String folderGUID = makeFolders(properties, parents);
                //check in the file
                DataBinder requestData = client.createBinder();
                requestData.putLocal("IdcService", "CHECKIN_UNIVERSAL");
                requestData.putLocal("IsJava", "1");
                requestData.putLocal("dDocName", itemName);           
                requestData.putLocal("dDocTitle", itemName);           
                requestData.putLocal("dDocType", "Binary");
                requestData.putLocal("dSecurityGroup", "Public");
                requestData.addFile("primaryFile", new TransferFile(contentFile));
                response = client.sendRequest(connectionContext, requestData);           
                DataBinder responseData = response.getResponseAsBinder();
                //String did = responseData.getLocal("dID");           
                String dDocname = responseData.getLocal("dDocName");
                closeResponse(response);
                //link the file in a folder
                requestData = client.createBinder();
                requestData.putLocal("IdcService", "FLD_CREATE_FILE");
                requestData.putLocal("fParentGUID", folderGUID);
                String fileType = "owner";
                requestData.putLocal("fFileType", fileType);           
                requestData.putLocal("dDocName", dDocname);           
                response = client.sendRequest(connectionContext, requestData);
                return dDocname;
            } catch (Throwable e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
        public void deleteContent(Properties properties, String contentId) throws ContentException{
            List<String> didList = getDIds(properties, contentId);
            contentId = contentId.toUpperCase();
            ServiceResponse    response = null;
            try {           
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder requestData = null;
                for(int i=0; i<didList.size(); i++) {
                    String did = didList.get(i);
                    requestData = client.createBinder();
                    requestData.putLocal("IdcService", "DELETE_DOC");
                    requestData.putLocal("dDocName", contentId);               
                    requestData.putLocal("dID", did);   
                    response = client.sendRequest(connectionContext, requestData);
                    closeResponse(response);
                    //delete parent folder
    //                try {
    //                    requestData = client.createBinder();           
    //                    requestData.putLocal("IdcService", "FLD_DELETE");       
    //                    requestData.putLocal("item1", "path:" + parentPath);
    //                    requestData.putLocal("constructDialog", "1");
    //                    response = client.sendRequest(connectionContext, requestData);
    //                } catch (Exception e) {
    //                    // TODO: handle exception
            } catch (Exception e) {
                throw new ContentException(e);
            } finally {
                closeResponse(response);
        public int getFileCountInFolder(Properties properties, String path) throws ContentException{
            ServiceResponse    response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder binder = client.createBinder();
                binder.putLocal("IdcService", "FLD_BROWSE");
                binder.putLocal("path", path);
                response = client.sendRequest(connectionContext, binder);
                DataBinder result = response.getResponseAsBinder();
                String num = result.getLocal("numFiles");
                return Integer.parseInt(num);
            catch (Exception e) {
                throw new ContentException(e);
            } finally {
                closeResponse(response);
        private String getFolderGUID(Properties properties, String path) throws ContentException {
            ServiceResponse    response = null;       
            String tmpFolderGUID = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;   
                DataBinder requestData = client.createBinder();
                requestData.putLocal("IdcService", "FLD_INFO");
                requestData.putLocal("path", path);       
                response = client.sendRequest(connectionContext,
                        requestData);
                DataResultSet result = response.getResponseAsBinder().getResultSet("FolderInfo");
                tmpFolderGUID = result.getRows().get(0).get("fFolderGUID")
                    .toString();
                if(StringUtils.isBlank(tmpFolderGUID))
                    tmpFolderGUID = null;           
            } catch (Exception e) {               
            } finally {
                closeResponse(response);
            return tmpFolderGUID;
        public boolean deleteFolder(Properties properties, String path) throws ContentException {
            if(getFolderGUID(properties, path)==null)       
                return false;
            int fileCount = getFileCountInFolder(properties, path);
            ServiceResponse    response = null;
            if(fileCount==0) {
                try {
                    IdcClientManager manager = new IdcClientManager();
                    IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                    client.getConfig().setProperty ("http.library", "apache4");
                    String user = properties.getProperty(USERNAME_PROPERTY);
                    String pwd = properties.getProperty(PASSWORD_PROPERTY);
                    IdcContext connectionContext = new IdcContext(user, pwd);
                    pwd = null;               
                    DataBinder binder = client.createBinder();   
                    binder.putLocal("IdcService", "FLD_DELETE");       
                    binder.putLocal("item1", "path:" + path);
                    binder.putLocal("constructDialog", "1");
                    response = client.sendRequest(connectionContext, binder);
                    return true;
                catch (Exception e) {
                    throw new ContentException(e);
                } finally {
                    closeResponse(response);
            } else {
                return false;
        private String buildPath(String[] arr, int i) {
            StringBuilder buf = new StringBuilder();
            for(int j=0; j<=i; j++) {
                buf.append(arr[j]);
                buf.append(SLASH);
            return buf.toString();
        private String makeFolders(Properties properties, String[] paths) throws ContentException{
            String folderGUID = "";
            ServiceResponse response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                String parentFolderGUID = null;
                for(int i=0; i<paths.length; i++) {
                    String fullPath = buildPath(paths, i);
                    DataBinder requestData = null;                   
                    parentFolderGUID = folderGUID;
                    folderGUID = getFolderGUID(properties, fullPath);
                    boolean exists = folderGUID!=null;
                    DataResultSet result = null;               
                    if(!exists) {
                        //create new folder
                        try {
                            requestData = client.createBinder();                   
                            requestData.putLocal("IdcService", "FLD_CREATE_FOLDER");
                            requestData.putLocal("fParentGUID", parentFolderGUID);
                            requestData.putLocal("fFolderName", paths[i]);
                            response = client.sendRequest(connectionContext, requestData);
                        } finally {
                            closeResponse(response);
                        //retrieve folderGUID of new folder
                        folderGUID = getFolderGUID(properties, fullPath);                   
            } catch (Throwable e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
            return folderGUID;
        public List<String> getDIds(Properties properties, String contentId) throws ContentException{
            contentId = contentId.toUpperCase();
            List<String> didList = new ArrayList<String>();
            ServiceResponse    response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder requestData = null;
                requestData = client.createBinder();
                requestData.putLocal("IdcService", "GET_SEARCH_RESULTS");
                requestData.putLocal("SortField", "dInDate");
                requestData.putLocal("SortType", "DESC");
                requestData.putLocal("QueryText", "dDocName <matches> `" + contentId +"`");
                response = client.sendRequest(connectionContext, requestData);
                DataBinder result = response.getResponseAsBinder();
                DataResultSet resultSet = result.getResultSet("SearchResults");
                for (DataObject dataObject : resultSet.getRows()) {
    //                System.out.println("ID : " + dataObject.get("dID")+" dDocName : "
    //                        + dataObject.get("dDocName") + " Title : " + dataObject.get("dDocTitle")
    //                        + " Author : " + dataObject.get("dDocAuthor") + " Security Group : "
    //                        + dataObject.get("dSecurityGroup"));
                    String did = dataObject.get("dID");
                    didList.add(did);
                    //break;
            } catch (Exception e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
            return didList;
         * Get the file content represented by contentId from a Oracle WebCenter Content Server.
         * The return value is the input stream of retrieved file content.
         * @param properties        The Oracle WebCenter Content Server connection properties.
         * @param contentId         The Content ID for the content item in Oracle WebCenter Content Server.
         * @throws ContentException The exception when retrieving content from Oracle WebCenter Content Server.
         * @return                  The input stream of retrieved file content.
        public InputStream retrieveContent(Properties properties, String contentId) throws ContentException{
            try {
                return new FileInputStream(retrieveContentFile(properties, contentId));
            } catch (Throwable e) {
                throw new ContentException(e);
        public File retrieveContentFile(Properties properties, String contentId) throws ContentException {
            contentId = contentId.toUpperCase();
            ServiceResponse response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder binder = client.createBinder();
                binder.putLocal("IdcService", "GET_FILE");
                //binder.putLocal("dID", dID);
                binder.putLocal("dDocName", contentId);
                binder.putLocal("RevisionSelectionMethod", "Latest");
                response = client.sendRequest(connectionContext, binder);
                InputStream in = null;
                OutputStream out = null;
                String edxhome = System.getProperty("edx.home");
                File tmpParent = new File(edxhome);
                tmpParent = new File(tmpParent, "Output");
                tmpParent = new File(tmpParent, "tmp");
                tmpParent.mkdirs();
                File tmpFile = File.createTempFile("down_", "_ucm", tmpParent);
                tmpFile.deleteOnExit();
                try {
                    in = response.getResponseStream();
                    out = new FileOutputStream(tmpFile);
                    byte[] buf = new byte[1024];
                    int read = -1;
                    while((read = in.read(buf))!=-1) {
                        out.write(buf, 0, read);
                } finally{
                    try {
                        if(in!=null)
                            in.close();
                    } catch (Exception e2) {
                    try {
                        if(out!=null)
                            out.close();
                    } catch (Exception e2) {
                return tmpFile;
            } catch (Throwable e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
        private void closeResponse(ServiceResponse response) {
            if(response!=null) {
                try {
                    response.close();
                } catch (Exception e) {
        private static final String SLASH = "/";   
        private static final String URL_PROPERTY = "contentServerURL";
        private static final String USERNAME_PROPERTY = "contentServerUser";
        private static final String PASSWORD_PROPERTY = "contentServerPassword";
        static volatile boolean flag = false;
        static class UploadTask implements Runnable{
            public void run() {           
                try {
                    while(!flag) {
                        UCMContentManager manager = new UCMContentManager();
                        Properties properties = new Properties();
                        properties.put(URL_PROPERTY, "https://slc402124:16201/cs/idcplg");
                        properties.put(USERNAME_PROPERTY, "weblogic");
                        properties.put(PASSWORD_PROPERTY, "weblogic1");
                        File contentFile = new File("C:/toding/mypro/UCM/test.txt");
                        String parentPath = "/new/test/multiThreadUpload/";
                        String location = makePath(parentPath);
                        manager.saveContent(properties, contentFile, location);
                        System.out.println(location);
                        Thread.sleep(5000);
                } catch (Exception e) {
                    e.printStackTrace();
                    flag = true;
        public static void main(String[] args) throws Exception{
            ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 10, 60, TimeUnit.SECONDS,
                     new LinkedBlockingQueue<Runnable>());
            for(int i=0; i<10; i++) {
                 UploadTask uploadTask = new UploadTask();
                 executor.execute(uploadTask);
            while(!flag) {
                Thread.sleep(5000);
            executor.shutdown();
        public static String makePath(String parentPath) {
            StringBuilder buf = new StringBuilder();
            buf.append(parentPath);
            if(!parentPath.endsWith("/")) {
                buf.append("/");
            Calendar rightNow = Calendar.getInstance();
            String pattern = "yyyyMMdd";
            SimpleDateFormat simDateForm = new SimpleDateFormat(pattern);
            String dateStr = simDateForm.format((rightNow).getTime());       
            pattern = "HHmmssSSS";
            simDateForm = new SimpleDateFormat(pattern);
            String timeStr = simDateForm.format((rightNow).getTime());
            buf.append(dateStr);
            buf.append("/");
            buf.append(timeStr);
            buf.append("_");
            buf.append(random.nextInt(10000));
            String finalLocation = buf.toString();
            return finalLocation;
        private static SecureRandom random = new SecureRandom();

  • Insert statement with Date, time into Oracle

    Hi,
    I've got the following statement that I'm trying to insert into Oracle. Actually had to change up the format to dd-mm-yy to get it to insert the date correctly, not sure why, but I've got it "supposedly" formatted to also insert the hours, min., seconds into the db record, but it's not catching it.
    My code:
    INSERT INTO VOTETBL
    (CHANGE_CTRL_ID,BUSVP,BRANCH,VOTE,VOTE_TIMESTAMP)
    VALUES (?, ?,?,?,to_date(sysdate, 'dd-mm-yy hh24:mi:ss'));Shouldn't the sysdate capture all those elements sufficiently? The day, month, year get inserted correctly with this, but not so for the time portion.
    Any suggestions is welcomed.
    Thx.

    ok, thanks.
    I tried making a result set with the following:
    Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    ResultSet rst = stmt.executeQuery("select to_char(sysdate) from dual");
    Date dualtimestamp = (rst.getDate("sysdate"));But it makes the servlet blow up! Not sure why either, because if I enter that exact statement in Oracle, it pulls back the date and time just like I aim to. But not embedded in the result set statement within the servlet.
    It breaks up somehow and doesn't get that result!

Maybe you are looking for

  • REP-1401 : 'CF_Real_VendorFormula': Fatal PL/SQL error occured.

    Hi, I have a cf_formula wich return a varchar. when i run the report, the REP-1401 : 'CF_Real_VendorFormula': Fatal PL/SQL error occured. can someone help me. Best regards. function CF_Real_VendorFormula return Char is att10 varchar2(20); real_vendor

  • Adobe Presenter 9 quiz results reporting to LMS

    We have over 50 users of AP9, and currently use a Success Factors LMS. Our AP9 quiz results are currently reporting only the cut/mastery score to the LMS student transcript, not the actual score the student gets. Any ideas? I've read all the help and

  • Where did the templets go?

    i am still new to apple products so i guess i did something wrong... but after installing FCS2 and going into dvd studio pro, i did not find and templets. thanks in advance. smokefxguy

  • Content purchased via ATV disappearing from ATV, available on iTunes

    Hello, I have an Apple TV and over the past few days purchased one free episode of Heroes and the first episode of the new season of Terminator. I watched both on ATV, but now they're not there anymore (they're only on my computer). The ATV is set to

  • Can't install photoshop CS4

    I am using windows XP SP3 and tried to install photoshop CS4 many times. But every time, after a certain extent of the completion of the setup, my system automatically restarts. I checked the setup log file and found that the last line of the log fil