SQL*Loader - two-digit year

Hello,
Oracle 9
I'm loading data into a table using sql*loader. Included is a date field with a two-digit
year. When the data is loaded, the century for the date defaults to 20. Is there a way to
change the ctl file to set the century based on a pivot year. For example if the year
is greater than 50 then change the date so that the century is 19, otherwise the century would
be 20.
Here's data:
12345678901234567890123456789 <-- postion
0000000 <--- record 1
0010000062603DUNNING PATRI <--- record 2
0000000 <--- record 3 0010000073002BARRIS THEOD <--- record 4
0000000 <--- etc 0000000 0000000 0000000000000BANK PEOPL
Here's the ctl file:
LOAD DATA
INFILE 'S4_MST01.TST'
REPLACE
INTO TABLE mreadm.SBX_ACCOUNT_INFO
LAST_PAYMENT_AMOUNT POSITION(01:07) DECIMAL EXTERNAL ":LAST_PAYMENT_AMOUNT/100",
LAST_PAYMENT_DATE POSITION(08:13) DATE "MMDDYY" NULLIF (77:78) = '00',
CUSTOMER_SHORT_NAME POSITION(14:29) CHAR
Thanks.
Paul

There probably is a way to do it at the instant you load the data. I suggest you use a different approach.
Load the data into the table. Then execute a simple statement like:
select case when(to_number(to_char(sysdate,'YY'),99)) > 50 THEN '20' ELSE '00' END from dual;
replace the sysdate above by the name of your column and issue a simple update statement. Let me know if I confused you, I can give a more specific exmaple on updating.

Similar Messages

  • ADF Faces 10.1.3.0.4 - two-digit-year-start has no effect?

    Hi all,
    I have problem with entering date with an af:selectInputDate control:
    the user enters the date and on an onblur event, the adf field
    automatically reformats it:
    10.10.10 ->10.10.2010
    10.10.60 ->10.10.1960
    The user (customer) wants 2 things to change:
    1. if the given two digit year <= actual year (06):
    10.10.06 ->10.10.2006
    otherwise
    10.10.07 ->10.10.1907
    2. by entering a date, adf have to be accept the date without dots too:
    101006 ->10.10.2006
    1.: I tried to set theconfig param: <two-digit-year-start>2006</two-digit-year-start> (or with an EL expression) in the adf-faces-config.xml but it has no effect.
    Is it a totally wrong idea or is it a bug?
    Any other idea?
    2.: Is it possible to solve this problem with a built in control or converter? Or do i have to write my own converter?
    Thanks for any help!

    The exception is gone - I must have had something wrong in my classpath. However, I still see the warnings. Are those warnings expected when using ADF in conjunction with myfaces?

  • Two digit year cutoff in SQL Server 2008 R2

    Hi All,
    We have a 2008R2 setup here and have SSIS jobs importing data from flat files into our database. Some sources only give us 2 digit years unfortunately. 
    Looking at some data, the default 2 digit year cutoff  is not really appropriate to our setup, a value of 2080 would be better. However, when checking the official documentation here:
    http://msdn.microsoft.com/en-us/library/ms191004(v=sql.105).aspx
    there is a warning to leave the value alone to maintain backwards compatibility. This warning is NOT present for the newer versions of SQL Server. Is this just a generic warning about the general application landscape, or is there some Microsoft code somewhere
    within SQL Server/SSIS/SSRS which assumes this default is locked to 2049? In other words, if I understand the application landscape at my office - am I safe to change this? Or is there some underlying code which will break?
    Also, am I right in the assumption that once a 2 digit year is imported into a database table, it's then converted to a 4 digit year, so any existing data is "safe" from this setting being changed? In other words, the DB loses all memory of whether
    an imported date was originally imported as a 2 digit year?
    Thanks

    Import the string dates into DATE/DATETIME format.
    DATE/DATETIME has 4 digit year.
    You can convert it differently than the automatic 2049 flip year.
    DATE/TIME functions & string conversions:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Here is an automatic conversion example.
    DECLARE @StringDate char(8) = '10/23/80';
    DECLARE @Date DATE;
    SELECT @Date=CONVERT(date, @StringDate, 1);
    SELECT @Date;
    -- 1980-10-23
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Loading single digit months with SQLLDR

    How can I load dates with the month having a single digit using sqlldr??
    62305220507 in this example the date is 23-Jun0-05 22:05:07
    111804115452 in this example the date is 18-Nov-04 11:54:52
    I've tried the date mask mmddyyhh24miss but only the double digit months get loaded.
    Thanks,
    Paul

    How about something like this
    my_date CHAR "to_date(lpad(:my_date, 12, '0'), 'mmddyyhh24miss')"P.S. And maybe you should consider to use RR rather than YY for the two digit year?

  • Loading two tables at same time with SQL Loader

    I have two tables I would like to populate from a file C:\my_data_file.txt.
    Many of the columns I am loading into both tables but there are a handful of columns I do not want. The first column I do not want for either table. My problem is how I can direct SQL Loader to go back to the first column and skip over it. I had tried using POSITION(1) and FILLER for the first column while loading the second table but I got THE following error message:
    SQL*Loader-350: Syntax error at line 65
    Expecting "," or ")" found keyword Filler
    col_a Poistion(1) FILLER INTEGER EXTERNALMy control file looks like the following:
    LOAD DATA
    INFILE 'C:\my_data_file.txt'
    BADFILE 'C:\my_data_file.txt'
    DISCARDFILE 'C:\my_data_file.txt'
    TRUNCATE INTO TABLE table_one
    WHEN (specific conditions)
    FIELDS TERMINATED BY ' '
    TRAILING NULLCOLS
    col_a FILLER INTEGER EXTERNAL,
    col_b INTEGER EXTERNAL,
    col_g FILLER CHAR,
    col_h CHAR,
    col_date DATE "yyyy-mm-dd"
    INTO TABLE table_two
    WHEN (specific conditions)
    FIELDS TERMINATED BY ' '
    TRAILING NULLCOLS
    col_a POSITION(1) FILLER INTEGER EXTERNAL,
    col_b INTEGER EXTERNAL,
    col_g FILLER CHAR,
    col_h CHAR,
    col_date DATE "yyyy-mm-dd"
    )

    Try adapting this for your scenario.
    tables for the test
    create table test1 ( fld1 varchar2(20), fld2 integer, fld3 varchar2(20) );
    create table test2 ( fld1 varchar2(20), fld2 integer, fld3 varchar2(20) );
    control file
    LOAD DATA
    INFILE "test.txt"
    INTO TABLE user.test1 TRUNCATE
    WHEN RECID = '1'
    FIELDS TERMINATED BY ' '
    recid filler integer external,
    fld1 char,
    fld2 integer external,
    fld3 char
    INTO TABLE user.test2 TRUNCATE
    WHEN RECID <> '1'
    FIELDS TERMINATED BY ' '
    recid filler position(1) integer external,
    fld1 char,
    fld2 integer external,
    fld3 char
    data for loading [text.txt]
    1 AAAAA 11111 IIIII
    2 BBBBB 22222 JJJJJ
    1 CCCCC 33333 KKKKK
    2 DDDDD 44444 LLLLL
    1 EEEEE 55555 MMMMM
    2 FFFFF 66666 NNNNN
    1 GGGGG 77777 OOOOO
    2 HHHHH 88888 PPPPP
    HTH
    RK

  • Can I have two Data Files in One control file of sql*loader tool

    hi,
    Can someone help me out. is it possible to have two Data Files in one control file of Sql*loader.
    And isit possible to run 10,000 records before lunch and 10,000 records before tea and 10,000 records before evening session by giving breaks after every 10,000 records.
    Thanks
    Ram

    Yes. You can specify two datafiles in one control file and can load using sql loader.
    I give you the sample control file.
    Load DATA
    INFILE 'TEST1.CSV'
    INFILE 'TEST2.CSV'
    TRUNCATE
    INTO TABLE TEST_P
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (COL_1,
    COL_2,
    COL_n)
    Hope It will help you.
    -Karthik

  • SQL*Loader options - which of the two is faster?

    Hi, I am loading data into a staging table, using sqlldr. There are no indexes, and the table can be truncated.
    the number of rows is known prior to the call, so i can set rows=...
    it is a fixed size CHAR/INTEGER record of around 100 bytes.
    Oracle is 10g.
    Now I am getting following sqlldr warning:
    SQL*Loader-281: Warning: ROWS parameter ignored in parallel mode.
    Cause: Specifying save points using the ROWS parameter is
    not supported for parallel loads.
    Action: Remove the ROWS parameter from the command-line
    arguments or specify a non-parallel direct load to have save
    points performed.
    Hence my question is, which of the two is faster?
    I could either:
    - trigger a direct load with TRUNCATE in the control file, and rows=&lt;total number of rows&gt;
    or
    - truncate table before loading, trigger a parallel load, APPEND, and give sqlldr potentially separate files in the correct parallellism that it can handle (so, e.g., 16 small files)
    thanks
    Arne

    Hi,
    1. Go to WAD.
    2. Open any web template ( Search for * analysis )
    3. Select one template .
    4. Save as ..new name
    5. In the data provider change the data provider name and change the report name.
    6. test it .
    5. If you want to chane the layout and all , go to DHTML code and change as per your requirement .
    6. You can directly publish it from Query also ..it is fast .This will directly attach to your portAL.
    Regards
    Nilesh

  • Load two input file into One Target table through SQL LOADER

    Hi Expert,
    I have 2 .cvs files.
    1st file having cols as account_no & first name
    2nd file having cols as account_no & last name
    There is a table called temp has 3 cols accounts_number first name & last name
    accounts number in both files are same
    Now I wann upload these 2 files in to table temp
    how do I do that
    Pls suggest
    Thx
    Umesh Goel

    UG wrote:
    I dont want truncate my table bcoz account no and first name from first file and last name from second file.
    so pls suggest something else....Hang on, I'll go find you some glasses. I think you're having trouble reading.
    First file : Control file truncates and loads data
    Second file : Control file does not truncate and loads data
    2 Calls to SQL*Loader
    Is that a little clearer?
    Are you saying there is a relationship between the data in the two files?
    How do you know which last name relates to which first name in the first file? Is there a reference key between the records on the two files?
    Perhaps you'd better show us an example of the contents of the files so we can see what you are trying to do.

  • Loading leap year date using SQL*Loader

    Hello,
    I have a problem loading a date '29/02/2000' using SQL*Loader. This date is on a leap year. I'm getting an error message from SQL*Loader as 'ORA-01839: date not valid for month specified'. My colleague and I have tried using various date functions to convert the data into date, but no luck.
    I would appreciate any helps,
    Bruce

    Thanks for your help, I found the bug on my control file. I was using the RTRIM function to remove bad timestamp such as '29/02/2000 0:00:00'. So instead of using this statement:
    LOG_DATE DATE "DD/MM/RRRR" "RTRIM(:LOG_DATE,'0:00:00')"
    I was using the statement below with a space before the '0:00:00' string literal, with the intention to remove a space also:
    LOG_DATE DATE "DD/MM/RRRR" "RTRIM(:LOG_DATE,' 0:00:00')"
    Well, it turned out that if there was a space before the string literal, RTRIM function would trim the matching string plus any '0' characters from the right, including the '000' that belongs to '2000'. Thus, the error.
    Thanks again,
    Bruce

  • Load XML File into temporary tables using sql loader

    Hi All,
    I have an XML file as below. I need to insert the contents into a temporary staging table using sql loader. Please advice how I need to do that.
    For example Portfolios should go into a seperate table, and all the tags inside it should be populated in the columns of the table.
    Family should go into a seperate table and all the tags inside it should be populated in the columns of the table.
    Similarly offer, Products etc.
    - <ABSProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <ProductSalesHierachy>
    - <Portfolios>
    - <Portfolio productCode="P1">
      <Attribute name="CatalogProductName" value="Access" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
    - <Portfolio productCode="P2">
      <Attribute name="CatalogProductName" value="Data" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
    - <Portfolio productCode="P3">
      <Attribute name="CatalogProductName" value="Voice" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
    - <Portfolio productCode="P4">
      <Attribute name="CatalogProductName" value="Wireless" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
      </Portfolios>
    - <Families>
    - <Family productCode="F1">
      <Attribute name="CatalogProductName" value="Internet Access Services" />
      <Attribute name="Status" value="Active" />
    - <ParentHierarchy>
      <Item productCode="P1" modelType="Portfolio" />
      </ParentHierarchy>
      </Family>
    - <Family productCode="F2">
      <Attribute name="CatalogProductName" value="Local Access Services" />
      <Attribute name="Status" value="Active" />
    - <ParentHierarchy>
      <Item productCode="P2" modelType="Portfolio" />
      </ParentHierarchy>
      </Family>
      </Families>
    - <SubFamilies>
    - <SubFamily productCode="SF1">
      <Attribute name="CatalogProductName" value="Business Internet service" />
      <Attribute name="Status" value="Active" />
    - <ParentHierarchy>
      <Item productCode="F1" modelType="Family" />
      </ParentHierarchy>
      </SubFamily>
      </SubFamilies>
    - <ProductRefs>
    - <ProductRef productCode="WSP1" modelType="Wireline Sales Product">
      <ActiveFlag>Y</ActiveFlag>
    - <ProductHierarchy>
      <SalesHierarchy family="F1" subFamily="SF1" portfolio="P1" primary="Y" />
      <SalesHierarchy family="F2" portfolio="P2" primary="N" />
      <FinancialHierarchy quotaBucket="Voice" strategicProdCategory="Local Voice" />
      </ProductHierarchy>
      </ProductRef>
    - <ProductRef productCode="MSP2" modelType="Handset">
      <ActiveFlag>Y</ActiveFlag>
    - <ProductHierarchy>
      <SalesHierarchy portfolio="P4" primary="Y" />
      </ProductHierarchy>
      </ProductRef>
      </ProductRefs>
      </ProductSalesHierachy>
    - <Offers>
    - <Offer productCode="ABN">
      <OfferName>ABN</OfferName>
      <OfferDescription>ABN Description</OfferDescription>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      </Segments>
      <OfferUpdateDate>2009-11-20</OfferUpdateDate>
      <ActiveFlag>Y</ActiveFlag>
      </Offer>
    - <Offer productCode="OneNet">
      <OfferName>OneNet</OfferName>
      <OfferDescription>OneNet Description</OfferDescription>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      <Segment>PCG2</Segment>
      </Segments>
      <OfferUpdateDate>2009-11-20</OfferUpdateDate>
      <ActiveFlag>Y</ActiveFlag>
      </Offer>
      </Offers>
    - <Products>
    - <Product productCode="WSP1" modelType="Wireline Sales Product">
      <ProductName>AT&T High Speed Internet</ProductName>
      <ProductDescription>High Speed Internet</ProductDescription>
      <LegacyCoProdIndicator>SBC</LegacyCoProdIndicator>
      <RevenueCBLCode>1234B</RevenueCBLCode>
      <VolumeCBLCode>4567A</VolumeCBLCode>
      <SAARTServiceIDCode>S1234</SAARTServiceIDCode>
      <MarginPercentRequired>Y</MarginPercentRequired>
      <PercentIntl>%234</PercentIntl>
      <UOM>Each</UOM>
      <PriceType>OneTime</PriceType>
      <ProductStatus>Active</ProductStatus>
      <Compensable>Y</Compensable>
      <Jurisdiction>Everywhere</Jurisdiction>
      <ActiveFlag>Y</ActiveFlag>
    - <Availabilities>
      <Availability>SE</Availability>
      <Availability>E</Availability>
      </Availabilities>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      </Segments>
      <VDIndicator>Voice</VDIndicator>
      <PSOCCode>PSOC 1</PSOCCode>
      <USBilled>Y</USBilled>
      <MOWBilled>N</MOWBilled>
      <ProductStartDate>2009-11-20</ProductStartDate>
      <ProductUpdateDate>2009-11-20</ProductUpdateDate>
      <ProductEndDate>2010-11-20</ProductEndDate>
    - <AliasNames>
      <AliasName>AT&T HSI</AliasName>
      <AliasName>AT&T Fast Internet</AliasName>
      </AliasNames>
    - <OfferTypes>
      <OfferType productCode="ABN" endDate="2009-11-20" />
      <OfferType productCode="OneNet" />
      </OfferTypes>
    - <DynamicAttributes>
    - <DynamicAttribute dataType="String" defaultValue="2.5 Mbps" name="Speed">
      <AttrValue>1.5 Mbps</AttrValue>
      <AttrValue>2.5 Mbps</AttrValue>
      <AttrValue>3.5 Mbps</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="TransportType">
      <AttrValue>T1</AttrValue>
      </DynamicAttribute>
      </DynamicAttributes>
      </Product>
    - <Product productCode="MSP2" modelType="Handset">
      <ProductName>Blackberry Bold</ProductName>
      <ProductDescription>Blackberry Bold Phone</ProductDescription>
      <LegacyCoProdIndicator />
      <RevenueCBLCode />
      <VolumeCBLCode />
      <SAARTServiceIDCode />
      <MarginPercentRequired />
      <PercentIntl />
      <UOM>Each</UOM>
      <PriceType />
      <ProductStatus>Active</ProductStatus>
      <Compensable />
      <Jurisdiction />
      <ActiveFlag>Y</ActiveFlag>
    - <Availabilities>
      <Availability />
      </Availabilities>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      </Segments>
      <VDIndicator>Voice</VDIndicator>
      <PSOCCode />
      <USBilled />
      <MOWBilled />
      <ProductStartDate>2009-11-20</ProductStartDate>
      <ProductUpdateDate>2009-11-20</ProductUpdateDate>
    - <AliasNames>
      <AliasName />
      </AliasNames>
    - <OfferTypes>
      <OfferType productCode="ABN" />
      </OfferTypes>
    - <DynamicAttributes>
    - <DynamicAttribute dataType="String" name="StlmntContractType">
      <AttrValue />
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="BMG 2 year price">
      <AttrValue>20</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="MSRP">
      <AttrValue>40</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="BMGAvailableType">
      <AttrValue />
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="ProductId">
      <AttrValue>123456</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="modelSource">
      <AttrValue>product</AttrValue>
      </DynamicAttribute>
      </DynamicAttributes>
      </Product>
      </Products>
      <CatalogChanged>Y</CatalogChanged>
      </ABSProductCatalog>

    Two options that come to mind. Others exist.
    #1 - {thread:id=474031}, which is basically storing the XML in an Object Relational structure for parsing
    #2 - Dump the XML into either an XMLType based table or column and use SQL (with XMLTable) to create a view that parses the data. This would be the same as the view shown in the above post.
    Don't use sql*loader to parse the XML. I was trying to find a post from mdrake about that but couldn't. In short, sql*loader was not build as an XML parser so don't try to use it that way.

  • Sql Loader - Decimal numbers showing in null column

    Greetings,
    My apologies if this is in the wrong forum section. It seemed to be the most logical.
    I have added new column to a control file used in a sql loader upload and I am getting unexpected results. Long story short, I copy foxpro tables from a network directory to my local pc. A foxpro exe converts these tables to .dat files. Sql loader then uploads the .dat files to matching oracle tables. I've run this program from my pc for years with no problems.
    Problem now: We added a new column to a foxpro table and to the matching oracle table. This column in FoxPro in null for now - no data at all. I then added the new column to my ctl file for this table. The program runs, sql loader does it's thing with no errors. However, in the new field in Oracle, I'm finding decimal numbers in many of the records, when all records should have null values in this field. I've checked all other columns in the oracle table and the data looks accurate. I'm not sure why I'm getting these decimal values in the new column.
    My log and bad files show no hints of any problems. The bad file is empty for this table.
    At first I thought the positioning of the new column in the fox table, .ctl file and the oracle table were not lining up correctly, but I checked and they are.
    I've double checked the FoxPro table and all records for this new column are null.
    I'm not sure what to check for next or what to test. I am hoping someone in this forum might lend a clue or has maybe seen this problem before. Below is my control file. The new column is the last one: fromweb_id. It is a number field in both FoxPro and Oracle.
    Thanks for any advise.
    JOBS table control file:
    load data
    infile 'convdata\fp_ora\JOBS.dat' "str X'08'"
    into table JOBS
    fields terminated by X'07'
    TRAILING NULLCOLS
    (SID,
    CO_NAME "replace(replace(:CO_NAME,chr(11),chr(10)),chr(15),chr(13))",
    JOB_TITLE "replace(replace(:JOB_TITLE,chr(11),chr(10)),chr(15),chr(13))",
    CREDITS,
    EARN_DATE date "mm/dd/yyyy",
    COMMENTS CHAR(2000) "replace(replace(:COMMENTS,chr(11),chr(10)),chr(15),chr(13))",
    DONT_SHOW,
    PC_SRC "replace(replace(:PC_SRC,chr(11),chr(10)),chr(15),chr(13))",
    PC_SRC_NO,
    SALARY,
    SALFOR,
    ROOM,
    BOARD,
    TIPS,
    UPD_DATE date "mm/dd/yyyy hh12:mi:ss am",
    STUKEY,
    JOBKEY,
    JO_COKEY,
    JO_CNKEY,
    JO_ZUKEY,
    EMPLID,
    CN_NAME "replace(replace(:CN_NAME,chr(11),chr(10)),chr(15),chr(13))",
    JOB_START date "mm/dd/yyyy",
    JOB_END date "mm/dd/yyyy",
    FROMWEB_ID)

    I apologize for not explaining how this was resolved. Sql Loader was working as it should.
    The problem was due to new fields being added to the FoxPro table, along with the fromweb_id column, that I was not informed about. I was asked to add a column named fromweb_id to the oracle jobs table and to the sql-loader program. I was not told that there were other columns added at the same time. In the foxpro table, the fromweb_id column was the last column added.
    The jobs.dat file contained data from all columns in the foxpro table, including all the new columns. I only added the "fromweb_id" to the control file, which is what I was asked to do. When it ran, it was getting values from one of the new columns and the values were being uploaded into the fromweb_id column in Oracle. It is that simple.
    When I had checked the FoxPro table earlier, I did not pickup on the other new columns. I was focussing in on looking for values in the fromweb_id column. When back-tracing data in the jobs.dat file, I found a value in the fromweb_id column that matched a value in a differnt column (new column) in FoxPro. That is when I realized the other new columns. I instantly knew what the problem was.
    Thanks for all the feedback. I'm sorry if this was an inconvenience to anyone. I'll try to dig a little deeper next time. Lessons learned...
    regards,

  • Control file for SQL*Loader

    Hello,
    I have the following file (2 line) which I want to intend in an oracle database with the SQL*Loader.
    tommy050+3423
    tom 070-0006
    The file consists of two lines and three columns.
    Column1 has always 5 digits and is a String. Additional empty digits will be filled with blanks. Here: “tommy” and “tom “
    Column2 has three digits and is a number. Here: “050” and “070”.
    Column 3 is also a number and consists of four digits. Additionally there is a fifth digit for the leading sign ("+" or "-"). Here: “+3423” and “-0006”.
    This file I want to import in my table “MyTab”.
    MyTab(
         thing          VARCHAR2(5)
         number     NUMBER(3)
         amount     NUMBER
    How would the control file for the SQL*Loader look like for this example?
    Regards
    Homer

    This is a start (untested)
        LOAD DATA
        INFILE 'sample.dat'
        BADFILE 'sample.bad'
        DISCARDFILE 'sample.dsc'
        APPEND
        INTO TABLE MyTab
          ( thing POSITION(1:5)  CHAR ,
           NUMBER    POSITION(6:8)  INTEGER,
           amount POSITION(9:12) INTEGER  )Can you have a column named number?

  • SQL* Loader to load data format into tables??????

    Hi,
    Hai I am very much new to Oracle. I am trying to load data into a table using SQL*Loader and i getting error while it is using the data format.
    the format used in data file is "Sep 6 2001 12:00:00:000AM"
    and when i used to_date( :accountDate, 'YYYY-MM-DD HH:MI:SS AM or PM') function it throws me an exception like
    "ORA-01821: date format not recognized". so anybody can help me to insert data with out changing the data file, whould be really helpfull
    thanks
    vijay

    Also it looks like you need to change your date format mask.
    If your data is formatted as "Sep 6 2001 12:00:00:000AM"
    then you should use to_date( :accountDate, 'Mon DD YYYY HH:MI:SSAM')
    This will work with a two digit second field, but not a three digit second field.

  • How can we tell if SQL*Loader is working on a TABLE?

    We have a process that requires comparing batches with LDAP information. Instead of using an LDAP lookup tool, we get a nightly directory file, and import the two COLUMNs we want via SQL*Loader (REPLACE) into an IOT. Out of three cases, two just check the first COLUMN, and the third needs the second COLUMN as well.
    We did not think of using External TABLEs, because we cannot store files on the DB server itself.
    The question arises, what to do while the file is being imported. The file is just under 300M, so it takes a minute or so to replace all the data. We found SQL*Loader waits until a transaction is finished before starting, but a query against the TABLE only waits while it is actually importing the data. At the beginning of SQL*Loader's process, however, a query against the TABLE returns no rows.
    The solution we are trying right now is, to have the process that starts SQL*Loader flip a flag in another TABLE denoting that it is unavailable. When it is done, it flips it back, and notes the date. Then, the process that queries the information, exits if the flag is currently 'N'.
    The problem, is, what if SQL*Loader starts inbetween the check of the flag, and the query against the TABLE. How do we guarantee that it is still not being imported.
    I can think of three solutions:
    1) LOCK the ldap information TABLE before checking the flag.
    2) LOCK the record that the process starting SQL*Loader flips.
    3) Add a clause to the query against the TABLE checks that there are records in the TABLE (AND EXISTS(SELECT * FROM ldap_information).
    The problem with 3) is that the process has already tagged the batches (via a COLUMN). It could, technically reset them afterwards, but that seems a bit backwards.

    Just out of curiosity, are you aware that Oracle supplies a DBMS_LDAP package for pulling information from LDAP sources? It would obviously be relatively easy to have a single transaction that deletes the existing data, loads the new data via DBMS_LDAP, and commits, which would get around the problem you're having with SQL*Loader truncating the table.
    You could also have SQL*Loader load the data into a staging table and then have a second process either MERGE the changes from the staging table into the real table (again in a transactionally consistent manner) or just delete and insert the data.
    Justin

  • How to do it with SQL Loader

    All,
    I have two tables HEADER_TABLE and LINE_TABLE. Each header record can have multiple line records. I have to load data from a flat file to these tables.Flat file can have two types of records. H-Header, L-Line. It looks as follows.. Each H record can have multiple corresponding L records
    H..........
    L.......
    L......
    L......
    H.........
    L.......
    L......
    L......
    I have HEADER_ID column in HEADER_TABLE and HEADER_ID, LINE_ID columns in the LINE_TABLE.
    While loading data using SQL Loader, I need to generate HEADER_ID and LINE_ID values as follows and load them.
    H..........<HEADER_ID = 1>
    L....... <HEADER_ID = 1><LINE_ID = 1>
    L...... <HEADER_ID = 1><LINE_ID = 2>
    L...... <HEADER_ID = 1><LINE_ID = 3>
    H......... <HEADER_ID = 2>
    L....... <HEADER_ID = 2><LINE_ID = 4>
    L...... <HEADER_ID = 2><LINE_ID = 5>
    L...... <HEADER_ID = 2><LINE_ID = 6>
    Is it possible to do this with SQL LODER?
    I tried to do this with sequences. But it loaded the tables as follows.
    H..........<HEADER_ID = 1>
    L....... <HEADER_ID = 1><LINE_ID = 1>
    L...... <HEADER_ID = 1><LINE_ID = 2>
    L...... <HEADER_ID = 1><LINE_ID = 3>
    H......... <HEADER_ID = 2>
    L....... <HEADER_ID = 1><LINE_ID = 4>
    L...... <HEADER_ID = 1><LINE_ID = 5>
    L...... <HEADER_ID = 1><LINE_ID = 6>
    Thanks
    Ketha

    Morgan,
    Examples given in the link are quite generic and I have tried them. But my requirement is focused on generating header_id and line_id values as i have described. It seems that SQLLDR scans all records for a particular WHEN clause and insert them into the specified table. I think that if SQLLDR is made to read recod in the data file sequentially, this can be done.
    ANy idea of how to make SQLLDR read the records from the file sequentially?
    Thanks
    Ketha

Maybe you are looking for

  • Move/play/auth iTunes TV shows from eMac to PC running windows ME?

    How can I play the tv shows I've downloaded, on to my emac, on the PC. Itunes doesnt support ME. Do I need to be connected to itunes store to authorize PC? Do I need a certain version of QT (like the mac) to play tv shows on PC? Thank you in advance

  • I need emergency help...

    +This is my first post on here so please be gentle!+ Yesterday I installed the latest version of OS X onto my Mac Mini (I've had it for ages though on my MBP) I stupidly installed Windows XP SP 1 with a partition of only 8GB (because it wouldn't take

  • Artboards and origin

    Hi, I'm trying to draw some objects to fixed positions on artboards by first setting the document origin to the top - left position of the artboard. However this seems to work for some of the artboards but not for all. Sample code: #target illustrato

  • ACE to load balance Citrix servers

    Hello, Have anyone configured ACE Modules to load balance Citrix Servers (HTTP) ? Any special considerations needed? Many thanks,

  • Please Recommend reliable USB Hub?

    RE: Please recommend reliable USB Hub? It seems not all "Hi-Speed-give-me-a-break-where-are-my-firewire-ports-Steve-dangit" USB devices ports are linking up so easily as advertised these days, at least not for me. 1.0_I Am Looking for a reliable USB