NLS_LENGTH_SEMANTICS=CHAR not effective?

Hi,
I have two Oracle 10.2.0.3 databases - DB1 & DB2.
In both, following init.ora parameter is set :- NLS_LENGTH_SEMANTICS=CHAR
In DB1, for one query i received ORA-12899: value too large for column <tbsp1>.<tb1>.<col1> (actual: 17, maximum: 16)
In DB2, for the same query, didn't face any problems.
When i compared, the same table tb1 in both databases -
For DB2:
SQL> desc tb1;
Name Null? Type
col1 VARCHAR2(30 CHAR)
col2 VARCHAR2(50 CHAR)
=======================================
For DB1:
SQL> desc tb1;
Name Null? Type
col1 VARCHAR2(30)
col2 VARCHAR2(50)
If observed, column type for DB1 is VARCHAR2(30) and for DB2 its VARCHAR2(30 'CHAR').
To give you further details - Both the databases,DB1 & DB2 are on the same OS platform, have same init.ora parameters, every configuration is same, except both are installed on different servers.
Please help me for this problem which i am facing in DB1.
Edited by: user10552003 on Jan 27, 2011 4:42 PM

If you want to change the character length semantics for all the columns, you just need a bit of dynamic SQL. Something like
DECLARE
  l_sql VARCHAR2(1000);
BEGIN
  FOR cols IN (SELECT * FROM user_tab_cols WHERE data_type = 'VARCHAR2' and char_used = 'B')
  LOOP
    l_sql :=
      'ALTER TABLE ' || cols.table_name ||
      '  MODIFY( ' || cols.column_name || ' VARCHAR2(' || cols.data_length || ' CHAR) )';
    dbms_output.put_line( l_sql );
    execute immediate l_sql;
  END LOOP;
END;If you want to change the character semantics for tables in other schemas, you'll need to run this in each schema or change the code to use DBA_TAB_COLS. I'm also not doing any exception handling here to account for situations like object tables where this code won't work correctly.
Justin

Similar Messages

  • OWB-Import does not distinguish between nls_length_semantics char and byte.

    We have a 10g-DB with UTF8 charset and nls_length_semantics=char and we've created an OWB warehouse module for 10g with several tables in it. After deploy operation for a table the column length attributs are looking nice. But if we re-import this table the varchar fields have the threefold length!
    This makes life hard for us, because sometimes it's necessary to reconcile discrepancies in development cycle and some tables have about 150 columns.
    Does anybody have suggestions?
    The OWB version is 10.1.0.3.0.
    Regards
    Ralf

    Ralf,
    Oracle stores the length of VARCHAR columns in two ways in its metadata. One is the length as required by the application, and the other is the length required to store UTF data.
    One UTF character can take upto 3 characters of storage. When OWB reads in the definition from data dictionary, it uses the actual characters allocated to the column, and thus u see a three fold increase in VARCHAR columns.
    Try this for your table
    select
    column_name, data_length, char_length
    from
    user_tab_columns
    where
    table_name='nameOfTable'
    And that is how Oracle designed the database, but unfortunately OWB does not have that twin way of seeing things.
    - Jojo

  • JDBC thin driver pads CHAR col to byte size when NLS_LENGTH_SEMANTICS=CHAR

    We're using an Oracle 9.2 database with the database character set specified as AL32UTF8 with NLS_LENGTH_SEMANTICS set to CHAR. I've reproduced this problem with both the "classes12.zip" and "ojdbc14.jar" available with the Oracle 9.2 client installation.
    The problem occurs with the JDBC thin driver. The problem does not occur with the JDBC OCI driver (nor SQL*Plus 9.2).
    There are 2 relatively simply workarounds: use the OCI driver or convert CHAR columns to VARCHAR2 columns. I'm mostly curious as to whether there is some kind of setting for the thin driver to circumvent this problem, or if this is actually expected behavior. We're not that familiar with the NLS_LENGTH_SEMANTICS setting.
    Consider a table as follows:
    create table my_table (status CHAR(1));
    If I describe the table it correctly shows the column using CHAR semantics.
    STATUS CHAR(1 CHAR)
    Given the AL32UTF8, this means that 4 bytes of storage are reserved for this column.
    If I insert a single ASCII character in this table (for example "A") then read it back using the JDBC thin driver, I get the string "A " - the letter A followed by 3 spaces. In other words, the thin driver appears to have padded the value to its BYTE length. The OCI driver and SQL*Plus do not pad the value.
    I understand that CHAR columns are normally blank padded when the data size is shorter than the defined column length, but I think that with NLS_LENGTH_SEMANTICS=CHAR, the padding should be based on the length of the column in chars, not in bytes.
    Can anyone shed some light on this issue?
    Thanks in advance,
    Tim

    Update:
    I guess I should mention we're using Java 2 SDK 1.4.1_01 on Windows XP with an Oracle 9.2 database on Windows 2000.

  • While "Invoice Cancelling- Accounting entry not effected in Trial balance"

    Dear All,
    Any one knows this please revert back.this Issue is very urgent (We have to Close the Periods)
    Issue: While "Invoice Cancelling- Accounting entry not effected in Trial balance"
    Invoice which is cancelled and accounting events for Invoice & Cancellation is taken place, but the entry for cancellation is not appearing in the GL Hence the reversal effect of expense is not seen.
    I can able to see the Reversal Entry in Payables > Reports > View Accounting A
    Here > Tools > View Accounting Events > View Journal Entries > Show Addtional Information > Transfer to GL Status is "No" after that i have Run the Transfer Journal Entries to GL even its not appearing in GL and not transfer to GL.
    @Have to Resolve this as soon as possilble, plz any one can lets guide me
    Reagrds,
    senthil

    Plz Update this asap.....

  • HT201320 This last week, I updated my iPhone with iOS6 and now my Yahoo Mail no longer works.  I've deleted and restored the account without fixing the problem.  The iOS update did not effect my iPad.  Anyone have a suggestion?

    This last week (of 17 Sep 12) I updated my iPhone 4 to iOS 6 and now my Yahoo mail does not work.  I keep getting a "Yahoo server busy" message.  This problem has not effected the update to my iPad 3 - it works fine.  In addition, I have deleted and added my Yahoo mail - same result.  Looking for ideas on repairing the link between iOS 6 and Yahoo.  Cheers

    Same here, albeit with a 3G and both a work Exchange account and personal Gmail are out of action.  Reentered my password on the Gmail to no avail.
    Unfortunately it seems that increased success has come too fast to Apple, it's starting to display Microsoft-like behaviors, e.g., releasing stuff and letting the customers serve as the beta / guinea pigs.

  • I had a second hard drive added to my Mac Pro.  How do I format it and not effect my orginal hard drive?

    I had a second hard drive added to my Mac Pro.  How do I format it and not effect my orginal hard drive?

    Just format it with Disk Utility as mentioned above.  Select the new disk on the list at the left.  Click the erase tab.  Specify Mac OS Extended (Journaled) if not already specified and give the disk a name of your choice.  Then click the erase button.
    That's the simplest way to format a disk with a single partition (volum). If you want to create multiple volume (partitions) then click the Partition tab instead of Erase.  You can then use then specify a number of volumes and size each volume by specifying its size or just dragging the slider in the bootm right of each partition.  Give each a name as before and again Mac OS Extended (Journaled).  Click Apply button to create the partitions.
    Since you appear to be new at this just "play" with the erase and partition settings so you can become comfortable with them.  So long as you have the new disk selected on the left you can't really hurt anything since it's a new disk and no data to loose.  You can always go back and erase it back to a single partition.

  • Changeover from DBM to SLM  not effecting

    Hi,
    I have created a depreciation key in transaction AFAMA with a changeover from DBM to SLM, provided when SLM depreciation is higher than DBM in 2 phases.  But when I run the depreciation for a asset, the changeover is not effecting rather it is calculating depreciation @ 50% across the life of the asset, instead of calculating the depreciation @ 25% DBM.

    Here we are not setting any changeover year, as per the req, it should compare the DBM with SLM, and whenever the SLM is higher than DBM dep, the changeover should become effective.
    Here how can we chk the changeover year?

  • Changes done in options are not effected - not able to change home page

    When I do changes in the tools-options menu the same is not effected in the next re-start of firefox. For example if I change my home page to a new web page, the same is not opening in the next restart of firefox. Not only this any change done in the options menu is not effected

    See:
    * http://kb.mozillazine.org/Preferences_not_saved
    * https://support.mozilla.com/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols

  • Scratchy noise coming from top end of keyboard. Not effecting performance but very noisy and worrying! What is it? Is my computer seriously damaged? Is it easily fixed? Thanks for any help

    Scratchy noise coming from top end of keyboard. Not effecting performance but very noisy and worrying! What is it? Is my computer seriously damaged? Is it easily fixed? Thanks for any help

    It would be helpful if you were to identify the model of MBP you have. 
    The noise makers on a MBP are the fan(s), the HDD and the optical drive.  Can you locate the exact position where the noise is coming from?
    Ciao.

  • Smart style is not effecting in smartforms print preview

    Hi All,
      i have created my smart style with HELVE font style and i have created paragraph formats for my smart style. And i assigned one of my paragraph format to header data-> standard format.
    I have used this smart style in my smart form. But while doing print preview, my smart form output is not effected by the smart style which i have given. Output is displaying in the form of  my smart styles-> header data-> standard format's  font wise. Not effecting the paragraph formats what i have given in my smart form text editor.
    could anyone  reply me how to solve this issue.
    Thanks in Advance.

    You can do one last thing from your side to ensure you are absolutely right. Open your smartstyle and create a paragraph format under paragraph node, with name P1 (for example). Now in P1, keep the font as Helve and save and ACTIVATE.
    Go back to your smartform, open the concerned text node. Select the text in it and from the drop down select P1. If you have not assigned this smartstyle to your form in attribute node, in that case you need to assign this smartstyle to your form (or in the output option tab of the text node) to get the P1 in the drop down.
    Save and activate the smartform. And let us know if it solves your issue.
    Cheers,
    Anid

  • Titles are not visible, they show up on timeline as a grey box no text  does not effect other events or projects

    titles are not visible, they show up on timeline as a grey box no text  does not effect other events or projects. could this have something to do with motion

    Without seeing the timeline it sounds as if they've been off. Maybe you pressed the V or the role is switched off in the timeline index.

  • Deleting line itmes not effecting condition records -?

    Hi Experts
    In my order first time discounts are working fine.
    If  I add any new line items then also working fine.
    But when I deleted line itmes from the order the discount is not effecting as like previous. That means when ever I deleted line item my condtion records are not reading immediately according to my settings.
    If I cahange the quantity again for the remaining line item then its working fine.
    <b>(Hope experts understand this problem)</b>
    Do I need to configure some where to effect correctly my condition record or do we need to use any user exit for the cahnge in the order or deleting the line item in the order?
    Any thoughts  will be great help ful to me.
    Thanks
    Prasad

    Hi Prasad,
    firstly whenever you add a new line item the sytem will automatically calculate the pricing for it , now as you said it is not working when you delete the line item if i am correct then why dont you double click on your line item and go to Conditions tab and there you would find out a option called update , select the second option carry out new pricing and then i think it should give you the new correct pricing.
    Hope this helps
    Cheers

  • OAS WEB FORM 9.0.4 configuration for NLS_LENGTH_SEMANTICS=CHAR

    We have NO issue using Oracle Form(Developer 2000) with Oracle Application Server Configuration with UTF8 characterset. Everything is set correctly.
    As UTF8 is multi BYTE character set, we have to find a way Oracle Form can work with NLS_LENGTH_SEMANTICS=CHAR while inserting, updating etc upon datatype value. e.g. table a has a column b with VARCHAR2(400). We need to allow users to enter 400 character. We have database set up correctly to NLS_LENGTH_SEMANTICS=CHAR
    Oracle FORM DOES WORK if we go to individual field/column(for the table) on form field property and modify SEMANTICS value from DEFAULT to CHAR.
    Is there a way we can just modify default the OAS form level configuration for SEMANTICS to save time going to each form and modifying each filed to make it work?
    Thanks in advance!
    Nirali

    Thanks a lot for quick reply!
    We also have TAR open with Oracle. I think we just have to move on to manul affort. Thanks again!
    Nirali

  • WEB(OAS) Form 10g(9.0.4) NLS_LENGTH_SEMANTICS=CHAR

    We have NO issue using Oracle Form(Developer 2000) with Oracle Application Server Configuration with UTF8 characterset. Everything is set correctly.
    As UTF8 is multi BYTE character set, we have to find a way Oracle Form can work with NLS_LENGTH_SEMANTICS=CHAR while inserting, updating etc upon datatype value. e.g. table a has a column b with VARCHAR2(400). We need to allow users to enter 400 character. We have database set up correctly to NLS_LENGTH_SEMANTICS=CHAR
    Oracle FORM DOES WORK if we go to individual field/column(for the table) on form field property and modify SEMANTICS value from DEFAULT to CHAR.
    Is there a way we can just modify default the OAS form level configuration for SEMANTICS to save time going to each form and modifying each filed to make it work?
    Thanks in advance!
    Nirali
    Edited by: user453485 on Sep 29, 2008 12:31 PM

    Thanks a lot for quick reply!
    We also have TAR open with Oracle. I think we just have to move on to manul affort. Thanks again!
    Nirali

  • IPC requirement does not effect sales order

    Hi,
    I wrote a pricing requirement  in java extending RequirementAdapter.
    I uploaded it to the CRM system. When the requirement  is called, it writes messages to the VMC log and i can see the result of the requirement  : "true" or "false" .
    The problem is that the result of the requirement  does not effect the condition in the sales order - nothing happens no matter what the result value is.
    What should I do in order to get an error message in the sales order when the requirement returns false?
    Thanks
    Tomer

    Hi Michael,
    If the requirement will not trigger any error message by default according to the returned value, what excaly do I need to do in order to achieve that? Is there a BADI or user exist  where I can check the returned value and raise the message?
    Thanks,
    Tomer

Maybe you are looking for