String too long, how to auto-truncate it?

Is there any general purpose add-on which can detect a string is
too long to insert/update for a database field, and truncate the
string to insert/update instead of getting ORA-01401 exception?

I strongly suggest you don't truncate data going into your database. Data in the database should be complete (and valid). Better to limit a user's input to the size of the field in the database by such methods as only providing an input field of x character size so he can't type in too many characters. If a user types in data and its retrieved truncated, he's going to be mad.
The question is, how large should a column be? If you set the max size to the max size if your current data set, then a future data value may be too large. I don't know the answer to this, but I suggest you be consistent for the same type of columns in multiple tables. For example, if you set the email address to 255 characters in one table, it should be the same in all tables.
See: http://www.javapractices.com/topic/TopicAction.do?Id=211

Similar Messages

  • Input parameter error: "string too long"

    Hi,
    SAP4Rails and SAPNWRFC run really well now, and I have not experienced a problem for a long, long time.
    However, in an RFC I want to use, there is an import parameter (a plain value), which is of the type SYSUUID. The definition of this type says
    <Format - Data Type "RAW" - No. characters "16"> and <Output Characteristics - Output Length "32">. Locally it works with 32 characters of input, but if I try to call the RFC through SAP4Rails, the error "RfcSetByte string too long" occurrs. Any idea, why this could be?
    Thanks a lot in advance,
    Bernd

    This maybe a bug - if you can compile your own sapnwrfc can you try finding the following code:
        if (RSTRING(value)->len > max)
            rb_raise(rb_eRuntimeError, "RfcSetByte string too long: %sn", StringValueCStr(value));
    and changing it to:
    code]
        if (RSTRING(value)->len > max*2)
            rb_raise(rb_eRuntimeError, "RfcSetByte string too long: %s\n", StringValueCStr(value));
    [/code]
    and let me know what effect that has.
    Cheers.

  • Firefox keeps my history for too long. how can i change the setting to 2 weeks

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/903677]]</blockquote>
    firefox keeps my history for too long. how can i change the setting to 2 weeks

    Do you mean you have a Macbook Pro (laptop) versus a Mac Pro (desktop)?
    You can back up the MBP, restart using Command+R to boot into the Mavericks Recovery HD, erase the Mactintosh HD and Reinstall OS X. Then you can go through setup and configure it with your information and Apple ID. Mavericks should not prompt you for an Apple ID when it goes through the install since that OS is free.
    One thing you might want to consider is asking the previous owner to unregister the MBP from his Apple ID if he previously registered it. Then you can register it under your Apple ID.
    The previous owner should have wiped it clean and reinstalled the OS that came pre-installed before selling it.

  • Ring Item text string too long to display all - use ellipses ?

    The width of my Ring control is not wide enough to display all characters in the Item text string.  LabVIEW simply truncates the text with no indication that additional text is present.  Is there a way to display an ellipses in such cases ?  For example :
    "Ring text string that is too long"
    that is now shown as :
    "Ring text string that i"
    could be shown as :
    "Ring text st...too long"

    A couple of suggestions:
    1.) Use property nodes to determine which strings are too long, then concatenate the strings with ellipses.
    2.) Increase the height so the text wraps.
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal

  • XML Input String too long to Test Web Service in App Server

    We have a Web Service that accepts an XML input string but when we deploy this web service and try to test it through the Application Server it errors out because the input string is too long. Is there any way around this??
    Thanks...

    Update:
    Now I see that there are in fact two error messages. The second one is the one presented above. But the first one says:
    Line: 145
    Char: 97
    Error: Expected ';'
    Code: 0
    My question now is to what file it is referring?? Is it to ProjectAccountingPort.js that is automatically created? THen why is it not properly created??
    Please, please help me with this! The deadline is in a few days...

  • String too long exception

    hey everyone, I'm trying to modify this program so that i can use my own defined exception StringLongException in it. then after each time a string has been entered you have the choice to enter another.
    import java.util.Scanner;
    public class StringLongE
       public static void main (String[] args)
          String letters;
    StringLongException problem = new StringLongException("too long");
          Scanner scan = new Scanner (System.in);
          System.out.print ("Enter product code (XXX to quit): ");
          code = scan.nextLine();
          while (!code.equals ("XXX"))
             try
              if(letters.length > 35)
              throws problem
             catch (StringLongException exception)
                System.out.println ("Improper string length: " );
             System.out.print ("Enter product code (XXX to quit): ");
             code = scan.nextLine();
    System.out.println(letters);
    }thanks i appreicate the help

    ok, sorry guys, lets try this again....
    import java.util.Scanner;
    public class StringLong
         public static void main (String[] args) throws StringLongException
              String letters;
              StringLongException problem = new StringLongException("too long");
              Scanner scan = new Scanner (System.in);
              System.out.print ("Enter a String with the range(XXX to quit): ");
             letters = scan.nextLine();
             while (!letters.equals ("XXX"))
                try
                   if (letters.length() > 35 );              
                   throw problem;
                  catch (StringLongException exception)
                   System.out.println("STRING WAS TOO LONG PLEASE TRY ANOTHER:");
              System.out.println (letters);
              System.out.print ("Enter a String within the range(XXX to quit): ");
              letters = scan.nextLine();
              System.out.println();
         }this is the updated version

  • New Socket takes too long / how to stop a Thread ?

    Hello to everyone,
    I have a problem that I have been hunting this ol' Sun website all day for a suitable answer, and have found people who have asked this same question and not gotten answers. Finally, with but a shred of hope left, I post...
    My really short version:
    A call to the Socket(InetAddress,int) constructor can take a very long time before it times out. How to limit the wait?
    My really detailed version:
    I have a GUI for which the user enters comm parameters, then the program does some I/O while the user waits (but there is a Cancel button for the Impatient), then the results are displayed. Here is quick pseudocode (which, by the way, worked great before there were Sockets in this program -- only serial ports):
    Main (GUI) thread:
         --> reset the stop request flag
         --> calls workerThread.start(), then brings up a Cancel dialog with a Cancel button (thus going to sleep)
         --> (awake by dialog closing -- dialog may have been closed by workerThread or by user)
         --> set stop request flag that worker thread checks (in case he's still alive)
         --> call workerThread.interrupt() (in case he's alive but asleep for some reason (???))
         --> call workerThread.join() to wait for worker thread to be dead (nothing to wait for if he's dead already)
         --> display worker thread's result data or "Cancelled..." information, whichever worker thread has set
    Worker thread:
         --> yield (to give main thread a chance to get the Cancel Dialog showing)
         --> do job, checking (every few code lines) that stop request flag is not set
         --> if stop request, stop and set cancelled flag for Main thread to handle
         --> if finish with no stop request, set result data for Main thread to handle
         --> take down Cancel Dialog (does nothing if not still up, takes down and wakes main thread if still up)
    THE PROBLEM: Worker thread's job involves doing IO, and it may need to instantiate a new Socket. If it is attempting to instantiate Socket with bad arguments, it can get stuck... The port int is hardcoded by the program, but the IPAddress must be typed by user.
    If the arguments to Socket(InetAddress, int) constructor contain a valid-but-not-in-use IP address, the worker thread will get stuck in the Socket constructor for a LONG time (I observed 1m:38s). There is nothing the Main thread can do to stop this wait?
    EVEN WORSE: If the user clicks the Cancel Button during this time, the dialog goes away soon/immediately, but then the GUI appears to be hanging (single-threaded look) until the long wait is over (after which the "Cancelled..." info is displayed).
    MY QUESTION: Is there nothing the Main thread can do to stop this wait?
    Your answers will be sincerely appreciated. Despite my hopeless attitude (see above), the folks at this forum really have yet to let me down ...
    /Mel

    http://developer.java.sun.com/developer/technicalArticles/Networking/timeouts/

  • String too long

    Hello ,
    Requirement is to generate an excel file in DMS .
    Data for this excel file is retreived from Tables , tables have very huge amount of data .
    method used to generate the excel file is :--
    1.  we create a string by concatinating all the data from tables
    but we get dump in creating this string, since we have large amount of data .
    2 . create an Xstring
    3 Convert that to binary
    4. create an excel in DMS
    Can anyone please suggest how can we avoid step 1.
    OR
    Any way by which we can merge two excels to generate one Excel

    Hi,
    That would mean that you'have more than 2GB of data (this is the maximum size of string as far as I know). Does it really make sense to prepare so big files? When user will try to load it into memory it will take ages and I'm pretty sure that with ~65k lines limit in excel it won't be possible to see all results. So maybe it would be better to split this file?
    Best Regards
    Marcin Cholewczuk

  • Concerned about rendering/exporting for too long - how bad is it for Macbook Pro?

    If it's even bad at all...
    I know these machines are made to take some strain, but I always get a little panicky when I need to export big jobs.
    I'm currently busy exporting Quicktimes (not self-contained) of a project in which I had to key out backgrounds for what will eventually end up as a DVD. Thing is, I'm working in ProRes 422 (HQ) and the DVD's over an hour long in the end...
    And I still have to grade later on, which means another render cycle, and after that, send to DVD, which means yet ANOTHER render cycle...
    So I'm hoping those out there can help me put my mind at ease.
    My Macbook:
    Model Name:          MacBook Pro
    Model Identifier:          MacBookPro5,3
    Processor Name:          Intel Core 2 Duo
    Processor Speed:          2,8 GHz
    Number Of Processors:          1
    Total Number Of Cores:          2
    L2 Cache:          6 MB
    Memory:          4 GB
    Bus Speed:          1,07 GHz
    CPU's currently running at 203 Fahrenheit (95 Celsius) and the fans are pumping at aroun 5500RPM. I imagine the machine will carry on like this for at least another 8 hours, if not 10 or more...
    Can I rest easy or should I tell these inconsiderate, uninformed and ungrateful clients (who have no understanding of what postproduction ACTUALLY entails) to buzz off?
    Thanks!

    Haha thanks, but believe me - I've reached my threshold.
    I've hardly ever burnt bridges, and in this case the client is a photographer with a bunch of DSLRs who decided he's gonna do a multicam shoot and transcode everything to ProRes422. Which is all good, except the final DVD is arond 1.5 hours, and he wants the backgrounds replaced. So instead of shooting with a green screen, he just shot against his infinity curve - which ended up being a TOTAL nightmare for me because there is so much white in his shots that I just couldn't fathom why he wouldn't shoot green? On top of this, he brought me all the footage on a friggin' USB drive, and then expected me to copy it onto my drives. I informed him that I didn't have 500 odd gigs free and that he'd have to provide a faster drive. He did so, but the result is that the first day of post was spent copying files to the new drive.
    On top of this, I decided to take on this job because a friend of mine couldn't do it, and I thought I'd help out - he gave me the impression that it would be a very easy 5 day job. If only - this friend drew up the initial quote, but he didn't take rendering or exporting time into consideration, and also didn't quote for an on-set post supervisor. The result is that he under quoted, and I'm fighting against time to get through cos I need to carry on with another job tomorrow. And the client hasn't even done a proper approval, provided me with music needed for the project, etc. etc.
    ****, I'm so over people who just don't understand or respect post. Anyway, excuse me for venting, I really needed to do that.
    So you reckon the laptop will handle it? Any other thoughts out there?

  • With iTunes 11, genius syncing takes too long, how to fix?

    Genius is now linked with Match and cannot be turned off separately.  How can Genius syncing be sped up?

    For reporting bugs, go here:
    https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/wa/signIn
    you will be required to give a good bit of info as it
    should be for reporting and diagnosing a bug.
    If you are simply dissatisfied with iTunes 11 and its features
    (or elimination of features) and also its bugginess, post here:
    http://www.apple.com/feedback/itunesapp.html
    The former, if given sufficient info, will be sent to software
    engineers.  The latter will be sent to marketing, etc.

  • Web gallery name created on export too .mac is too long - how do I shorten?

    I cannot work out what the steps would be to reduce the eventual web address that I am given when I publish a web gallery from Apertue.. I want to put the address into a domain web forwarding so that I can give a short neat address for people to see but I cannot figure out how to reduce the .mac web gallery link address?
    Can anyone help? Assume I am an idiot.. the clearer and more comprehensive the steps the better!
    I have been messing about with batch change metadata settings for ages but can't see how to do this.. Thank you!

    Apologies.. my advice may have been wrong.. it is a while since I figured it out.. trying to remember what it was I did..you do have to shorten that file name.. but it may not be the caption you need to change. I suspect I may have selected all the images.. then gone to meta data batch change and done something under the custom button which then applied to all images.
    In my case I needed to get the web address for the gallery created from:
    http://homepage.mac.com/farish/Smartbins™%20Chewing%20Gum%20Bin%20and%20Cigarett e%20Bin%20Image%20Gallery/
    down to:
    http://homepage.mac.com/farish/Chewing%20Gum%20Bin%20Cigarette%20Bin/
    I did manage it but can't quite remember how I did it.
    I will keep playing and when I figure out what I did that worked will post again.
    The web gallery name you choose affects how Google sees the site as when you publish the web gallery - the web gallery name can pop up in Google
    It's quite difficult to figure out exactly what to do. If anyone else knows a definitive answer please advise!
    Rgds

  • ORA-01704: string literal too long and PHP

    Ok all of you Oracle experts out there, I've had one heck of a day wrestling with this oracle stuff.
    I've had a couple of posts/threads today with great success and currently I face another problem.
    I'm using PHP/PEAR to execute my queries on an oracle table. I'm trying to store very long (2-3 pages) texts. Currently I'm getting a string too long error.
    I've googled to find that there are certain limits when inserting into a table. The CLOB datafield may hold 4 gigs of text, but you may only insert 4000 bytes at a time. Or at least that's how I understand it.
    Anyone got a work around for this? I've tried:
    OCIBindByName($sql,":fieldName",&$myVariable, -1);
    But that gets me the error:
    ocibindbyname(): supplied argument is not a valid OCI8-Statement resource
    which is an actual PHP/PEAR error....I think...
    Anyone out there have any work around suggestions? I really dont want to parse the insert statement into pieces each being less then 4000 bytes.
    Thanks,
    R

    <snip>
    But that gets me the error:
    ocibindbyname(): supplied argument is not a valid OCI8-Statement resource
    </snip>
    Try check the enviroment setup for oracle in your apachectl (off course if you are using apache web server).
    Just enviroment configuration in /etc/profile or .profile is not enough.

  • ORA-01704:String literal too long with update of more than 4000 chars

    Hi,
    I want to update a table column in Oracle Database(version 10) with more than 4000 chars.
    The datatype of the table column is NCLOB.
    I want to achieve this with one single line of update query as below,
    update mytable set MY_DESCRIPTION = 'longdesc' where ID = '111' ;
    But there's a problem, if the 'longdesc' is more than 4000 chars, it gives the error , "ORA-01704:String literal too long"
    How can I achieve this in sql developer ?
    I dont want to do this using stored procedures, I want to do this update using only sql statement.
    Please help.
    thanks,
    sudhakar

    Hello Sudhakar,
    I am afraid, this will never work by SQL.
    Just because an SQL-Statement must not contain a string literal over 4,000 characters (or did that change lately?).
    Maybe you can bypass the limit with PL/SQL ... but you will certainly run into the 32K limit sooner or later
    regards
    Peter

  • Error message at the reception of attachments sent from my imac "message truncated because too long"thank you

    when sending an email with attached a piece from my mac (ex: pdf) upon receipt of the above other than Mac an error message appears "message truncated for too long" how to solve this problem
    this mail is read perfectly on my iphone
    thanks

    Refer to this:
    Errors "Exit Code: 6," "Exit Code: 7"
    Mylenium

  • DFS 2012R2 error "The file name is too long" word file.

    Hi,
    i have two server with NFS, windows Server 2008R2 and Windows Server 2012R2. when open file in shared folder with path long, from 2008R2, is good, but when open the same file en 2012R2, show the message explorer.exe "the file name is too long"
    how to resolve the issue?
    Thank.
    Analista IT, Celr

    Hi, Umesh
    The shared foldes is in both Server, 2008 and 2012, is a folder en NFS.
    the result of command
    PS C:\Users\administrador> fsutil.exe 8dot3name strip /s /v D:\
    Scanning registry...
    Registry Data                                                                    
    Registry Key Path
    Total affected registry keys:                   0
    Stripping 8dot3 names...
    8dot3 Name      FileId                Full Path
    Stripping will not be performed on files with names longer than the maximum path length.
    Error:  The system cannot find the path specified.
    For details on the operations performed please see the log:
      "C:\Users\ADMINI~2\AppData\Local\Temp\2\8dot3_removal_log @(GMT 2015-02-20 19-24-46).log"
    Due to an error, the strip command did not complete.
    Total files and directories scanned:        97740
    Total 8dot3 names found:                        0
    Total 8dot3 names stripped:                     0
    For details on the operations performed please see the log:
      "C:\Users\ADMINI~2\AppData\Local\Temp\2\8dot3_removal_log @(GMT 2015-02-20 19-24-46).log"
    Thank
    Diego Builes.
    Analista IT, Celr

Maybe you are looking for

  • In which table cound i find the info on EDI standard Message type??

    Example EDI standard Message type Business process EDIFACT ORDERS Purchase order                INVOIC Invoice ANSI X12  850 Purchase order                 810 Invoice Like those 850..810..etc info, i dont know from which table could i find the relat

  • Withholding tax Formula Functionality

    Dear Gurus Is there any way of using the Withholding tax Formula Functionality with an option of four decimal places. Currently, the WHT formula allows for only two decimal places and therefore does not suit the Indian Income Tax law. Regards Abhishe

  • My computer is very slow

    my computer is very slow

  • Pbm in UTL_FILE

    Hi, I've to open a file in write mode and write some contents to it.But UTL_FILE.FOPEN is giving invalid path. Code is as follws: CREATE DIRECTORY test AS 'c:\temp'; grant read on test to scott; DECLARE fileHandler UTL_FILE.FILE_TYPE; BEGIN fileHandl

  • RDP to "Console" Session

    Is it possible to remote desktop in such a way that we can connect to the "console" session on a Windows Server 2012 R2 computer? The reason we are asking is that we have an application that will not run unless it is the console session, but we are t