Oracle Number Precision  format

Hi,
I have one doubt regarding Oracle Number format .
If the Number format is (4,2) ,Its accepting total 5 Bytes.
But if its 16,6 Its accepting 16 Bytes only . Its able to save numbers in 9,6 or 10,5 . Could you please me know Why it is so.
Regards
-

user8873073 wrote:
Sorry for the Confusion .
here are the details .
Say if the field type is 4,2 , It's accepting 12.34 ( total length 5)
If the field length is 16,6 , From the above scenario , I am expecting to enter a data of length 17 . But Its possible to enter value of length 16 only.
On trying to save 1234567890.123456 , its rounding off and displaying as 1234567890.12346 (5 missed) in table.Remember numbers are stored in an internal non-human readable format in Oracle. When you select a numeric
column in your client it has to convert it to a form you can read. The default format for your client is probably
rounding the result for you.
Try using a to_char around the numeric column like to_char(col, '9999999999.999999').
By the way, the '5' isn't missed in your example, it is simply rounding the .123456 bit to .12346 (rounding to 5 decimal places).
SQL> create table test_number (
  2  num number(16,6)
  3  );
Table created
SQL> insert into test_number
  2  values(1234567890.123456);
1 row inserted
SQL> select to_char(num,'9999999999.999999')
  2  from test_number;
TO_CHAR(NUM,'9999999999.999999
1234567890.123456
SQL> select to_char(num,'9999999999.99999')
  2  from test_number;
TO_CHAR(NUM,'9999999999.99999'
1234567890.12346Notice the difference in the last example.

Similar Messages

  • Oracle Number and Java Format Mask Issue

    I have a oracle number column, in my view object it is of type BigDecimal and the query column type is NUMBER
    I put the following format mask in the hints section
    #####.00
    with a format type of Number,
    Yet when I run the application, I always get the following error
    java.lang.NumberFormatException: For input string: "-3750.00"
    Anyone any ideas why this does not work?
    Regards
    Orlando

    Hi,
    try with <af:convertNumber>
    See:
    http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_convertNumber.html
    ADF 11.1.1.4.0 af:convertNumber not working with #,##,##,##,##,##,##0.00

  • ERROR:number precision too large (WWV-16016)

    Hi!
    As I try to insert values into form items an error accurs:
    ORA-06502: PL/SQL: numeric or value error: number precision too
    large (WWV-16016)
    P.S.-One form item inserts values into database table where
    column is VARCHAR2, lenght 2000...
    How can I fix this error?Thank you in advance!

    Table Structure:
    ID NUMBER (5,0) , DATE_T1 DATE, ID_PROFESOR NUMBER(5,0), SUBJECT
    VARCHAR2(50), MESSAGE VARCHAR2(2000).
    The error accurs for example if I try to insert:
    ID=1,DATE_T1=6.6.2001, ID_PROFESOR=3, SUBJECT="New uniforms",
    MESSAGE="bla,bla,bla..."
    I'm using Oracle portal version 8.1.2.
    I hope, this will help you!

  • Error: PLS-00216: NUMBER precision constraint must be in range (1 .. 38)

    While compiling one package i am getting the error>
    PLS-00216: NUMBER precision constraint must be in range (1 .. 38)
    The declaration is:
    lServerImportRetVal          number(40);
    Database is Oracle10gdb.
    Do i resize the variable to 38... is that advisable.?

    last option is to change... Your only option is to change: Oracle supports a maximum of 38 digits.
    (Why do you think you need 40 digits? What astronomical number are we talking about?)

  • Oracle NUMBER column retreived as System.Double instead of System.Decimal

    We've been using the OleDb Managed Provider for some time now, and all oracle NUMBER datatypes have always come back from the db as System.Decimal.
    we recently installed a new database, and now NUMBER comes back as System.Double. The table create scripts are the same for the new db. The client is not the issue as I can point the same web server at the old db and it works fine.
    I've been unable to find any documentation on the subject.

    I have the same problem also. I'm using VC++6.0 and ADO 2.71 to perform queries with an Oracle Client 9.2.0.1. The same query on same table but on different Server version returns different results. With the production server, which is an 8.1.7.4 server, a NUMBER column returns a LONG value, while on the Test server, which is a 9.2.0.5.0 server, the same column returns a DOUBLE value. The problem is that using ADO I don't check data type/size when getting values, but I aspect a LONG value because a created the column with NUMBER specification. Could this be a different default from previous server version when creating the NUMBER column without any SCALE and PRECISION attributes?

  • How to control the number precision???

    Hi guys,
    I have a number 350.00
    I need to make 350.0
    How to do that on LV8.6?
    thanks in advance.

    testas123 wrote:
    However it is very bad that LabVIEW does not have NUMBER precision control (decimal point)!!! shame!
    Well, you can always write your own subVI with a few strokes of the mouse.
    If you are talking about truncation (a data operation) and not formatting (a cosmetic issues), be aware that many nice and round decimal digits cannot be correctly represented in binary, so you might still be slightly off when you would display e.g. 16 decimal digits.
    LabVIEW Champion . Do more with less code and in less time .

  • RE: Oracle DATE data format conversion..

    <C.M> Motta's question about dates and oracle>
    Dealing with dates and Oracle is somewhat of a nuisance. Oracle is very
    particular about how date strings are formatted, and if you get it wrong,
    you get the (unhelpful) message that C.M. Motta showed us. However, if
    you pass a DateTimeData to Oracle, Forte' does the right formatting for you.
    If you do need to format the date prior to interacting with Oracle, use the
    following format:
    dd-mmm-yy <time component>
    You can change the default format, but it is not easy.
    If you customise Express generated code that interacts with an Oracle
    database, again, make sure that you pass a DateTimeData, and not the
    .TextValue.
    Good luck!
    Richard Kirk

    Date: Wed, 06 Nov 1996 08:18:37 -0500
    To: "C. M. Motta" <[email protected]>
    From: Jim Milbery <[email protected]>
    Subject: Re: Oracle DATE data format conversion..
    Cc: [email protected]
    Cheers:
    Most likely what is happening is that you are using the default date
    format of Oracle, and you are sending a four-character year. As follows:
    SQL> insert into jimbo values ('01-dec-1997')
    2 /
    insert into jimbo values ('01-dec-1997')
    ERROR at line 1:
    ORA-01830: date format picture ends before converting entire inputstring
    >
    Oracle defaults to a format of 'dd-MON-yy'
    You can either truncate the year, or manipulate the date to match the standard
    database as follows:
    insert into jimbo values (to_Date('01-jan-1997', 'DD-MON-YYYY'))
    \jimbo
    At 09:21 AM 11/6/96 -0200, you wrote:
    Forte Users,
    First, Id like to thank all those who answered my question on
    droplist & SQL. I got just what I was looking for: its up and runnunig
    now.
    I have another question: Im trying to insert a DATE into an Oracle
    database. The source date is:
    data : DateTimeData = new;
    data.SetCurrent();
    So, when I try to insert data.Value or data.textvalue into DB, I
    get the following exception:
    ORA-01830: date format picture ends before converting entire
    input string.
    Are there any suggestions?
    Thanks for your help,
    C.M. Motta
    ====================================================================
    Jim Milbery
    Milbery Consulting Group
    132 N. West St., Allentown, PA 18102
    O: 610 - 432 - 5350 F: 610 - 432 - 5380
    E-Mail : [email protected]
    ====================================================================

  • Whole number field formatted as timezone in CRM 2013 SP1UR1 gives error on saving

    Hi,
    I added a whole number field formatted  as time zone to the appointment form and when I save the record I get an error saying
    Crm Exception: Message: An unexpected error occurred., ErrorCode: -2147220970, InnerException: System.InvalidCastException: Unable to cast object of type 'Microsoft.Xrm.Sdk.OptionSetValue' to type 'System.IConvertible'.
    This error is coming from the timezone field and only happens when I have data in the field. Has anyone seen this?
    Thanks
    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    More info, the error occurs on pipeline stage 30 of the Book or Reschedule message and the same thing happens in CRM 2015. I've started a thread on connect with URL
    https://connect.microsoft.com/dynamicssuggestions/feedback/details/1128206/crm-2013-sp1ur1-cant-handle-the-timezone-field
    This must be rather new because I've tried it in CRM 2011 UR late and it did not occur there, I haven't tried CRM 2013 RTM though so I can't say if it's a CRM 2013 or a CRM 2013 SP1UR1 issue.
    BTW, the 2015 org was a complete vanilla so I've pretty much ruled out custom code as a culprit :)
    Regards
    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

  • PL/SQL: numeric or value error: number precision too large

    hi ,
    i am running my script and getting this error. i created a object and and make table type on this with fraction of number(2,2). and in my script i am calling a standard API which have hour in number only .i am also using a custome table also which also having number(2,2). so plz help me to resoulve thsi error.
    description below:
    DECLARE
    l_Return_Status VARCHAR2 (30):=NULL;
    l_Msg_Count NUMBER :=0;
    l_Msg_Data VARCHAR2 (2000) := NULL;
    v_Sape_Sco_info_Tbl SAPE_SCO_INFO_TBL;
    v_Sape_Sco_info_rec SAPE_SCO_INFO_REC;
    p_assignment number:=165316; -----165688;
    p_project_id number:=74538; -----81993;
    sco_id number:=10371;
    BEGIN
    v_Sape_Sco_info_Tbl := SAPE_SCO_INFO_TBL();
    v_Sape_Sco_info_rec := SAPE_SCO_INFO_REC(p_assignment,p_project_id,sco_id,'15-Oct-2009','31-Oct-2009',15.00,'17-Oct-2009','20-Oct-2009','ADD_EXISTING_RESOURCES',02.50,NULL,'Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
    v_Sape_Sco_info_Tbl.EXTEND;
    v_Sape_Sco_info_Tbl(1) := v_Sape_Sco_info_rec;
    SAPE_UPDATE_SCO_DETAILS_PKG.SCO_ROLE_INCREASE(
    x_project_id =>p_project_id,
    x_Assignment_Id =>p_assignment,
    l_Sape_Sco_info_Tbl => v_Sape_Sco_info_Tbl,
    x_called_function =>'ADD_EXISTING_RESOURCES',
    x_Return_Status =>l_Return_Status,
    x_Msg_Count =>l_Msg_Count,
    x_Msg_Data =>l_Msg_Data
    dbms_output.put_line('second Procedure executed sucessesfuly');
    dbms_output.put_line('l_Return_Status '||l_Return_Status||' l_Msg_Count '||l_Msg_Count||'l_Msg_Data');
    dbms_output.put_line('value'||' '||v_Sape_Sco_info_Tbl(1).Assignment_Id);
    dbms_output.put_line('completed');
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(sqlerrm(sqlcode));
    END;
    error :PL/SQL: numeric or value error: number precision too large
    CREATE OR REPLACE TYPE SAPE_PA.SAPE_SCO_INFO_TBL IS TABLE OF SAPE_SCO_INFO_REC;
    Prompt OBJECT TYPE SAPE_PA.SAPE_SCO_INFO_REC
    DROP TYPE SAPE_PA.SAPE_SCO_INFO_REC;
    CREATE OR REPLACE TYPE SAPE_PA.SAPE_SCO_INFO_REC AS OBJECT
    ( Assignment_Id NUMBER,
    project_id Number,
    sco_id Number,
    Role_START_DATE DATE,
    Role_END_DATE DATE,
    avg_hrs_per_day NUMBER(2,2),
    sco_role_start_date DATE,
    sco_role_end_date DATE,
    sco_role_mode VARCHAR2(250),
    sco_hrs_per_day NUMBER(2,2),
    no_of_copies Number,
    Active_Flag VARCHAR2(10),
    BILLABLE_UPSIDE_INDICATIOR VARCHAR2(5),
    RET_CODE VARCHAR2(5),
    ERROR_MSG VARCHAR2(255),
    ATTRIBUTE1 VARCHAR2(240),
    ATTRIBUTE2 VARCHAR2(240),
    ATTRIBUTE3 VARCHAR2(240),
    ATTRIBUTE4 VARCHAR2(240),
    NATTRIBUTE1 NUMBER,
    NATTRIBUTE2 NUMBER
    CREATE TABLE SAPE_PA.SAPE_SCO_STAFFING_MAPPINGS
    (     PROJECT_ID NUMBER,
              SCO_ID NUMBER,
              ASSIGNMENT_ID NUMBER PRIMARY KEY,
              SCO_ROLE_START_DATE DATE,
              SCO_ROLE_END_DATE DATE,
              SCO_ROLE_HOURS NUMBER(2,2),
              SCO_MODE VARCHAR2(80),
              ACTIVE_FLAG VARCHAR2(5),
              LAST_UPDATE_DATE DATE,
              LAST_UPDATED_BY NUMBER(15,0),
              CREATION_DATE DATE,
              CREATED_BY NUMBER(15,0),
              LAST_UPDATE_LOGIN NUMBER(15,0),
              ATTRIBUTE1 VARCHAR2(240),
              ATTRIBUTE2 VARCHAR2(240),
              ATTRIBUTE3 VARCHAR2(240),
              ATTRIBUTE4 VARCHAR2(240),
              NATTRIBUTE1 NUMBER,
              NATTRIBUTE2 NUMBER     
              )

    The problem here is with avg_hrs_per_day NUMBER(2,2)+ of SAPE_SCO_INFO_REC object.
    user12226862 wrote:
    CREATE OR REPLACE TYPE SAPE_PA.SAPE_SCO_INFO_REC AS OBJECT
    ( Assignment_Id NUMBER,
    project_id Number,
    sco_id Number,
    Role_START_DATE DATE,
    Role_END_DATE DATE,
    avg_hrs_per_day NUMBER(2,2),
    sco_role_start_date DATE,And while assigning the value it is:
    user12226862 wrote:
    v_Sape_Sco_info_rec := SAPE_SCO_INFO_REC(p_assignment,p_project_id,sco_id,'15-Oct-2009','31-
    Oct-2009',15.00,'17-Oct-2009','20-
    Oct-2009','ADD_EXISTING_RESOURCES',02.50,NULL,'Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);Note that number(2,2) means maximum total of digits in that case is 2 (including scale), not 4.
    E.g.
    SQL>  declare
      2       x number(2,2);
      3     begin
      4       x := 02.50;
      5     end;
      6    /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at line 4However, this works:
    SQL>  declare
      2       x number(2,2);
      3     begin
      4       x := .50;
      5     end;
      6    /
    PL/SQL procedure successfully completed.Cheers,
    AA

  • Packed Number Sign Format to Ascii equivalent  java program

    Hi
    I have a requirement to convert the packed Number Sign Format(usually used in MainFrame Platforms) to Ascii equivalent .
    please help me out with java code or steps to be done to achieve these task
    thank's
    habeeb
    [email protected]
    [email protected]

    Already answered in other thread.

  • Trouble using getLong to get an Oracle Number(8,2) field from ResultSet

    I am having trouble using getLong to get an Oracle Number(8,2) field from ResultSet. The error message starts with:
    java.lang.ExceptionInInitializerError: [exception was kaffe.utilNotImplemented] at oracle.jdbc.dbaccess.DBConversion.NumberBytesToLong(....
    and similar messages when I try getString, getDouble, etc. I am able to getString on the VARCHAR and DATE fields but have not been able to access the NUMBER(8,2) fields.

    java.lang.ExceptionInInitializerError: [exception was
    kaffe.utilNotImplemented] at
    oracle.jdbc.dbaccess.DBConversion.NumberBytesToLong(...
    kaffe.utilNotImplemented may be being thrown internally by your JDK.. AFAIK the Kaffe JDK is only JAVA 1.1 compatible and your driver may require JAVA 2.
    Col

  • Number precision too large

    THE FOLLOWING SIMPLE CODE IS GIVING ERROR even though i have given the definition (2,3) which is larger than the length of value 3.14 ?
    declare
    pi constant number(2,3):=3.14;
    r number(5) ;
    a number(5);
    begin
    r:=2;
    a:=pi*power(r,2);
    dbms_output.put_line('area is '||a);
    insert into areas values(r,a);
    end;
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at line 2

    pi constant number(2,3):=3.14;Perhaps you meant NUMBER(3,2).
    SQL> declare
      2     pi constant number(3,2):=3.14;
      3  begin
      4     dbms_output.put_line(pi);
      5  end;
      6  /
    3.14
    PL/SQL procedure successfully completed.
    SQL> declare
      2     pi constant number(3,2):=3.1415926;
      3  begin
      4     dbms_output.put_line(pi);
      5  end;
      6  /
    3.14

  • ORA-06502: PL/SQL: numeric or value error: number precision too large

    I am getting this error when my procedure is being invoked. I've checked if a calculation is attemting to assign an integer to a column that has a smaller data type...e.g 99 being inserted into NUMBER(2)....but this all seems fine...
    any ideas where I should check?
    thanks!

    >Is there a way to tell which column is throwing this error
    As suggested by Guido it appears to be related to your variables, not the table;
    SQL> create table t (col1 number(1))
    Table created.
    SQL> begin
       insert into t values (11);
    end;
    ORA-01438: value larger than specified precision allowed for this column
    ORA-06512: at line 2
    SQL> declare
       n  number(1);
       n2 number(2) :=11;
    begin
       n:= n2;
    end;
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at line 5The error message should tell you the line of code that is causing the problem, ie;
    ORA-06512: at line 5A quick way to show the values is to display them using dbms_output.put_line inline or in the exception handler.

  • (RR FORMAT) ORACLE의  2000년대 DATE FORMAT

    제품 : SQL*PLUS
    작성날짜 : 1997-04-23
    (RR FORMAT) ORACLE의 2000년대 DATE FORMAT
    ==========================================
    이 문서는 단지 정보 제공을 목적으로 하며 여기에 있는 내용은 통보 없이 변경될
    수 있습니다. 오라클은 이 문서에 오류가 없다는 것을 보증하지 않으며, 특정 목
    적에 부합하거나 혹은 상업성에 대한 묵시적인 보증과 조건 -구두적으로 표현되었
    거나 법적으로 함축되었거나- 을 포함하는 어떠한 보장도 제공하지 않습니다. 오라
    클은 본 문서와 관련하여 어떠한 법률적 책임도 지지 않으며, 직접 또는 간접적으
    로 어떠한 계약적 의무도 형성되지 않습니다. 본 문서는 오라클의 사전 서면 동의
    없이 어떠한 목적으로도 전자적으로나 기계적으로 재작성되거나 다른 형태로 변경
    될 수 없습니다.
    ORACLE 7은 세기의 전환에 대해 'RR' 이라는 새로운 DATE FORMAT을 제공한다.
    'RR' 은 DATE FORMAT의 마지막 2 DIGITS에 다른 세기에 대한 DATE값을 저장한다는
    것을 제외하고는 'YY' FORMAT과 유사하다.
    다음은 사용자가 지정하는 YEAR를 현재의 YEAR를 기반으로 하여,
    'RR' FORMAT이 RETURN하는 DATE(세기)를 나타낸 것이다.
    현재 YEAR의 지정된 YEAR의 'RR' FORMAT결과
    마지막 2 DIGIT     마지막 2 DIGIT
    0 - 49     0 - 49     현재 세기
    50 - 99      0 - 49 다음 세기
    0 - 49      50 - 99     이전 세기
    50 - 99     50 - 99     현재 세기
    예를 들면, 현재가 1993년이면, 50에서 90사이의 년도는 20세기에 포함되고,
    0에서 49사이의 년도는 21세기에 포함된다. 마찬가지로 현재가 2001년이면
    50에서 90사이의 년도는 20세기에 포함되고, 0에서 49사이의 년도는 21세기에
    포함된다.
    다음은 'RR'사용에 대한 예이다.
    이와 같이 RR type을 사용하여 모든 application을 수정하기 곤란할 때에는
    환경변수의 nls_date_format을 변경하여도 된다.
    단, nls_date_format은 이후에 다른 사용자에 의해 변경되어질 수도 있으므로
    application을 수정하는 것이 안전하다.
    SQL> INSERT INTO EMP(empno, deptno, hiredate)
    VALUES(9999, 20, TO_DATE('01-JAN-03', 'DD-MON-RR'));
    1 row created.
    SQL> INSERT INTO EMP(empno, deptno, hiredate)
    VALUES(8888, 20, TO_DATE('01-JAN-67', 'DD-MON-RR'));
    1 row created.
    SQL> SELECT empno, deptno, TO_CHAR(hiredate, 'DD-MON-YYYY') hiredate
    FROM EMP;
    EMPNO DEPTNO HIREDATE
    8888 20 01-JAN-1967
    9999 20 01-JAN-2003

    RR was introduced as a Y2K workaround for all those programs that didn't store the century. It has a fixed window - 50 to 99 defaults to twentieth century, 00 to 49 is twenty-first. YY on teh other hand just defaults to the current century. At least in 9.2 it does. I think in earlier version of the database it defaulted to 00 - hence many systems apparently have records that were created in the first century AD.
    SQL> SELECT to_char(to_date('01-JAN-50', 'DD-MON-RR'), 'DD-MON-YYYY')
      2  FROM  dual
      3  /
    TO_CHAR(TO_
    01-JAN-1950
    SQL> SELECT to_char(to_date('01-JAN-49', 'DD-MON-RR'), 'DD-MON-YYYY')
      2  FROM  dual
      3  /
    TO_CHAR(TO_
    01-JAN-2049
    SQL> SELECT to_char(to_date('01-JAN-50', 'DD-MON-YY'), 'DD-MON-YYYY')
      2  FROM  dual
      3  /
    TO_CHAR(TO_
    01-JAN-2050
    SQL> SELECT to_char(to_date('01-JAN-49', 'DD-MON-YY'), 'DD-MON-YYYY')
      2  FROM  dual
      3  /
    TO_CHAR(TO_
    01-JAN-2049
    SQL> Cheers, APC

  • ORA-06502: PL/SQL: numeric or value error:. number precision too large, ORA-06502: PL/SQL: numeric or value error:. number precision too large

    I have hit with above error and the code did run successfully before the minor change in the portion I have bolded. Appreciate your comment & help.
    Attached with the code:
    CREATE TABLE RPT1120B_CHANNEL_new
    (SUBSCRIBER_NO NUMBER (9),
    FP_CHANNEL VARCHAR2(255),
    FP_DATE DATE,
    FP_DYNASTY CHAR(1),
    FP_MOVIE CHAR(1),
    FP_FUN CHAR(1),
    FP_LEARNING CHAR(1),
    FP_NEWS CHAR(1),
    FP_SPORTS CHAR(1),
    FP_VARIETY CHAR(1),
    FP_EMPEROR CHAR(1),
    FP_SX1 CHAR(1),
    FP_CEL CHAR(1),
    LP_CHANNEL VARCHAR2(255),
    LP_DATE DATE,
    LP_DYNASTY CHAR(1),
    LP_MOVIE CHAR(1),
    LP_FUN CHAR(1),
    LP_LEARNING CHAR(1),
    LP_NEWS CHAR(1),
    LP_SPORTS CHAR(1),
    LP_VARIETY CHAR(1),
    LP_EMPEROR CHAR(1),
    LP_SX1 CHAR(1),
    LP_CEL CHAR(1));
    --truncate table RPT1120B_CHANNEL;
    create or replace PROCEDURE sp_rpt1120b_new
    AS
    FP_CHANNEL VARCHAR2(255);
    FP_DATE DATE;
    LP_CHANNEL VARCHAR2(255);
    LP_DATE DATE;
    REC_COUNT NUMBER(3);
    TYPE REC_SA IS RECORD
    (AGREEMENT_NO NUMBER (9));
    TYPE REC_CHANNEL IS RECORD
    (CHANNEL VARCHAR2(3),
    AGREEMENT_NO NUMBER (9));
    BEGIN
    FOR REC_SA IN (SELECT DISTINCT SUBSCRIBER_NO FROM RPT1120B_T1_new) LOOP
         FP_CHANNEL := '';
         LP_CHANNEL := '';
         REC_COUNT := 0;
         FP_DATE := '';
         LP_DATE := '';
         FOR REC_CHANNEL IN      (SELECT distinct decode(SOC,
                                       29990,'N',
                                       29991,'V',
                                       29993,'M',
                                       29988,'F',
                                       29989,'L',
                                       29992,'S',
                                       29994,'D',
                                       29995,'E',
                                       30277,'C',
                                       30293,'C',
                                       30319,'C',
                                       30359,'C',
                                       30276,'X',
                                       30331,'X',
                                       30299,'X',
                                       30380,'X')      
                        AS CHANNEL,SA.EFFECTIVE_DATE as soc_sts_date
                   FROM      SERVICE_AGREEMENT SA
                   WHERE      SA.SOC in (          29990,
                                       29991,
                                       29993,
                                       29988,
                                       29989,
                                       29992,
                                       29994,
                                       29995,
                                       30277,
                                       30293,
                                       30319,
                                       30359,
                                       30276,
                                       30331,
                                       30299,
                                       30380) AND
                        SA.AGREEMENT_NO = REC_SA.SUBSCRIBER_NO AND
                        TRUNC(SA.EFFECTIVE_DATE) <> TRUNC(NVL(SA.EXPIRATION_DATE,SYSDATE)) AND
                        SA.EFFECTIVE_DATE = (SELECT MIN(SA1.EFFECTIVE_DATE) FROM SERVICE_AGREEMENT SA1
                                  WHERE SA1.AGREEMENT_NO = SA.AGREEMENT_NO AND
                                  sa1.soc in (
    29990,
                                       29991,
                                       29993,
                                       29988,
                                       29989,
                                       29992,
                                       29994,
                                       29995,
                                       30277,
                                       30293,
                                       30319,
                                       30359,
                                       30276,
                                       30331,
                                       30299,
                                       30380))
                        order by DECODE(channel,'D',1,'M',2,'E',3,'C',4,'X',5,'F',6,'L',7,'N',8,'S',9,'V',10)) LOOP
                   REC_COUNT := REC_COUNT + 1;
                   if REC_COUNT < 254 then
                        FP_CHANNEL := FP_CHANNEL || REC_CHANNEL.CHANNEL;
                   end if;
                   FP_DATE := REC_CHANNEL.soc_sts_date;
         END LOOP;
         REC_COUNT := 0;
         FOR REC_CHANNEL IN      (SELECT distinct decode(sa.SOC,
                                       29990,'N',
                                       29991,'V',
                                       29993,'M',
                                       29988,'F',
                                       29989,'L',
                                       29992,'S',
                                       29994,'D',
                                       29995,'E',
                                       30277,'C',
                                       30293,'C',
                                       30319,'C',
                                       30359,'C',
                                       30276,'X',
                                       30331,'X',
                                       30299,'X',
                                       30380,'X')     
                        AS CHANNEL,SA.soc_status_date as soc_sts_date
                   FROM      SERVICE_AGREEMENT SA,
                        (SELECT MAX(SA1.soc_status_DATE) as soc_date, agreement_no, soc
                        FROM SERVICE_AGREEMENT SA1
                        WHERE soc in(          29990,
                                       29991,
                                       29993,
                                       29988,
                                       29989,
                                       29992,
                                       29994,
                                       29995,
                                       30277,
                                       30293,
                                       30319,
                                       30359,
                                       30276,
                                       30331,
                                       30299,
                                       30380)
                        GROUP BY agreement_no, soc) sa1
                   WHERE      SA.SOC in (      29990,
                                       29991,
                                       29993,
                                       29988,
                                       29989,
                                       29992,
                                       29994,
                                       29995,
                                       30277,
                                       30293,
                                       30319,
                                       30359,
                                       30276,
                                       30331,
                                       30299,
                                       30380) AND
                        SA.soc_status_date = sa1.soc_date AND
                        TRUNC(SA.SOC_STATUS_DATE) <> TRUNC(NVL(SA.EXPIRATION_DATE,SYSDATE)) AND
                        SA.SOC_STATUS = (SELECT MIN(SA2.SOC_STATUS) FROM SERVICE_AGREEMENT SA2
                                  WHERE SA2.AGREEMENT_NO = SA.AGREEMENT_NO AND sa2.soc = sa.soc
                                  and SA2.soc_status_date = SA.soc_status_date)
                        order by DECODE(channel,'D',1,'M',2,'E',3,'C',4,'X',5,'F',6,'L',7,'N',8,'S',9,'V',10)) LOOP
                   REC_COUNT := REC_COUNT + 1;
                   if REC_COUNT < 254 then               
                        LP_CHANNEL := LP_CHANNEL || REC_CHANNEL.CHANNEL;
                   end if;
                   LP_DATE := REC_CHANNEL.soc_sts_date;
         END LOOP;
         INSERT INTO RPT1120B_CHANNEL_new values
              (REC_SA.SUBSCRIBER_NO,
              substr(FP_CHANNEL,1 essageID=1196758, I have hit with above error and the code did run successfully before the minor change in the portion I have bolded. Appreciate your comment & help.
    Attached with the code:
    CREATE TABLE RPT1120B_CHANNEL_new
    (SUBSCRIBER_NO NUMBER (9),
    FP_CHANNEL VARCHAR2(255),
    FP_DATE DATE,
    FP_DYNASTY CHAR(1),
    FP_MOVIE CHAR(1),
    FP_FUN CHAR(1),
    FP_LEARNING CHAR(1),
    FP_NEWS CHAR(1),
    FP_SPORTS CHAR(1),
    FP_VARIETY CHAR(1),
    FP_EMPEROR CHAR(1),
    FP_SX1 CHAR(1),
    FP_CEL CHAR(1),
    LP_CHANNEL VARCHAR2(255),
    LP_DATE DATE,
    LP_DYNASTY CHAR(1),
    LP_MOVIE CHAR(1),
    LP_FUN CHAR(1),
    LP_LEARNING CHAR(1),
    LP_NEWS CHAR(1),
    LP_SPORTS CHAR(1),
    LP_VARIETY CHAR(1),
    LP_EMPEROR CHAR(1),
    LP_SX1 CHAR(1),
    LP_CEL CHAR(1));
    --truncate table RPT1120B_CHANNEL;
    create or replace PROCEDURE sp_rpt1120b_new
    AS
    FP_CHANNEL VARCHAR2(255);
    FP_DATE DATE;
    LP_CHANNEL VARCHAR2(255);
    LP_DATE DATE;
    REC_COUNT NUMBER(3);
    TYPE REC_SA IS RECORD
    (AGREEMENT_NO NUMBER (9));
    TYPE REC_CHANNEL IS RECORD
    (CHANNEL VARCHAR2(3),
    AGREEMENT_NO NUMBER (9));
    BEGIN
    FOR REC_SA IN (SELECT DISTINCT SUBSCRIBER_NO FROM RPT1120B_T1_new) LOOP
         FP_CHANNEL := '';
         LP_CHANNEL := '';
         REC_COUNT := 0;
         FP_DATE := '';
         LP_DATE := '';
         FOR REC_CHANNEL IN      (SELECT distinct decode(SOC,
                                       29990,'N',
                                       29991,'V',
                                       29993,'M',
                                       29988,'F',
                                       29989,'L',
                                       29992,'S',

    The error message has an important hint: "number precision too large"
    Change REC_COUNT's type from NUMBER(3) to NUMBER and see what happens.

Maybe you are looking for

  • Moving iTunes to an external drive

    Can anyone walk me through how to relocate my iTunes software from my full C drive to an external drive?  I can't update the iTunes software or my iPhone, because my C drive is so full.

  • Is it true a Mac will never get a virus?

    Is it true a Mac will never get a virus? If it is not, what virus's should i be most worried about and how do i avoid them? Thanks.

  • Scripting in FrameMaker

    This question was posted in response to the following article: http://help.adobe.com/en_US/framemaker/using/WSd5e89bb44d752f2f4e0f6b6612c81bacb1a-8000.ht ml

  • MAIL NO LONGER DISPLAYS HTML BY DEFAULT

    Despite having "Display HTML messages" selected in Preferences/Viewing, the only way to display HTML content in (Received/INBOX) Mail is to pull down "VIEW" menu to DISPLAY MESSAGE then select "BEST ALTERNATIVE". Then it appears fine. This is tiresom

  • Adjusting brightnesss and volume without pressing FN

    hi all i would to find out how to adjust brightness and volume of my powerbook g4 15" 1.5ghz, without pressing FN currently, to adjust, i hold "fn" and press F1/2 for brightness and f3(mute), f4/5 for volume. my friends with macbook pro or ibook g4 c