×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    46

    Overflow Error while inserting into database even if size is less than max allowed

    Hi,

    I am facing overflow error while inserting content to database.
    overflow error observed if the data of columns exceed certain size but columns can take upto 256 characters.

    In the below data all the columns with EDbColText8 are less that 256 characters but still overflow occurs.

    Could some one let me know how to handle this large data in database?

    Here is size and value of the fields overflow error is observed

    avalue = 1323
    avalue1 = 1456
    avalue2 = 19 characters
    avalue3 = 36 characters
    avalue4 = 80 characters
    avalue5 = 10087
    avalue6 = 5 characters


    // If size is less overflow is not observed
    avalue = 1323
    avalue1 = 1456
    avalue2 = 9 characters
    avalue3 = 6 characters
    avalue4 = 20 characters
    avalue5 = 1000087
    avalue6 = 5 characters


    Here is my pseudocode



    RDbView view;
    view.Prepare(iDatabase, TDbQuery(QueryBuffer));
    CleanupClosePushL(view);

    view.InsertL();

    view.SetColL(2, avalue);
    view.SetColL(3, avalue1);
    view.SetColL(4, avalue2);
    view.SetColL(5, avalue3);
    view.SetColL(6, avalue4);
    view.SetColL(7, avalue5);
    view.SetColL(8, avalue6);

    TRAPD(err, view.PutL()); // overflow error is observed here while adding to database


    //while creating table

    columns->AddL(TDbCol(NCol2, EDbColInt32));
    columns->AddL(TDbCol(NCol3, EDbColInt32));
    columns->AddL(TDbCol(NCol4, EDbColText8));
    columns->AddL(TDbCol(NCol5, EDbColText8));
    columns->AddL(TDbCol(NCol6, EDbColText8));
    columns->AddL(TDbCol(NCol7, EDbColInt32));
    columns->AddL(TDbCol(NCol7, EDbColText8));


    Thanks in advance,

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Overflow Error while inserting into database even if size is less than max allowe

    Have you created proper "view" with 8 columns (QueryBuffer)??? SetColL() will set value of each column defined in view for single row. And PutL() update or insert a single row at a time.

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    46

    Re: Overflow Error while inserting into database even if size is less than max allowe

    hi,
    yes i have created proper view with 8 columns. As i said if the length of columns is less row is inserted successfully. If length exceeds 80 characters then putl leaves with kerroverflow.

  4. #4
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Overflow Error while inserting into database even if size is less than max allowe

    Then everything else looks ok. Once try bye manually specifying size of text to 255.
    columns->AddL(TDbCol(NCol7, EDbColText8, 255)). And also if you modified your database(structure, including data type) after creation then delete your database.

  5. #5
    Registered User
    Join Date
    Dec 2008
    Posts
    46

    Re: Overflow Error while inserting into database even if size is less than max allowe

    Excellent solution.
    It worked after adding maxlength to columns->AddL(TDbCol(NCol7, EDbColText8, 255)).

    Thanks for your solution.

Similar Threads

  1. Max size of 6101 ? Really 166Kb?!
    By jraluy in forum Mobile Java General
    Replies: 2
    Last Post: 2008-06-25, 17:06
  2. OTA max jar size
    By lewsterin in forum Mobile Java General
    Replies: 4
    Last Post: 2006-01-27, 09:47
  3. Max message size in MMS.
    By biju1176 in forum General Messaging
    Replies: 2
    Last Post: 2002-06-19, 13:37

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×