SQLLDR: Using " in column expression

Hi,
My control file file something like
OPTIONS (SKIP=1)
LOAD DATA
APPEND INTO TABLE TEST
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
title
,PERIOD "replace(:PERIOD,'\"','')"
The problem is it throws error " ORA-01008: not all variables bound"
If I changes "replace(:PERIOD,'\*"*','')" to something like "replace(:PERIOD,'\*$*','')" (Note " replaced by $ in replace then there is no error.
Has anyone used " in sql expression?
I am on oracle 9i
Thanks in advance.

Thanks Walter for the response. IF both columns are of same data type and length then it wont matter. But even if I f swap the column in data and control file the error is still there. Here's details:
Content of test.csv:
$ cat test.csv
period,title
"10-Nov-2005",hi
"12-Nov-2009",so
$ cat test.ctl
OPTIONS (SKIP=1)
LOAD DATA
APPEND INTO TABLE TEST
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
PERIOD "replace(:PERIOD,'\"','')"
,title
$sqlldr apps/apps control=test.ctl data=test.csv discard=d.dsc bad=b.bad log=l.log
SQL*Loader: Release 8.0.6.3.0 - Production on Wed Aug 5 10:39:10 2009
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Commit point reached - logical record count 2
$ cat l.log
SQL*Loader: Release 8.0.6.3.0 - Production on Wed Aug 5 10:39:10 2009
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Control File: test.ctl
Data File: test.csv
Bad File: b.bad
Discard File: d.dsc
(Allow all discards)
Number to load: ALL
Number to skip: 1
Errors allowed: 50
Bind array: 64 rows, maximum of 65536 bytes
Continuation: none specified
Path used: Conventional
Table TEST, loaded from every logical record.
Insert option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
PERIOD FIRST * , O(") CHARACTER
TITLE NEXT * , O(") CHARACTER
Column PERIOD had SQL string
"replace(:PERIOD,'"','')"
applied to it.
Record 1: Rejected - Error on table TEST.
ORA-01008: not all variables bound
Record 2: Rejected - Error on table TEST.
ORA-01008: not all variables bound
Table TEST:
0 Rows successfully loaded.
2 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.
Space allocated for bind array: 33024 bytes(64 rows)
Space allocated for memory besides bind array: 0 bytes
Total logical records skipped: 1
Total logical records read: 2
Total logical records rejected: 2
Total logical records discarded: 0
Run began on Wed Aug 05 10:39:10 2009
Run ended on Wed Aug 05 10:39:10 2009
Elapsed time was: 00:00:00.04
CPU time was: 00:00:00.00
SQL> desc test
Name Null? Type
TITLE VARCHAR2(20)
PERIOD VARCHAR2(40)
Thanks,
Bal

Similar Messages

  • Aggregate functions cannot be used in group expressions

    Hi have report showing sales by Vendor. I need to list all the vendors with Monthly Total>5000 and combine the rest as "OTHER VENDORS"
    Vendor is a Group in my report, so I tried to put an expression as a Group on:
    =IIF(Sum(Fields!Mth_1_Sales.Value)>5000,Fields!Vendor_No.Value,"OTHER VENDORS")
    I've got an error: "aggregate functions cannot be used in group expressions"
    How do I get Vendors with Sales < 5000 into  "OTHER VENDORS" ?

    Hi,
    You need to group by Month on group expression,
    And you can use the same expression in the report column as 
    =IIF(Sum(Fields!Mth_1_Sales.Value)>5000,Fields!Vendor_No.Value,"OTHER VENDORS")
    Many Thanks
    ..................................................................................................................................................................Please
    mark the post as Please mark the post as answered if this post helps to solve the post.

  • Column expression @ dasboard level not divideing by correct totals.

    Having a problem with a column measure at dashboard level. I read a post regarding using a union to fix… but wasn't sure that was the right approach for this issue.
    We have columns 1, 2, A, B, C, values for A and C are within different Fact Dimensions, but do relate back to the common dimensions
    Column A only shows values that are > 0, which limits back values on column C
    Colman B uses an expression of C/A.
    We have table view result totals on Row 1 and 2
    Columns A & C are correct at the total levels, however column B isn’t. it appears that the C value for the expression ‘A/C’ at the total levels is a sum of all the rows for that fact not JUST the rows that match the A > 0 filter.
    Expect this:
    A     B     C
    10     3     30
    20     3     60
    30     3     90
    But get this:
    A     B     C
    10     3     30
    20     3     60
    30     *4.8*     90
    When we change the filter to A >=0 we see extra values in the C column
    A     B     C
    *0*          *15*
    10     3     30
    20     2     60
    *0*          *40*
    30     4.8     145
    I was thinking that I need to modify the column expression with a case statement to limit back the values or something but wanted to put this out there in case I’m missing something or aggregate function I just don’t know about to get back the expected results…
    Running 7.9.6 on 10g
    This was the post i was referring to... OBIEE Answers - Divide two columns from the sum of a union
    Edited by: jeremy21 on Dec 9, 2010 1:45 PM

    I'm assuming like your problem is in you are using a union request for getting the grand total. But in Grand total you aeg etting the results wrong.
    IF yes, then your solution might be this,
    in column B in the grand total criteria, use the formula as,
    sum(C by)/sum(A by)
    and apply the filter as A>0

  • Display function Reset in RPD logical column expression

    Hello All,
    I want to reset display function like below in RPD's logical column expression (Its OBIEE 111171) . I am able to use reset RMIN value using "BY" syntax within obiee report but not able to apply same in RPD expression builder)
    RMIN (COLX BY COLB)
    Any idea ???
    Thanks in advance.
    -Devendra

    Exactly. As I wrote, B contains some functions (mainly SUBSTR and CAST) that depend on other columns from the same dimension (all other colums are physical).
    Funny thing is, when I drag D01.B into the analysis alone, it works all fine... Adding a measure also leads to the said error.

  • Aggregation in column expression is not working in 11.1.1.7.1

    Hi Guru's,
    After upgrading the application from 11.1.1.6.8 to 11.1.1.7.1 Aggregations in the column expression is not working. I was using the below formula in the column expression
    100.0* (Sum((CASE WHEN Service Level >= 60 THEN 1 ELSE 0 END)) / COUNT(DISTINCT(HOUR_INTERVAL)))
    I am getting the answer but the values are very high compare. I tried using just Sum((CASE WHEN Service Level >= 60 THEN 1 ELSE 0 END) it also giving very high values.
    Please let me know is there is a bug or something need to setup.
    Regards
    @li

    bug 16616127 has been fixed in 11.1.1.7.1
    make sure you refresh the catalog to upgrade to your version

  • Convert SQL Query to Derived Column Expression

    I'm in the process of reworking some SSIS packages I inherited. A lot of these use Execute SQL Statement components to update certain fields in the tables once they've been loaded. I'd like to replace these individual UPDATE statements with Derived Column
    components.
    I've got 95% of them converted, except for a couple, one of which has me a bit perplexed and was hoping someone could provide some insight.
    Essentially, there is a column called POSTPERIOD which is a date in string format YYYYMM (i.e., 201503). The SQL update parses out the month piece and converts it to the month name and populates a column called POSTPERIOD_MONTH.
    Here is the SQL:
    select DateName(month , DateAdd(month, CONVERT(INT, SUBSTRING(POST_PERIOD,5,2)), 0 ) - 1 )
    I'd like to accomplish this using a Derived Column, but not sure how to go about doing this...
    If someone could point me in the right direction, it would be greatly appreciated!
    Thanks!
    A. M. Robinson

    Visakh:
    Thank you for the reply! I've tried your solution but am getting the following error(s):
    Warning 17 Validation warning. Populate STAGING_DIM_AP_DETAIL - RADIO: {ACAA99C4-272C-4641-BF44-B4D4409D1EFB}: The expression "(DT_STR,8,1252)((DT_I4)[SUBSTRING](#85,5,2) == 1 ? (DT_STR,8,1252)"January" : ((DT_I4)[SUBSTRING](#85,5,2)
    == 2 ? (DT_STR,8,1252)"February" : ((DT_I4)[SUBSTRING](#85,5,2) == 3 ? (DT_STR,8,1252)"March" : ((DT_I4)[SUBSTRING](#85,5,2) == 4 ? (DT_STR,8,1252)"April" : ((DT_I4)[SUBSTRING](#85,5,2) == 5 ? (DT_STR,8,1252)"May" :
    ((DT_I4)[SUBSTRING](#85,5,2) == 6 ? (DT_STR,8,1252)"June" : ((DT_I4)[SUBSTRING](#85,5,2) == 7 ? (DT_STR,8,1252)"July" : ((DT_I4)[SUBSTRING](#85,5,2) == 8 ? (DT_STR,8,1252)"August" : ((DT_I4)[SUBSTRING](#85,5,2) == 9 ? (DT_STR,8,1252)"September"
    : ((DT_I4)[SUBSTRING](#85,5,2) == 10 ? (DT_STR,8,1252)"October" : ((DT_I4)[SUBSTRING](#85,5,2) == 11 ? (DT_STR,8,1252)"November" : (DT_STR,8,1252)"December")))))))))))" will always result in a truncation of data. The expression
    contains a static truncation (the truncation of a fixed value).   Dimension Finance - Load STAGING_DIM_AP_DETAIL_DERIVED_COLUMNS.dtsx 0 0 
    This is the derived column expression I'm using:
    (DT_STR,8,1252) ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 1? (DT_STR,8,1252) "January" : ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 2 ? (DT_STR,8,1252) "February" : ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 3 ? (DT_STR,8,1252) "March" :((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 4 ? (DT_STR,8,1252) "April":((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 5 ? (DT_STR,8,1252) "May" : ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 6 ? (DT_STR,8,1252) "June" : ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 7 ? (DT_STR,8,1252) "July" : ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 8 ? (DT_STR,8,1252) "August":((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 9 ? (DT_STR,8,1252) "September":((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 10? (DT_STR,8,1252) "October": ((DT_I4)SUBSTRING([POST_PERIOD],5,2) == 11 ? (DT_STR,8,1252) "November" : (DT_STR,8,1252)"December")))))))))))
    Some info that might be of some help in the matter...the POST_PERIOD field is a VARCHAR(8), the POST_PERIOD_MONTH field is also a VARCHAR(8).
    There is a computed column Any help would be appreciated once again!!!
    A. M. Robinson

  • Can we use WHO columns in Business Logic implementation

    Hi,
    Can we use WHO columns for business logic implementation..?
    From one table I need to pick up the latest record. I have a ActionDate column in the table which stores the date of the action.
    But on the same day there can be multiple action records. ie Multiple records have same ActionDate.
    Select * from action_table where action_date=(maximum action_date)
    The above query will return more than 1 record.
    Now can I use the Creation_Date which is a WHO column to identify the latest record..?
    Will it introduce any issues if I use creation_date WHO column?
    Usage of WHO column in application logic, Is it against the Standards ?
    Thanks a lot.

    I guess you are talking about populating the value using the history column creation_dt from EO.
    If so, you can use then. We are using them in all our applications to populate WHO columns of our table.
    Infact as far as I know, even Oracle application uses them.
    They generally populate the timestamp, so you may need to format them when doing date comparisons.
    Hope that helps.
    Amit

  • Can we use formula column in lexical parameter in sql query ...

    hi
    can we use formula column in lexical parameter in sql query ...
    as example
    i want to give
    select * from & c_table
    forumula
    function c_table
    if :p_sort = 1 then
    return 'dept'
    else
    return 'emp'
    end;
    c_table formula column
    is this possible ...
    i have such example in oracle apps reports
    if i try in ordinary report usinf emp table it show error ..
    how we can give formula column...
    please help me in this regard...
    Edited by: 797525 on Feb 20, 2012 9:31 PM

    thanks sir,
    iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from     mtl_demand md,     mtl_system_items msi,     mtl_txn_source_types     mtst,     mtl_item_locations loc     &C_source_from &C_from_cat
    &c_source_from and &c_from_cat formula column and there are defined at report level only ......
    pl/sql code &c_source_from is
    function C_source_fromFormula return VARCHAR2 is
    begin
    if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
    else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
    else if :P_source_type_id = 5 then
         if :C_source_where is null then
              return NULL;
         else
              return(',WIP_ENTITIES wip');
         end if;
    else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id is null then
    return(',MTL_SALES_ORDERS      mkts,
    MTL_GENERIC_DISPOSITIONS mdsp,
    GL_CODE_COMBINATIONS gl ');
    else null;
    end if; end if; end if; end if; end if; end if;
    RETURN NULL; end;
    this is forumula column i hope that you understand what iam saying
    please help me in this regard....
    thanking you...

  • To get list of materialized views/views using a column of a table

    Hi,
        I am removing sal column from table tab_emp;
    i want to check whether any materialized view or view using this column by  querying using data dictionary :-
    if i use like condition against query column of all_mviews it is throwing error sicne it is long data type.
    is there a way to search it without creating any function and use it in a query
    Thanks,
    Ajoy

    start with select * from dictionary where table_name like '%VIEW%'
    to identify appropriate dictionary views.
    Then read: Ask Tom &amp;quot;Converting Longs to LOBS&amp;quot; and Ask Tom &amp;quot;Long to Varchar2 conversion.... &amp;quot;
    to be able to search LONG descriptions for column names.
    For example:
    create table check_table as
    select owner,view_name,text_length,to_lob(text) text_lob from all_views
    Column Name
    Data Type
    Nullable
    Default
    Primary Key
    OWNER
    VARCHAR2(30)
    No
    VIEW_NAME
    VARCHAR2(30)
    No
    TEXT_LENGTH
    NUMBER
    Yes
    TEXT_LOB
    CLOB
    Yes
    select * from check_table where instr(upper(text_lob),'SAL') > 0
    OWNER
    VIEW_NAME
    TEXT_LENGTH
    TEXT_LOB
    SYS
    USER_ENCRYPTED_COLUMNS
    147
    select TABLE_NAME, COLUMN_NAME, ENCRYPTION_ALG,SALT, INTEGRITY_ALG from DBA_ENCRYPTED_COLUMNS where OWNER = SYS_CONTEXT('USERENV','CURRENT_USER')
    Regards
    Etbin

  • Concatenation error - when i use text column value in where condition.

    Hi,
    i am creating Materialized view using few columns from two tables and as per requirement i need to prepare select statement with where condition in another column.(new column)
    i tried like below....
    create materialized view MAIN
    refresh force on demand
    as
    select
    a.table_name,
    a.column_name,
    b.trial_name,
    'select * from '||a.table_name||' where '||a.column_name|| ' = '|| b.trial_name||';' "QUERY"
    from
    exp_csv_tB a,
    exp_csv_tr b;
    a.table name value is : monitoring_table
    a.column_name value is : study
    b.trial_name = fty777
    Materialized view created with extra column but it is not added '' (codes) to text value in where condition.
    output which i got is :
    select * from monitoring_table where study = fty777;
    but
    i need output like
    select * from monitoring_table where study = 'fty777';
    fty777 value should be in codes like 'fty777'. i read some articles but didnt get this example.
    please help.

    Try this:
    CREATE MATERIALIZED VIEW main
    REFRESH FORCE ON DEMAND
    AS
    SELECT
    a.table_name,
    a.column_name,
    b.trial_name,
    'select * from '||a.table_name||' where '||a.column_name|| ' = '''|| b.trial_name||'';'' "QUERY"
    FROM
    exp_csv_tb a,
    exp_csv_tr b;
    You have to give double single codes for semi-colons ..
    Regards..

  • How do i use my apple express speakers as the sound from apple tv?

    how do i use my apple express speakers as the sound from apple tv?

    Welcome to the Apple Community.
    You can't with the Apple TV 2 or 3, with the Apple TV 1, you can choose them from the Airtunes option in the settings menu.

  • How do I Extend my airport extreme using an airport express

    How do i use and airport express to extend my network off an airport extreme

    Apple's step by step instructions are here:
    http://support.apple.com/kb/HT4259
    Although two Extremes are pictured, the setup for an Express is exactly the same.
    If you are running Lion 10.7.3, you will need to download and install AirPort Utility 5.6 for Mac OS X Lion for the instructions to make sense.
    Otherwise, open Macintosh HD > Applications > Utilties > AirPort Utiltiy to start the process.

  • How do I use my Airport Express 1st generation to extend my wireless network?

    Hi all,
    I've got an old time capsule (1st gen) and a 1st gen airport express in another room with a USB printer connected.
    There's up to 100 meg broadband from a virgin hub, but that is connected by ethernet to my time capsule.  I then configured the time capsule to be a WDS base, and the airport express to be a WDS remote.
    That all worked OK.
    But the internet is incredibly slow in the office (where the Airport Express is).  Pages do load eventually, but VERY slowly!
    I asked in the apple store if it was necessary to buy new stuff, because the internet is so slow, and the guy said that the system should work if I am using the airport express to extend the network.
    I reset everything, and reconfigured as above, and it is still painfully slow.
    Any ideas?
    I don't mind ditching the time capsule as a base station and just having the AP extending the virgin hub if that'll work - or ditching the AP and using the time capsule to extend the virgin hub....or buying a new airport express and extending the virgin hub...I jsut want fast internet in my office room!
    Thanks in advance!

    To configure an AirPort Express for iTunes streaming, please check out the following Apple Support article for details.

  • How do I use my airport express to extend the wireless range of my NETGEAR 7550?

    I am trying to extend the range of my Netgear 7550 using the airport express.  When trying to set up the airport express it said that I was unable to extend the Netgear.  Any ideas how to make it work?

    You need to configure a roaming network.
    Wi-Fi base stations: Setting up and configuring a roaming network (802.11 a/b/g/n)
    http://support.apple.com/kb/HT4260

  • How do I use my airport express or time capsule to increase the signal strength of my comcast router

    How do I use my airport express and/ or time capsule to increase the range of my newly installed comcast modem/router.

    Neophite50 wrote:
    Thanks.
    A question. Do I plug the TC into the Comcast modeum Router or the iMac?
    Both is good.. but at least one of your routers.. TC or express must be plugged into the router.. the imac can get internet connection by wireless.

Maybe you are looking for

  • How to print variable in binary mode?

    I would like to print NewVar variable in binary mode e.g.: byte NewVar = 0x25; System.out.println( "print here NewVar in binary mode" ); 1) How to do it? 2) Above I declared NewVar in hexadecimal, how to declare it in binary mode? 3) Where in the net

  • Old Mac (Performa) Monitor Port to VGA adapter - how to make.

    I have to start up my late father's Performa, but the monitor is dead. Can you point me to a suitable connection diagram of a DB-15 to VGA adapter. Kind regards /Ake

  • Oracle objects

    I have created a simple Object in Oracle 8i to represent a person CREATE TYPE PERSON_T AS OBJECT ID INTEGER, FIRST VARCHAR(15), LAST VARCHAR(15) and I have created a table that uses this type as a column attribute. This worked fine and I was able to

  • Copying between layers.

    When I try to copy and paste an image from one layer to another layer in the same document, I receive the following error: "Cannot paste or place onto locked or hidden layers. Do you want to unlock and show all affected layers in order to paste?" Now

  • Reinstallation of OS has caused some of my applications to not open???

    I recently reinstalled my OS because I had a start up problem. (My computer now starts fine). I have not deleted my previous system folder but my digital photo editing program, Nikon Picture Project no longer opens. Instead, I get an error message sa