How to limit number of chars in a CFGRIDCOLUMN

Hi,
I have a 2 column grid populated from a query. The grid is
editable and will be submitted to an action page for database
Delete, Insert, or Update. The first grid column corresponds to a
MS SQL database column that is defined as varchar(3).
Currently, if the user inputs 4 characters and submits, I get
a SQL trunc error.
There has to be a way to limit the number of characters in
this cfgridcolumn to 3? How is it done?

Well, you could check the number of characters on your action
page, and bounce them back if it exceeds the maximum number, and
you can "protect" the database by including a limiting function on
the data in the insert statement, like LEFT(col, 3) so that
regardless what they specify, you will only insert the first 3 into
the database. You really should let them know if they entered too
many, however.
Phil

Similar Messages

  • Limit number of chars per line

    Hi ,
    how to limit the number of chars per Line in a textArea or RTFEditableText?
    I have to do the following:
    Allow 25 Chars for first line,
    any other line should have max. 28 chars.
    First line should have a bold font.
    Not an easy thing..
    I tried to use a textarea fpr input and put the text into a datagrid in the textarea.change() event.
    This works, but I lose a lot of the standard features of the textarea (hyphenation etc.)
    The idea is to use only the textarea or a RTFEditor for applying the rules mentioned above.
    Thanks
    thorsten

    extend PlainDocument class to restrict the number of characters per line.
    Set this class as model to TextArea.
    Below is a class which does this. May be its useful
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    public class FixedNumericDocument extends PlainDocument {
    private int maxLength = 9999;
    private String max="";
    public FixedNumericDocument(int maxLength) {
    super();
    this.maxLength = maxLength;
    //this is where we'll control all input to our document.
    //If the text that is being entered passes our criteria, then we'll just call
    //super.insertString(...)
    public void insertString(int offset, String str, AttributeSet attr)
    throws BadLocationException {
    if (getLength() + str.length() > maxLength) {
    return;
    else {
    try {
    //check if str is numeric only
    int value = Integer.parseInt(str);
    //if we get here then str contains only numbers
    //chk if it is less than 65535 so that it can be inserted
    super.insertString(offset, str, attr);
    catch(NumberFormatException exp) {
    return;
    return;

  • How to limit number of logins per day?

    We have a custom web application (WebAS 6.20) used by people and automated systems. Each user has his own login, and some of these automated systems sometimes produce heavy load because they log into system too often.
    Is there an easy way to:
    1) limit number of logins to, say, 1000 per day and when this limit is reached - do not allow this user to login till midnight
    OR
    2) dedicate one of the processes to the specific user
    thanks in advance

    extend PlainDocument class to restrict the number of characters per line.
    Set this class as model to TextArea.
    Below is a class which does this. May be its useful
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    public class FixedNumericDocument extends PlainDocument {
    private int maxLength = 9999;
    private String max="";
    public FixedNumericDocument(int maxLength) {
    super();
    this.maxLength = maxLength;
    //this is where we'll control all input to our document.
    //If the text that is being entered passes our criteria, then we'll just call
    //super.insertString(...)
    public void insertString(int offset, String str, AttributeSet attr)
    throws BadLocationException {
    if (getLength() + str.length() > maxLength) {
    return;
    else {
    try {
    //check if str is numeric only
    int value = Integer.parseInt(str);
    //if we get here then str contains only numbers
    //chk if it is less than 65535 so that it can be inserted
    super.insertString(offset, str, attr);
    catch(NumberFormatException exp) {
    return;
    return;

  • HT201320 how to limit number of emails in mac mail on iphone5

    Since I upgraded to ios7 my main email account within mac mail has been loading up to 1000 emails.  I want it to be as before, a limit of 200.  How???

    appartently the only solution is to mark all the emails as read but it eats up the internal memory. pretty dissappointing.

  • How to limit number of mail messages on iPhone with iOS7?

    Is there a way to limit the number of inbox email messages showing?  On iOS6, it was in Settings under Mail but this option is not there on iOS7  Is it hiding somewhere else?  If this isn't an option at all, are there any suggestions on a work around?  Without it, a lot of memory is being wasted.  Thanks!

    No, this is no longer an option.
    You can let Apple know about your displeasure (as many have) by leaving them feedback here:  www.apple.com/feedback http://www.apple.com/feedback

  • How to limit number of  jbdc connexion on Oracle application server 10G R3

    Hi all ,
    i have deployed my application an integrated server on Oracle Application Server R3.
    The problem is that i have more than 600 connexion to my Database , an this is too much!!
    How can i configure this ???
    Please help,
    Paul

    You can set the maximum number of connections on the connection pool configuration page of your datasource.
    As there are some troubles with the data source when your dataabse has been down (connection is not restored), I'd suggest to set the Validate Connections option to "true"

  • How to limit number of sessions for an Application

    Hi,
    I have an ASO application running on Essbase 7.1.5 version.
    This Essbase cube is widely used by the BO ( business objects ) Web I services for retrieving data in there Dash Boards.
    No I want to restrict number of sessions on this application. We have SERVERTHREADS through which we can set limit on application wise.
    SERVERTHREADS [application] 20;
    When I set this in the Essbase config file on this server and bounce the Essbase services. Will this really help me in limiting the session till 20 for this application . I see we can set minimum 20 and maximum 500 using server threads.
    What will happen to the session which excceds 20. will they be kept in queue ?.
    Pls let me know if this work. Else pls suggest me the best one.
    Some information for you – in the Essbase ->properties->statistics-> I see Ports Available are 65531
    Thanks
    MS

    HI,
    1. SERVERTHREADS does not contain/limit the count of sessions one can have .
    2. Count of ports will help you decide what is the default SERVERTHREAD count , in your case its 20.
    3. the count 20 signifies the number of threads which a transaction can use ( here threads are nothing by the operating system level threads, to do with the processes and processor).
    4. If you have multiple transactions and you want to improve the performance of them ( in case of slow response or so). You can increase the thread count , to make more threads work for your transactions. Again , this does not limit the count of sessions .
    5. I did not understand the obejctive behind limiting the sessions and avoiding users from accessing . I think , this defeats the whole purpose of having cubes then. You have many cubes ,and huge number of users who pull data and essbase and its kernel are capable of handling this . If you still want to restrcit, might as well set their security ( by letting them not to access cubes).
    Hope this adds value
    Sandeep Reddy Enti
    HCC
    http://hyperionconsultancy.com/

  • How to limit number of rows(pagination) in the bam report?

    Is there anyway i can limit the number of rows in a report in BAM 10.1.3.4 ?

    In BAM 11g
    There is a property ElementsCountLimit which is configurd in BAMServerConfig.xml
    The number of change lists that are cached before rewriting the cache file.
    The default value is 50. When the 51st change list is received, it is cached by replacing the 1st change list.
    Default: 50

  • DB Adapter : How to limit number parent records in select query.

    Hi All,
    I am querying a master-detail tables from a database.
    I want to limit the number of parent records to 15.
    Ex: Resources is parent table. It has two child tables "Skills" & "PersonalDetails".
    Resources table has 1 to many relationship with above tables.
    When i use rownum <= 15 in the where clause i am seeing different results each time.
    Sample query is as below.
    select distict t0.resourceName , t1.skillName , t2.location
    from .table_names
    where .....join between tables..
    and rownum <= 15
    Note : I selected the checkbox "Use outer joins to return a single result set for both master and detail tables" in DBAdapter wizard.
    Let me know if i am missing anything important.
    Thanks,
    Sid.

    Hi,
    You can set the "Max Rows" at the DBAdapter wizard ("Advanced Options" step).
    Regards,
    Daniel

  • How to limit number of characters in a JTextField?

    Hi,
    I am new to java and I would like to create a JTextField which only allows the users to enter no more than 32 characters. How do I do that? I am looking for a "set..." function but cannot find it.
    Thanks for any hint.
    Richard

    Unfortunately there's no setXXX() method that will do it. You'll need to create a new document class that will accomplish what you want. See attached sample working code.
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class Limit {
    public static void main(String args[]) {
      new LimitFrame();
    class LimitFrame extends JFrame {
    JTextField jtf = new JTextField(10);
    LimitFrame() {
      super();
      jtf.setDocument(new LimitDocument(5));
      /* Components should be added to the container's content pane */
      Container cp = getContentPane();
      cp.add(BorderLayout.NORTH,jtf);
      /* Add the window listener */
      addWindowListener(new WindowAdapter() {
       public void windowClosing(WindowEvent evt) {
        dispose(); System.exit(0);}});
      /* Size the frame */
      pack();
      /* Center the frame */
      Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
      Rectangle frameDim = getBounds();
      setLocation((screenDim.width - frameDim.width) / 2,(screenDim.height - frameDim.height) / 2);
      /* Show the frame */
      setVisible(true);
    class LimitDocument extends PlainDocument
    int limit;
    public LimitDocument(int limit)
      this.limit = limit;
    public void insertString(int offset, String s, AttributeSet a) throws BadLocationException
      if (offset + s.length() <= limit)
       super.insertString(offset,s,a);
      else
       Toolkit.getDefaultToolkit().beep();
    }

  • How to limit number of parallel processes for a query???

    Hi,
    I have set table parallelism to degree (4 in my case) and when i run a query on that table i see on v$session that this query is using 8 parallel processes.
    Why my query is using all this processes?? Can i limit this number?? I think this will cause poor performance if all my parallel processes stay BUSY on v$pq_slave.
    1     1     P000     BUSY     22     0     8     0     2051     10     2     15     0     79179     76884
    2     1     P001     BUSY     22     0     8     0     2054     10     2     15     0     81905     77443
    3     1     P004     BUSY     2     0     1592     0     0     0     0     1592     0     1039     3
    4     1     P005     BUSY     2     0     1592     0     0     0     0     1592     0     1038     4
    5     1     PZ99     BUSY     533     0     0     0     1     3     0     0     0     1071     1107
    6     2     P000     BUSY     14     0     8     0     2053     10     3     15     1     53014     73297
    7     2     P001     BUSY     14     0     8     0     2048     10     2     15     1     51266     73318
    8     2     P002     BUSY     14     0     8     0     2052     10     2     15     2     51043     73271
    9     2     P003     BUSY     14     0     8     0     2053     9     2     15     2     49417     73327
    10     2     P004     BUSY     13     0     8     0     2055     9     2     15     2     68428     12468
    11     2     P005     BUSY     13     0     8     0     2059     10     2     15     1     69968     12473
    12     2     PZ99     BUSY     461     0     0     0     1     3     0     0     0     921     936
    Tks,
    Paulo.

    select /*+ PARALLEL(a,4) */ ...... from owner.table a;
    Or
    ALTER SESSION FORCE PARALLEL DML PARALLEL <degree>
    (But I am not sure whether this will affect the degree of select also ?)

  • F110 - How to limit number of payments per document

    Dear All,
    Our client wants to limit the number of payments per account document for Russia.
    Does somebody knows a method to limit to "3"  this number for each payment document when execution of transaction F110 ?
    So if a supplier has 10 invoices payable, this creates 4 payments (3 + 3 + 3 + 1)
    Thanks in advance
    Regards
    Daniel.

    Hello,
    I do not think this requirement is possible in standard SAP.
    You have to decide whether you want to group payment document for single invoice or all invoices.
    There is no configuration to divide payment documents for 3 invoices.
    Regards,
    Ravi

  • How to limit number of time website appears to once in "most visited"?

    Please help. I tried to adjust settings somewhere or tuther and have ended ended up with "Most Visited" list gathering my website visits at 19 to the dozen. Could you please advise how I could set "Most Visited" list so that each visited website will only get listed once?

    See the solution to this question, but change the number of max results to the one you want:
    *[https://support.mozilla.org/en-US/questions/957018]

  • How to Limit number of Rows in Answers

    Hi all,
    Here goes my requirement.
    The reports should not display more than 50000 records in Answers. If the report exceeds 50000 records it should display a cutomised message " Out of Limit ".
    I am aware that we can apply filter in RPD. What all I need to achieve is teh customided message in Answers. Please provide any inputs on this.
    Thanks in advance,
    Chandu.

    In Answers, for the default Table view, you can set DefaultRowsDisplayed to a desired count. I am not sure to display 'Out of Limits' to end-users. However, an alert can be written in the log as displayed in the link or to disable. See the link below.
    http://gerardnico.com/wiki/dat/obiee/obiee_limit_clause

  • How to limit number of active torrents in rtorrent?

    My bandwidth is limited in speed. At any point in time, I would like rtorrent have only one torrent  downloading/uploading and have the rest (that are already added to watch folder) queued. Once the torrent is done, rtorrent should pick the next torrent from the queue.
    I googled and searched the forum but could not find anything relevant.
    Is this possible in rtorrent? If not, whats the best way to handle this.

    It's been a while since I've read the rtorrent man page, but iirc rtorrent doesn't have 'native' support for this.
    However rtorrent can execute a command when a torrent has finished, so of the top of my head I would create two directorys, pending and current. Place all newly downloaded torrents in pending.
    Now write a script that lists the torrents by date and use head or tail depending on the direction of the ordering to get the oldest torrent and move it to the current directory. Have rtorrent watch for torrents in the current directory. In rtorrentrc specify your new script as the command to execute upon finishing a torrent.
    Use the script to do clean up to, for example move the downloaded data, or move the completed torrents from current to completed, or simply delete them.

Maybe you are looking for

  • Replenishment Control / Follow-on Document

    Hi How can I associate a kind of purchase requisition to be the follow-on document in Replenishment Control? It works fine whith the standard but I need to use the new one I've created. Thanks, Patrício

  • Physical standby

    Good day. Assume I open the pyhsical standby in two seconds and closed Probably no chekpoint will occur in this interval and checkpoint SCN of the datafiles and control file will not change. So what makes recovering it anymore impossible?

  • Master data transport steps

    Hi expert, What will be the steps to transport master data in BI 7? I have transported relevant R/3 data source and then replicated data source in BW. Then I start collecting BW info objects for the master data. When collecting BW info objects for tr

  • Need somehting to use to poke around on IPAD and suggestions for new user?

    My husband is new to internet and is the proud owner of IPAD2 - but is having trouble getting around with his big fingers, is there something that he could use to poke around with like email?

  • Error -2028

    Good Day Experts: I have run into an error that I am unable to find information on.  It is number -2028 "Associated statement is not prepared".  This results when I try add a query programatically using this code: Dim sboUserQuery As SAPbobsCOM.UserQ