Add zeros to a non-digital field

Hello

I have an application that currently does not validate a field, and the user can enter any string on this specific area. The customer wants me to write a view to provide information of a child table that uses the free format as a key field for join.

Example, the field is free-form, but we would expect something like "0000001-AB", but users are inputing 1' or ' 001 - AB'. " The customer wants to see these cases be shown (and joined) as '0000001 - AB'. The format is 7 digits + '-' + 2 digit code.

I would like to know, how can I display on a view, since most of my files are ' 1 'or ' 001 - AB'. But there are others with things crazy like ' 1 + 2 + 3 + 4' and these cases give me an error of "invalid number" since I use TO_NUMBER function so far.

Thank you!

Eduardo Ferrari

Like this?

SQL> WITH t AS (
  2     SELECT '1' val FROM dual UNION ALL
  3     SELECT '0000001-AB' FROM dual UNION ALL
  4     SELECT '001-AB' FROM dual UNION ALL
  5     SELECT '1+2+3+4' FROM dual)
  6  SELECT val, LPAD(val, 10, '0')
  7  FROM t;

VAL        LPAD(VAL,1
---------- ----------
1          0000000001
0000001-AB 0000001-AB
001-AB     0000001-AB
1+2+3+4    0001+2+3+4

It won't help those who is really blocked upward, but ones that are close should be out right :-)

John

Tags: Database

Similar Questions

  • Add Prifix & Sufix to the digital field

    Dear friend

    I want to change my itemcode list according to category. I want to change the first digit of each code for ex
    This Code 400000473 I want to change to 100000473.

    In all the Code starting with 4 want to change 1.

    Sanjay
    update your_table
    set your_column = '1'||substr(your_column,2)
    where substr(your_column,1,1)='4';
    

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/02/05/gestione-degli-errori-in-sql-con-log-errors/]

  • How to display the "Add a contact" dialog box with the non-empty fields?

    On the BlackBerry, I want to display a dialog box 'Add a contact' with some fields filled.

    I assumed would work the following code:

    Contact BlackBerryContact = mContactList.createContact ((BlackBerryContact));

    populateSomeFields (contact);

    AddressBookArguments args = new AddressBookArguments (AddressBookArguments.ARG_NEW, contact);

    Invoke.invokeApplication (Invoke.APP_TYPE_ADDRESSBOOK, args);

    but no way. If I invoke with ARG_NEW a completely EMPTY fields are displayed.

    If I invoke with ARG_COMPOSE an IllegalArgumentException is thrown. Is it possible that I can show 'Add a contact' with some informed fields?

    just as an idea: maybe you have to make contact before the opening of the new message notice?
    otherwise it is not possible, you will need to write your own GUI to change the fields in contacts.

  • Custom message for: must be a signed decimal number consists of zero, one or more digits

    Hello

    We have an InputBox mapped the attribute type EO BigDecimal. Whenever the user enters special characters other than digital Gets the error message below.

    < af:inputText id = "it2" value = "#{bindings." Number.inputValue}.

    autoSubmit = columns '10' immediate = "true" = "true".

    Binding = "#{pageFlowScope.ServicesBean.numberInputText}" >

    < / af:inputText >

    Error

    Part r2:0:it2: "/" must be a signed decimal number consisting of zero, one or more digits, which can be followed by a comma and the fraction.

    Tried to add the custom resource group error message as shown in below, but no use.

    javax.faces.converter.BigDecimalConverter.DECIMAL=Summary - BigDecimal conversion error
    javax.faces.converter.BigDecimalConverter.DECIMAL_detail=Detail - BigDecimal conversion error

    Is it possible to give the personalized message?

    JDev Studio Edition Version: 11.1.1.6.0

    Thank you

    Bhaskar Pola

    Following this article and the problem solved.

    Customize the validation error message in JSF 2.0

    Thank you

    Bhaskar Pola

  • Difficulty in getting the number of instances of digital field

    Hello

    I created a form on which a user can add / duplicate the subform.  This subform is located in an another subform.
    THUS, the hierarchy is like:

    1 subform

    2 subform

    Table with fields

    Remove button

    Add button

    Numeric field

    The digital field display the number of instances of subform 2.

    I selected the field and added the code:

    Subform2.instancaManager.count;

    But this does not at all. The field does not appear anything.

    The subform has a minimum number of 1. So in my logic, it should display 1. But I'm not a scripter at all... so frankly I think of her in a bad way.

    Can someone help me get this numeric field to calculate the subform2 instances? In a language dummy please :-)

    Hello

    Since the numeric field is outside Subform1, you have not provided a quite complete reference of the numeric field Subform2. For a description, see here: http://assure.ly/kUP02y.

    It should work in the case of calculating the numeric field:

    this.rawValue = Subform1.Subform2.instanceManager.count;
    

    If the subform did not have a minimum number, you would use the shortcut of instanceManager _ underscores:

    this.rawValue = Subform1._Subform2.count;
    

    The two options are JavaScript. I prefer to use the shortcut _ every time I work with the repetition of the proceedings.

    Hope that helps,

    Niall

  • Validate the digital field - can be 10, 20 or 30

    I am using LiveCycle Designer ES (Version 8.2).

    I have a numeric field that can hold a 10, 20 or 30. It can also be empty, and I guess, a zero would be nice too.

    How can I accomplish this, since I'm a newbie here?

    Thanks for the comments.

    Hello

    If your entry is limited to only 10, 20 or 30, you can use a drop-down list instead of a numeric field.

    A drop-down list is good when you want to make sure that only user predefined values input and define the formats and connections.

    Implement the items in drop-down list in the object Panel and uncheck the box 'allow cistom entry. Go to the control panel link, and select the checkbox 'specify values. Assign a value of 10 '10', etc.

    You will be able to refer to the rawValue of the drop-down list script later, as you would with a numeric field.

    If you want to go with the digital field, you can set up a Javascript script in his output event:

    If (this.rawValue == 10 | this.rawValue == 20 | this.rawValue == 30)
    {
    do nothing
    }
    on the other
    {
    App.Alert ("invalid data entry: enter 10, 20 or 30");
    this.rawValue = null;
    }

    Good luck

    Niall

  • Non editable field change to highlight the problem

    Hi all

    I have an edit non editable field in my screen. In order to make the difference between editable and non editable field, I put the bottom of the field cannot be changed to light gray as in the code below:

       Border nonEditableBorder=BorderFactory.createRoundedBorder(new XYEdges(5, 5, 5, 5),Color.LIGHTGRAY,Border.STYLE_FILLED|Border.STYLE_TRANSPARENT);
    EditField textField=new EditField(EditField.NO_NEWLINE|EditField.FOCUSABLE|DrawStyle.RIGHT);
    textField.setBorder(nonEditableBorder);
    

    Now the field cannot be changed when I scroll the wheel to the right or left the text gets highlighted in white as shown in the image below:

    I don't want the text to highlight. Can anyone help me please with this. Thanks in advance.

    Kind regards

    S.A.Norton Stanley

    Hello

    Thank you. Overridding method drawFocus() and nothing doing, emphasis has been disabled on the fields and the white highlight was not. But once I reached the first or the last field of the white selection screen gets drawn again.  But the border I also assign the background of the field edit as shown below, and this solved my problem.

    Background bgNonEditable = BackgroundFactory.createSolidBackground(Color.LIGHTGRAY);
    textField.setBackground(bgNonEditable);
    
  • How to make Non editable fields in Web ADI

    Hi all

    Can you please let me know how we can make the Non editable fields in Web ADI?

    Thank you
    Anil

    Dear Anil

    You define fields don't read that in the page layout.

    Concerning
    Giuseppe

  • Connect the digital field with Drop Down

    I have a numeric field for the zip code and a drop for the city.

    I want that when I write the postal code in the numeric field to automatically display the city drop down list.

    And even when I chose to drop down the list then show in the digital field (postcode)

    I have all that in Excel.

    Thank you

    Use dynamic properties.

    Start by importing the xml from your spreadsheet (you're on your own with who) excel. Assuming that each line is a city and a postal code, your xml code will look like this:

    SomeCity

    12345

    .

    .

    .

    (1) in the designer, go to file > new connection of data...

    (2) select the sample XML data and the file in Excel.

    (3) make good properties sure dynamics are enabled, tools > Options > Data Binding > show of dynamic properties.

    (4) select your fall down and open the field in the object Palette tab.

    (5) you will notice that the list items is green and underlined. Select it.

    (6) for items, select the line

    (7) for the text of the item, select the city

    (8) for the value of the item, select the zip code

    You now have your menu dropdown bound to the data in your Excel worksheet.

    Now, just a bit of coding (brace yourself), in the digital realm for your zip code, in the case of output put:

    theDropDown.rawValue = this.rawValue;

    and to theDropDown:

    thePostalCode.rawValue = this.rawValue;

    Now all you have to do is import xml into your form to perform.

    Kyle

  • When we change the non-mandatory field in the form, it is not updated

    Hello... I have a question here...

    If I required fields in a custom form, and when I ask the form and change the value in the non-mandatory field and click on save, then it does not save. It is said ' no changes to save "." But it is not the same for the non-compulsory fields.

    Can you please suggest me?

    -vrdida

    If you have an element with an assigned LoV it much difference if you change the value of points (assuming that you have either the property 'Validate list', the value yes or you have a WHEN-VALIDATE-POINT-trigger who performs the search ID fk of the given text) or if you visit the 'empty' field, or NULL. In this case, you must create a WHEN-VALIDATE-trigger POINT on the element, which "cleans" the Fk - id as

    IF :BLOCK.LOKUP_ITEM IS NULL THEN
      :BLOCK.FK_ID:=NULL;
    eNd IF;
    
  • Document collaboration: join a written signature (non-digital)

    Hello, hoping the community can give me some advice to automate a process.

    I am currently part of a business process that requires me to receive a document, put my (non-digital) handwritten signature to it and a date and send it to the next person.  My current workflow to receive the PDF, print it out, sign it with a pen, re-scan in a .pdf file and send it to the next person.  I agree that it is a loss not only time but also paper and ink, as well.

    I have a Wacom digital tablet that allows me to make entries of stylus, like a signature.  How can I use Adobe Acrobat to sign the document in Acrobat by using my Tablet and pen, the requirement to print it, sign it with a pen, to jump and re-scan?  I think it may have something to do with layers in Acrobat, but I'm an Acrobat newbie so I'm not too smart on this topic.

    Thank you for your time and help!

    There are a number of options. A common thing to do is to create a custom stamp, so you can easily apply it whenever necessary. For example: http://blogs.adobe.com/acrolaw/2007/02/creating_a_tran_1/

    You can also use the annotation pen tool. It is in use (in Acrobat 9): Advanced > sign & Certify > apply ink Signature

    It's a good idea to then flatten the signature for other users cannot change it easily. For this, you can use this handy JavaScript-based utility that allows you to selectively flatten annotations: http://www.uvsar.com/projects/acrobat/flattener/

  • How to add a statement to a text field

    Hi all

    I'm trying different ways to add a guideline to a text field. I tried

    1 / to insert a comment, but clearly it does not work with an interactive form in Adobe Acrobat format.

    2 / use text field and the value of the guideline as a default value in the object palette but the problem are

    -The text field is not developed horizontally even I chose to develop to fit option

    -The guideline doesn't go away in case the user do not use

    -The box is not afraid also that users type not enough lines

    3 / to use text instead of text field for the guideline, the problem is

    -There will be a large space between the two parties because the directive is not intended to be printed.

    My question is if there is a smarter way to suggest to users by typing into the text field by giving instructions without printing. For example, is it possible to have a hidden box, you know, it seems that users drag a mouse or click on the field?

    I know it might be a naive question, but please help me. I would be really grateful.

    Edigo

    Hello

    One solution would be to encapsulate the four objects in a subform flowed. The file has to be saved in dynamic PDF.

    Then set the presence of text 'Hidden '. This excludes the layout and other objects to take their place, if they are not visible.

    Then the events mouseEnter and mouseExit of the textfields set guidelines/text lines. See the example.

    If you want a textfield to extend, you must also save the file as a dynamic AND objects in a subform flowed.

    Good luck

    Niall

  • How can I add session variables for the subject field and the body of the e-mail Message?

    How can I add session variables for the subject field and the body of the e-mail Message? Tried several combinations, but do not seem to correct the syntax.

    This is the code I have. I need to change all the form variables in $msg in session variables. The $to part is supported. What remains are the $subject and $msg fields.

    $à = « à : ». $_SESSION ["toemail"];
    $subject = '$firstname $lastname, your registration details ';
    $from = "from: [email protected]"; "
    $msg = "Dear $title $firstname $lastname\r\n\nThank for the registration for the design of your dream Home.\r\nWe have received this following details details of you-\r\n\nClient-\r\n\nOccupation: $occupation \r\nPhone No.: $phone \r\nE-mail: $email\r\n\nPresent $ location: \r\n location\r\n\nPresent address: \r\n$ address\r\n\n\nFollowing are specified by you - design requirements \r\n\nBasic Features\r\n\nNo." floors: $floors\r\nNo. of bedrooms: bedrooms\r\nNo of $. of bathrooms: $bathrooms\r\nFloor region: $sqft\r\n\nFurther Suggestions: $ Plan\r\n\nSplit one further\r\n\n\nType floor: $splitfloor\r\n-remarks: $splitfloorremarks\r\nOpen floor: $openfloor\r\n-remarks: $openfloorremarks\r\n\n\nList of the rooms to be Included\r\n\nFoyer: $foyer\r\n-remarks: $foyerremarks\r\nDrawing: $drawing\r\n-remarks: $ alive drawingremarks\r\nFormal: $formalliving\r\n-comments : $ alive formallivingremarks\r\nFamily: $familyliving\r\n-remarks: $familylivingremarks\r\nHome Office: $homeoffice\r\n-remarks: $homeofficeremarks\r\nDining: $dining\r\n-remarks: $diningremarks\r\nMaster room: $master\r\n-remarks: $masterremarks\r\nMaster bathroom: $masterbath\r\n-remarks: $masterbathremarks\r\nMaster Dressing: $masterdress\r\n-remarks: $masterdressremarks\r\nBedroom: $bed\r\n-remarks: $bedremarks\r\nBathroom: $bath\r\n-remarks: $bathremarks\r\nDress: $dress\r\n-comments : $dressremarks\r\nStudy: $study\r\n-remarks: $studyremarks\r\nLibrary: $library\r\n-remarks: $libraryremarks\r\nPowder room: $powder\r\n-remarks: $powderremarks\r\nPrayer room: $prayer\r\n-remarks: $prayerremarks\r\nKitchen: $kitchen\r\n-remarks: $kitchenremarks\r\nPantry: $pantry\r\n-remarks: $pantryremarks\r\nUtility/area of work: $utility\r\n-remarks: $utilityremarks\r\nBalcony: $balcony\r\n-remarks: $balconyremarks\r\nStore: $store\r\n-remarks: $storeremarks\r\nLaundry : $laundry\r\n-remarks: $laundryremarks\r\nVeranda: $veranda\r\n-remarks: $verandaremarks\r\nCar porch: $carporch\r\n-remarks: $carporchremarks\r\nGarage: $garage\r\n-remarks: Theater garageremarks\r\nHome $: $theater\r\n-remarks: room of $theaterremarks\r\nMaid: $maid\r\n-remarks: $maidremarks\r\n\nOther general remarks: $general\r\n\nPlease note that the fields have been left blank in your form will be considered undecided details and used in discretion.\r\nIf of the architect , it better to add more later, design requirements please feel free to reply to this email with the details. « ;
    $fla = mail ($to, $subject, $msg, $from);

    Thanks in advance!

    askintrades wrote:

    How can I add session variables for the subject field and the body of the e-mail Message?

    What you want to do? Given the nature of your question, it seems that you probably don't know what a session variable is used. The PHP manual describes the purpose of sessions here: http://docs.php.net/manual/en/intro.session.php.

    I need to change all the form variables in $msg in session variables. The $to part is supported. What remains are the $subject and $msg fields.

    $à = « à : ». $_SESSION ["toemail"];

    Why do you need to change the form variables in session variables? They are already stored in session variables, or they come directly from the form?

    The $to part is not supported. When you pass $to to the mail() function, it should contain only an e-mail address, not a string that begins with "to:

  • F8as2-display leading zeros in a dynamic text field

    F8as2-

    Background:

    Currently, I use two different text fields to display because of different font size 10000.

    The 10 is a larger size font and 000 is a smaller font.  When I assign ' 0 ' for dynamic text from the smaller font fields I get just that '0' is not a "000" which is what I want. "

    Question:

    Is there an easy way to display zeros in a dynamic text field?  Or a dynamic text field can cause different character positions displayed in different font sizes?  or both?

    Thanks for the help.

    the only way you can view 'number' as you want, not the way that flash wants, is to use ropes.

    texteformatage is a response to another question, that you had on the display of the different font sizes in a textfield.

  • validation working is not to count the non-null fields

    I have six fields on the screen, I want to check that at least 3 of them are filled (3)...
    I created a validation as follows to count the non-null fields... but it's not working...
    Please help solve this problem or recommend a better way to do this...


    declare
    number of question_count;
    Start
    question_count: = 0;
    If: p1_t_question_1 is null then
    null;
    on the other
    question_count: =: question_count + 1;
    end if;
    If: p1_t_question_2 is null then
    null;
    on the other
    question_count: =: question_count + 1;
    end if;
    If: p1_t_question_3 is null then
    null;
    on the other
    question_count: =: question_count + 1;
    end if;
    If: p1_t_question_4 is null then
    null;
    on the other
    question_count: =: question_count + 1;
    end if;
    If: p1_t_question_6 is null then
    null;
    on the other
    question_count: =: question_count + 1;
    end if;
    If: p1_t_question_6 is null then
    null;
    on the other
    question_count: =: question_count + 1;
    end if;

    If: question_count > 2 then return false;
    otherwise returns true;
    end if;
    end;

    I'll take a look a bit.
    In the meantime, check if the code as

    If the trim (both '%' from: p1_question_with_nul') = 'null '.

    help

    Ok. Take a look now. I used the function TRIM as shown above and also changed the comparison for questions 3 text based on ' if: p1_question_with_text is null'

    Seems to work now

    CITY

    Published by: city has 23 October 2009 05:26

Maybe you are looking for