SQL Loader (how to cut data header)

Hi there,
[oracle 11g]
I got the following text file:
mod; DD.MM.YYYY; HH:MM:SS; aligned
src; "ptv "; "15.04.2012"; "10:47:49"
chs; "ISO8859-1"
ver; "V1.0"
ifv; "V1.0"
dve; "V1.0"
fft; "LIO"
tbl; MENGE_FGR
atr; BASIS_VERSION; FGR_NR; FGR_TEXT
frm; num[9.0]; num[5.0]; char[40]
rec;        122;     8; "VVZ"   
rec;        123;     18; "VHZ"
rec;        124;     13; "VTZ"    Now I am interested in the column TBL and ATR and follwing rawdata
Do you see a way to automatically create the table MENGE_FR with columns BASIS_VERSION; FGR_NR;FGR_TEST and column types num, num, char and insert the raw data below?
PS:OK, this is mysql ...so I need to convert this first to sql. So you should see num as number.
Thx in advance Thorsten
Edited by: Thorsten on 16.05.2013 07:30
Edited by: Thorsten on 16.05.2013 07:32

There are various ways that you could do this. I have demonstrated one method below. I created a table with two columns, then used SQL*Loader to load the data from the text file into those two columns. Skipping the header rows is optional. You could also use an external table instead, if the text file is on your server, not your client. I then used some PL/SQL to create and execute "create table" and "insert" statements. This is just some starter code. You will need to make modifications to handle other data types and such that were not in the example that you provided, but it should give you the general idea.
SCOTT@orcl_11gR2> host type text_file.dat
mod; DD.MM.YYYY; HH:MM:SS; aligned
src; "ptv "; "15.04.2012"; "10:47:49"
chs; "ISO8859-1"
ver; "V1.0"
ifv; "V1.0"
dve; "V1.0"
fft; "LIO"
tbl; MENGE_FGR
atr; BASIS_VERSION; FGR_NR; FGR_TEXT
frm; num[9.0]; num[5.0]; char[40]
rec;        122;     8; "VVZ"
rec;        123;     18; "VHZ"
rec;        124;     13; "VTZ"
SCOTT@orcl_11gR2> host type test.ctl
options(skip=7)
load data
infile text_file.dat
into table tbl
(col1 terminated by ';',
col2 terminated by x'0a')
SCOTT@orcl_11gR2> create table tbl
  2    (col1  varchar2(4),
  3     col2  varchar2(60))
  4  /
Table created.
SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test.ctl log=test.log
SQL*Loader: Release 11.2.0.1.0 - Production on Thu May 16 13:44:24 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Commit point reached - logical record count 6
SCOTT@orcl_11gR2> select * from tbl
  2  /
COL1 COL2
tbl   MENGE_FGR
atr   BASIS_VERSION; FGR_NR; FGR_TEXT
frm   num[9.0]; num[5.0]; char[40]
rec          122;     8; "VVZ"
rec          123;     18; "VHZ"
rec          124;     13; "VTZ"
6 rows selected.
SCOTT@orcl_11gR2> declare
  2    v_tab   varchar2(30);
  3    v_atr   varchar2(32767);
  4    v_frm   varchar2(32767);
  5    v_sql   varchar2(32767);
  6    v_cols  number;
  7    v_next  varchar2(32767);
  8  begin
  9    select col2 into v_tab from tbl where col1 = 'tbl';
10    select col2 || ';' into v_atr from tbl where col1 = 'atr';
11    select col2 || ';' into v_frm from tbl where col1 = 'frm';
12    v_sql := 'CREATE TABLE ' || v_tab || ' (';
13    select regexp_count (col2, ';') + 1 into v_cols from tbl where col1 = 'atr';
14    for i in 1 .. v_cols loop
15      v_sql := v_sql || substr (v_atr, 1, instr (v_atr, ';') - 1) || ' ';
16      v_next := substr (v_frm, 1, instr (v_frm, ';') - 1);
17      v_next := replace (v_next, '[', '(');
18      v_next := replace (v_next, ']', ')');
19      v_next := replace (v_next, '.', ',');
20      v_next := replace (v_next, 'num', 'number');
21      v_next := replace (v_next, 'char', 'varchar2');
22      v_sql := v_sql || v_next || ',';
23      v_atr := substr (v_atr, instr (v_atr, ';') + 1);
24      v_frm := substr (v_frm, instr (v_frm, ';') + 1);
25    end loop;
26    v_sql := rtrim (v_sql, ',') || ')';
27    dbms_output.put_line (v_sql);
28    execute immediate v_sql;
29    for r in (select col2 from tbl where col1 = 'rec') loop
30      v_sql := 'INSERT INTO ' || v_tab || ' VALUES (''';
31      v_sql := v_sql || replace (replace (r.col2, ';', ''','''), '"', '');
32      v_sql := v_sql || ''')';
33      dbms_output.put_line (v_sql);
34      execute immediate v_sql;
35    end loop;
36  end;
37  /
CREATE TABLE  MENGE_FGR ( BASIS_VERSION  number(9,0), FGR_NR  number(5,0),
FGR_TEXT  varchar2(40))
INSERT INTO  MENGE_FGR VALUES ('        122','     8',' VVZ')
INSERT INTO  MENGE_FGR VALUES ('        123','     18',' VHZ')
INSERT INTO  MENGE_FGR VALUES ('        124','     13',' VTZ')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> describe menge_fgr
Name                                      Null?    Type
BASIS_VERSION                                      NUMBER(9)
FGR_NR                                             NUMBER(5)
FGR_TEXT                                           VARCHAR2(40)
SCOTT@orcl_11gR2> select * from menge_fgr
  2  /
BASIS_VERSION     FGR_NR FGR_TEXT
          122          8  VVZ
          123         18  VHZ
          124         13  VTZ
3 rows selected.

Similar Messages

  • Sql loader how import a file with save the actual row number in a db field

    Hey,
    how can i save the row number for each row in a file into a database field i the same table with the sql loader (sqlldr)?
    test data:
    john doe
    joe meier
    table:
    name surname line_number_in_file
    john doe 1
    joe meier 2
    and so on ... an if an line is discarded because it is empty for example it should be as this:
    test data:
    john doe
    joe meier
    table:
    name surname line_number_in_file
    john doe 1
    joe meier 3
    thanks for helpinmg and excuse my very bad english :-)
    Message was edited by:
    user527827

    but if one of the when clause faild or some rows are
    rejectet the sequence is not right.Did you read the link?
    "If a record is rejected (that is, it has a format error or causes an Oracle error), the generated sequence numbers are not reshuffled to mask this. If four rows are assigned sequence numbers 10, 12, 14, and 16 in a particular column, and the row with 12 is rejected, the three rows inserted are numbered 10, 14, and 16, not 10, 12, and 14. This allows the sequence of inserts to be preserved despite data errors. When you correct the rejected data and reinsert it, you can manually set the columns to agree with the sequence."
    also if you read multiple lines and they inserted in
    the wrong order the number from the sequence is not
    the line number...what do you mean with "reading multiple lines and wrong order?"

  • Sql loader error in offline data load

    Hi,
    I have done an offline schema creation using existing tablespace.
    I am trying to do an offline data load using sql loader.The CTL and DAT file are generated by the work bench.
    This is my CTL file code generated by workbench.
    load data
    infile 'Import.dat' "str '<EORD>'"
    into table IMPORT
    fields terminated by '<EOFD>'
    trailing nullcols
    When I am running the ctl file with DAT file in sql loader I am getting the following error
    SQL*Loader-350: Syntax error at line 4.
    Expecting single char, found "<EOFD>".
    fields terminated by '<EOFD>'
    ^
    My Sql Loader version is Release 8.0.6.3.0
    Please help if anyone has came across this issue.
    Thanks in advance.
    Regards
    Saravanan.B

    Saravanan,
    Its a long time since I have seen 8 sql loader. Check the doc. Is it resrticted to a single character delimter??
    Barry

  • SQL*Loader: How to load multi-line report data?

    Hi,
    is it possible to use SQL*Loader to load data from a hierarchical structured fixed column ASCII file like this
    001 scott
    New York 01.01.2002 1234
    Chicago 15.10.2001 9876
    002 smith
    Los Angeles 24.12.1999 5678
    Washington 01.12.1999 0000
    Chicago 01.01.2000 1111
    into one database table:
    id name city day code
    001 scott New York 01.01.2002 1234
    001 scott Chicago 15.10.2001 9876
    002 smith Los Angeles 24.12.1999 5678
    002 smith Washington 01.12.1999 0000
    002 smith Chicago 01.01.2000 1111
    The number of lines per name is unlimited, the next line starts after a separating ---- line.
    We cannot change the format of the text file to import.
    There is an example in the documentation that shows how to load a structure like the following via insert triggers:
    001 scott New York 01.01.2002 1234
    Chicago 15.10.2001 9876
    002 smith Los Angeles 24.12.1999 5678
    Washington 01.12.1999 0000
    Chicago 01.01.2000 1111
    But we have the name information on a separate header line, so I don't know if we can use a similar technique here.
    regards
    Sven

    Try enclosing your strings with e.g. a double-quote. To do so, the control file needs the following (example):
    LOAD DATA
    REPLACE
    INTO TABLE test          
    FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    id1,
    id2,
    id3,
    id4,
    )of course this does mean that your data must change...
    L.

  • SQL*LOADER how to load blanks when data is null

    I need to load data which contains null values into a table which cannot contains nulls. How can I tell SQL*LOADER to load blanks in a column when the input data is nulls?

    I think something like this in your control file should work:
    col1 char(10) nvl(col1,' ')

  • SQL Loader-How to insert -ve & date values from flat text file into coloumn

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide.

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide. Try something like
    someDate    DATE 'DDMMYYYY'
    someNumber1      "TO_NUMBER ('s99999999.00')"
    someNumber2      "TO_NUMBER ('99999999.00s')"Good luck,
    Eric Kamradt

  • SQL*Loader - How to combine 2 controlfiles to one controlfile

    I have several controllfiles which each import another table from another datafile, because I don't want execute every seperat or create a batch file.... I'm looking for a way to put they all in one single controlfile.
    example:
    1st ctl-file:
    LOAD DATA
    INFILE "t1.dat"
    INTO TABLE t1 REPLACE
    FIELDS TERMINATED BY "     "
    (c1,
    c2 "to_number(:c2,'99999999999999999.99999999999999999','NLS_NUMERIC_CHARACTERS=''.,''')",
    c3 date 'YYYY-MM-DD"T"HH24:MI:SS')
    gQuqT     478.60636734965914     2006-12-05T11:00:49
    ÜgQK     963.0277916962095     2006-12-30T08:03:00
    üZfxN     465.15226622488257     2006-12-30T09:14:12
    2nd ctl-file:
    LOAD DATA
    INFILE "t2.dat"
    INTO TABLE t2 REPLACE
    FIELDS TERMINATED BY "     "
    (c1,
    c2 "to_number(:c2,'99999999999999999.99999999999999999','NLS_NUMERIC_CHARACTERS=''.,''')")
    alvwxs     13.0
    poeh     15.0
    zpgiht     21.0
    At the examples is everytime used a id column, to ident which row should import in which table.
    But at my case i need something like a where condition from which file the data should be imported....how should it look?
    Can someone give me an advice how a controlfile should look which import both tables in one controlfile?
    BR
    roland

    It is not possible to combine the last 3 columns as those columns are seperated by commas and in the SQL Loader control file you must ve specified COMMA as an delimiter. So u better have all the columns in the table plus add one more column which holds the concatenation of the 3 columns.
    Vijay

  • SQL*Loader - How to load only a few columns from a .csv file to ora table

    Hi there,
    Could anyone please let me know how to load few columns from a .csv
    file into a oracle table using SQL*Loader.
    I know how to create a .dat and .ctl file and run the sql loader.
    Suppose I have a .csv file with
    col1, col2, col3, col4
    and I only need to load col1 and col3 into col_a and col_b respectively
    in table_a?
    structure of table_ a
    col_a,
    col_b
    Please advice

    Try like..it i will work..
    LOAD DATA
    INFILE 'test.txt'
    LOAD DATA
    TRUNCATE INTO TABLE T1
    FIELDS TERMINATED BY ','
    (col1,
    col2 FILLER,
    col3,
    col4 FILLER
    )

  • SQL loader : how to populate a calculated feild of a table?

    Hi All,
    I have a table which has total 92 columns, among them 6 feilds are calculated using few other fields of the same table.
    i have a csv file , which has only 86 feilds .
    during upload data using sql loader, is it possible to calculate other 6 feilds and upload them along with 86 fields ?
    Or any other method to populate the calculated values?
    Thanks in advance,
    Archana

    Hi Archana,
    You can have a script file with the required update commands and execute that script after the Loader loads the data to have them updated.
    But it is not a good practice to store the calculated values in the fields.
    Whenever required you can have them as a calculation in your select statements instead of storing them in the table.
    Unfortunately if the base values get changed you would be forced to recalculate and store them if you have them in the table.
    Regards,
    S.Muthukumar.

  • SQL Loader Approch to fetch data from Previous Data Segment.

    CREATE TABLE T
    RECORD_ID NUMBER,
    SEG_VALUES VARCHAR2(4000)
    ==============================================================================
    LOAD DATA
    INFILE *
    TRUNCATE
    INTO TABLE T
    WHEN SEG_VALUES <> ''
    RECORD_ID RECNUM,
    SEG_VALUES POSITION(1:4000)
    BEGIN DATA
    AAASH9561000000074120081029SYS
    BBB0000001H0351
    CCC0000001 6040818 078141532A 202007083020070830 36274
    CCC0000002 12623239 526486168A 202008063020080630 4808
    CCC0000003 13326331 530229550A 202008042620080426 V4611
    CCC0000004 23554261 161340499A 202008082220080822 6868
    ==============================================================================
    CREATE TABLE T1
         FILE_ID VARCHAR2(20),
         CONT_NBR VARCHAR2(20),
         SEG_VALUES VARCHAR2(4000)
    ==============================================================================
    CREATE OR REPLACE PROCEDURE P
    AS
    l_Fileid T1.file_id%type;
    l_Contractnbr t1.CONT_NBR%Type;
    BEGIN
         FOR REC IN (SELECT SEG_VALUES FROM T ORDER BY RECORD_ID)
         LOOP
              IF SUBSTR(REC.SEG_VALUES,1,3) ='AAA' THEN
                   l_Fileid := SUBSTR(REC.SEG_VALUES,10,10);
              ELSIF SUBSTR(REC.SEG_VALUES,1,3) ='BBB' THEN
                   l_Contractnbr := SUBSTR(REC.SEG_VALUES,11,5);
              ELSIF SUBSTR(REC.SEG_VALUES,1,3) ='CCC' THEN
                   INSERT INTO T1 VALUES (l_Fileid,l_Contractnbr,REC.SEG_VALUES);               
    END IF;
         END LOOP;
         COMMIT;
    EXCEPTION
         WHEN OTHERS THEN
         RAISE_APPLICATION_ERROR (-20458,SQLERRM);
    END P;
    ==============================================================================
    Is there is any simple approch to handle the above scenario in SQL Loader Control file? if possible can you please show me?

    Handle the above scenario? What above scenario?
    Could I guess ... you betcha. Will I guess? Quite another matter.
    Please provide full version (all 3 decimal places) and a clear and concise description of what help you need.

  • SQL LOADER: how to load CLOB column using stored function

    Hi,
    I am a newbie of sql loader. Everything seems to be fine until I hit a
    road block - the CLOB column type. I want to load data into the clob
    column using a stored function. I need to do some manipulation on the
    data before it gets saved to that column. But I got this error when I
    run the sql loader.
    SQL*Loader-309: No SQL string allowed as part of "DATA" field
    specification
    DATA is my CLOB type column.
    here is the content of the control file:
    LOAD DATA
    INFILE 'test.csv'
    BADFILE 'test.bad'
    DISCARDFILE 'test.dsc'
    REPLACE
    INTO TABLE test_table
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    codeid          BOUNDFILLER,
    reason          BOUNDFILLER,
    Checkstamp     "to_date(:CHECKSTAMP, 'mm/dd/yyyy')",
    "DATA"          "GetContent(:codeid, :reason)"
    All references are suggesting to use a file to load data on
    CLOB column but I want to use a function in which it generates
    the content to be saved into the column.
    Any help is greatly appreciated.
    Thanks,
    Baldwin
    MISICompany

    *** Duplicate Post ... Please Ignore ***

  • SQL Loader - want to access data from .txt file but don't want to insert

    Hello,
    I have situation where I have some data in .txt file and I have to load that data into one of my table.
    My problem is I have fundtion get_id(a,b,c) in database which I have to call while loading the data to find out value of x.
    I have value of a, b and c in txt file which I can access it using POSITION(N:M) in sql loader, but After accessing that value I just want to past to get_id() function and dont want to insert into sql loader.
    any help

    My control file is as below
    Following field is not in database but I need to pass the value to the function to get a ESC_USER_ID. any help
    OFFICE_NUM      filler POSITION(32:35) ,
    STATION_DESK      filler POSITION(45:48),
    LOAD DATA
    INFILE REFERRALs.TXT
    BADFILE REFERRAL_LOAD.BAD
    DISCARDFILE REFERRAL_LOAD.DIS
    INSERT
    INTO TABLE REFERRAL
    EVALUATE CHECK_CONSTRAINTS REENABLE DISABLED_CONSTRAINTS
    TRAILING NULLCOLS
    ID                    sequence (1,1),
    JOB_ID                    POSITION (16:22) "GET_JOB_ID(:JOB_ID)"      ,
    CUS_ID                    POSITION (23:31) "GET_CUS_ID(:CUS_ID)"     ,
    STATUS_LU               CONSTANT 'F'                    ,     
    REQUEST_USER_TYPE_LU          CONSTANT 'S'                    ,
    OFFICE_NUM      filler POSITION(32:35) ,
    STATION_DESK      filler POSITION(45:48),
    REQUEST_USER_ID          POSITION(143:149) "GET_ESCUSER_ID(OFFICE_NUM,STATION_DESK,:REQUEST_USER_ID)"     ,
    REQUEST_DT               POSITION (37:44) "to_date(:REQUEST_DT,'YYYY/MM/DD')"     ,
    REVIEW_USER_ID               FILLER                         ,
    REVIEW_DT               FILLER                         ,
    REFUSE_REASON_LU          FILLER                         ,
    RESULT_LU               POSITION (97:97)               ,
    NOTIFY_STATUS_LU          FILLER                         ,
    NOTIFY_DT               FILLER                         ,
    APPOINTMENT_DT               POSITION (106:113) "to_date(:APPOINTMENT_DT,'YYYY/MM/DD')"     ,
    RESULT_DT               POSITION (98:105) "to_date(:RESULT_DT,'YYYY/MM/DD')"     ,
    NO_MATCH_IND               CONSTANT 'N'
    )

  • Sql loader, how to get decimals into the database?

    oracle 10.2
    we have data of the form
    1.10
    1.11
    we are using "decimal external" in the control file.
    The table is a straight number field
    I did a test where I created a table with a number field and without and precision and did regular inserts. I got the decimal values.
    so I did
    create table x (y number);
    insert into x values (1.10);
    insert into x values (1.11);
    and i got back
    1.1
    1.11
    when we sql load we get
    1
    1

    Why use decimal external then? What's wrong with leaving the field as number?

  • SQL*Loader: How to use Sequence and REF together?

    Hi,
    I'm getting the following error:
    SQL*Loader-418: Bad datafile datatype for column AREA_ID.
    I attempt to upload one datafile into 4 different tables.
    When executing sqlldr scott/tiger control=sqlldr_aj_new.ctl
    1) Here is my Control file (sqlldr_aj_new.ctl):
    load data
    infile 'TST_MAIN_NEW.csv'
    -- Loads table "TST_AREAS"
    into table TST_AREAS
    REPLACE
    FIELDS TERMINATED by ','
    (AREA_ID SEQUENCE,
    AREA_NAME,
    PRODUCT_ID,
    PRIORITY_ID,
    PLAN_ID,
    CREATED_BY_ID,
    AREA_DESC)
    -- Loads table "TST_TEMPLATE_SCENS"
    into table TST_TEMPLATE_SCENS
    REPLACE
    FIELDS TERMINATED by ','
    (TEMPLATE_SCEN_ID SEQUENCE,
    SCENARIO_NAME,
    MODIFIED_BY_ID,
    SCEN_TYPE_ID,
    OWNER_ID,
    PRIORITY_ID,
    SCOPE_ID,
    SCENARIO_DESC,
    AREA_ID REF(CONSTANT 'TST_AREAS', AREA_ID))
    2) Here is my data file(TST_MAIN_NEW.csv)
    B/S,105,1,plan_id_1,2222,area_desc1,CCEMC_PR_001,1111,1,2222,2,1,scenario_desc_1
    B/S,105,1,plan_id_2,2222,area_desc2,CCEMC_PR_002,1111,2,2222,2,2,scenario_desc_2
    3) Here are the tables:
    TST_AREAS
    Name Null? Type
    AREA_ID NOT NULL NUMBER(35)
    AREA_NAME CHAR(64)
    PRODUCT_ID NUMBER(35)
    PRIORITY_ID NUMBER(35)
    PLAN_ID NUMBER(35)
    CREATED_BY_ID NUMBER(35)
    AREA_DESC CHAR(1000)
    TST_TEMPLATE_SCENS
    Name Null? Type
    TEMPLATE_SCEN_ID NOT NULL NUMBER(35)
    SCENARIO_NAME CHAR(500)
    MODIFIED_BY_ID NUMBER(35)
    SCEN_TYPE_ID NUMBER(35)
    OWNER_ID NUMBER(35)
    PRIORITY_ID NUMBER(35)
    SCOPE_ID NUMBER(35)
    SCENARIO_DESC CHAR(1000)
    AREA_ID NOT NULL NUMBER(35)
    Please advise what is the reason for an error.
    Thank you very much!
    Andrey

    I don't think so.
    SQL> create table t (
      2  rowid number);
    rowid number)
    ERROR at line 2:
    ORA-00904: : invalid identifierPlease post your version number and the DDL for the table.
    Best practice in Oracle is to NEVER, EVER, store a ROWID: They can change.
    After you have solved the first problem, that you've never actually built the table, the solution to the sequence use is to make the call in your DML.
    INSERT INTO t (testcol) VALUES (<sequence_name>.NEXTVAL);

  • Sql loader issue char to date

    Hi
    I have a text file like this:
    logs~-~189.138.221.234~[19/Nov/2007:18:39:53 +0100]~mujer.orange.es~/mujer.woo/home/home/index.html~mujer.woo~home~home~index.html~Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts; InfoPath.2)~bid=1195493283-1925481236; __em_p=1195493283-1925481236%26bid; GUID=0002D029C7BD07412A7C28F861626364~-~?ord=4939922038660
    Im trying to load via sql loader to a table like this:
    CREATE TABLE SPY_LOGS_FLOGS
    TYPE VARCHAR2(10 BYTE),
    PROXY VARCHAR2(30 BYTE),
    IP VARCHAR2(30 BYTE),
    DATETIME DATE,
    REFERER VARCHAR2(100 BYTE),
    SPY VARCHAR2(100 BYTE),
    SPY0 VARCHAR2(100 BYTE),
    SPY1 VARCHAR2(100 BYTE),
    SPY2 VARCHAR2(100 BYTE),
    SPY3 VARCHAR2(100 BYTE),
    BROWSER VARCHAR2(300 BYTE),
    COOKIE VARCHAR2(100 BYTE),
    UNKNOWN VARCHAR2(100 BYTE),
    QS VARCHAR2(100 BYTE)
    Im using a control similar to this:
    LOAD DATA
    infile '../files/spy_logs_flogs'
    append
    into table spy_logs_flogs
    FIELDS TERMINATED BY '~'
    TRAILING NULLCOLS
    TYPE char,
    PROXY char,
    IP char,
    DATETIME date 'to_date(:DATETIME,'"["yyyymmdd hh24:mi:ss"] +100"')' ,
    REFERER char,
    SPY char,
    SPY0 char,
    SPY1 char,
    SPY2 char,
    SPY3 char,
    BROWSER char,
    COOKIE char,
    UNKNOWN char,
    qs char
    Im trying to transform the DATETIME field from [19/Nov/2007:18:39:53 +0100] to date 19/10/2007 18:39:53, but have tested with control and cant find the way to do it.
    Any help will be appreciate.

    Play with
    select substr('[19/Nov/2007:18:39:53 +0100]',2,20) the_date
      from dualand if you get 19/Nov/2007:18:39:53 proceed to
    select to_date('19/Nov/2007:18:39:53','DD/MON/YYYY:HH24:MI:SS')
      from dual
    select to_date('19/Nov/2007:18:39:53','DD/Mon/YYYY:HH24:MI:SS')
      from dual
    select to_date('19/Nov/2007 18:39:53','DD/MON/YYYY HH24:MI:SS')
      from dual
    select to_date('19/Nov/2007 18:39:53','DD/Mon/YYYY HH24:MI:SS')
      from dualperhaps one of those will work (if it's the one without : then you must replace it with space using substr and || before using to_date)
    Regards
    Etbin

Maybe you are looking for

  • Error while Creating New System

    Hi, I am working on the HANA Sandbox and getting the following Error when I am trying to create a new system. u201CLicense Key could not be installedu201D. Regards, Surya Kumar

  • Email -Save as- New Folder- buggy -no copy/paste

    Email -Save as- New Folder- buggy. I can't paste text into a new folder field whether from a file/save as path or save attachments as- new folder.  That new folder dialog box does not allow copy or paste, only direct typing.   I've tried on three mac

  • Apex 4.2: changing link column from ROWID to ID

    Hello I have a report linked to a form. The link column is currently ROWID and I want to change it to the Primary Key of the DB table, which is called ID. I have done this before on a previous report/form where that ID was a display column and it wor

  • How can I Increase the Thickness of Blinking Cursor in adobe reader?

    I sometimes refer to another part of file of pdf and to get back, blinking cursor is supposed to help me but it is tiny blinking I have hard time to find it back. How can I increase the thickiness of blinking cursor in adobe reader?

  • Server shutdown randomly - winlogon.exe + other clues

    Hello, This has started happening since last week. Every day (sometimes more than once), the server (Windows Server 2003) would shut-down or restart by itself. I've investigated in the event viewer, and noticed 2 things: 1. Every single time this hap