How to achieve same functionality for String as java in oracle 10g

Example:
In java if I use
--------------->>>
String.format("%03d", 11) then it will give me result 011
String.format("%03d", 1111) then it will give me result 1111
I need same result in Oracle also for a stored procedure. I have used to_char() and lpad() both the function but couldn't get the desirable.
I'm new to this. Please forgive for this silly question and help me.

to_char, like this:
with my_tab as (select 11 col1 from dual union all
                select 1111 col1 from dual union all
                select 8 col1 from dual)
-- end of mimicking data in a table called my_tab
select col1, to_char(col1, 'fm9999099')) formatted_col1
from   my_tab;
      COL1 FORMATTED_COL1
        11 011          
      1111 1111         
         8 008  ETA: You need to make sure that the format mask in the to_char has enough characters to hold the largest number, and that the zero is in the position you want smaller numbers to be padded to (eg. in the example above, the 0 is in the 3rd from the right position).
Edited by: Boneist on 22-Apr-2010 11:34
ETA2: as reminded by odie_63, the fm in the format removes the spaces from the resulting string.
Edited by: Boneist on 22-Apr-2010 11:38

Similar Messages

  • SAP IDM 7.2: How to setup SSO functionality for WebUI of CRM and GRC?

    Hello IDM-experts,
    where can my customer find information about
    SAP IDM 7.2: How to setup SSO functionality for WebUI of CRM and GRC?
    Customer situation description:
    The situation is that we are using SAP IDM 7.2. We are using a functionality to allow our users to access a webpage from where they can gain
    SSO access to the Abap systems via the SAPGui. See screenshot as an example.
    Now what we want is to access the CRM and GRC WebUI also with the same SSO possibility. We cannot find any guide/best practice on how to do
    this or if it is possible via SAP IDM 7.2.
    You can see a weblink in the first screenshot but it does not work. It will ask you for a username and password, see second screenshot.
    Kind regards,
    Daniela

    Do you know how the SAP GUI SSO is setup ? Is it using SNC/Kerberos ?
    If it is (I suspect it is), then you will need to use similar method of authentication for the ICF Services. These cannot use SNC since they are accessed via browser, but what you want is possible.
    Thanks
    Tim

  • How to create menu function for link to open file

    Hi,
    I need help how to create menu function for link to access file and allow user to save the file when click on it.
    The file will keep inside server.
    Thank you.
    Regards,
    Wilson

    I need help how to create menu function for link to access file and allow user to save the file when click on it.
    The file will keep inside server.AFAIK, you have to write a custom code to achieve this and Oracle does not provide this functionality.
    If you want to store the file as an attachment, please see (How to Store Image/PDF Attachments on the File System in 11i and R12 (like Attachment File Directory) [ID 294525.1]).
    Thanks,
    Hussein

  • How to achieve print functionality in OA Framework page

    Hi All,
    I have created one page in OA Framework.
    There is one print button on page for printing the page
    How to achieve print functionality thruoug Print button in OA page.
    Please help me in this if some one has use thif functionality before or if someone knows about it.
    Thanks
    Nisha

    Hi Nisha,
    Have u checked out "printable page" in OA Developer guide??
    Step 1: Add a page-level button as described in the Buttons (Action/Navigation) document.
    Step 2: Assuming your button label is the standard "Printable Page," apply the OA Framework attribute set /oracle/apps/fnd/attributesets/Buttons/PrintablePage.
    Step 3: Set the button's Destination URI property to point to the current page and set the UIX facet parameter (OARF) to printable as shown in the following example (if you don't know what a "facet" is, please see Controlling UIX Rendering Output for additional information). Remember to retain your application module.
    OA.jsp?page=<CURRENT_PAGE>&retainAM=Y&OARF=printable
    Step 4: Set the button's Target Frame property to _blank. This ensures that the printable page opens in a new window.
    Regards,
    Devang

  • How to use same actions for differ pop-up

    Hi gurus,
    I am using 2 popup in a view.same popup's having same buttons 'Yes', 'No'.when i use 1st one i have to create an action for that Yes button where i put my code for that particular Action.
    But when i used 2nd one the action define for that is not acceptable with differ name.it takes only standard one.
    Now my Query is : How to use same actions for differ pop-up buttons with in a similar view?Where i put my code.
    Plz sugges me.
    <b>Points will be sured.</b>
    Sanket sethi

    Hi,
    Take one integer value attribute in the context of view
    when you r performing action on POP1 set it's value to 1
    when you r performing action on POP2 set it's value to 2
    create one method which receives integer argument, say diaplay(int a)
    In the action call display(wdContext.currentContextElement().get<intvariable>()) by passing the value in the context attribute
    in display() method, Check the value of integer variable..
    if it is 1 then perform action related to POP1
    if it is 2 then perform action related to POP2
    Regards
    LakshmiNarayana

  • How to use same actions for differ pop-up buttons

    Hi gurus,
    I am using 2 popup in a view.same popup's having same buttons 'Yes', 'No'.when i use 1st one i have to create an action for that Yes button where i put my code for that particular Action.
    But when i used 2nd one the action define for that is not acceptable with differ name.it takes only standard one.
    Now my Query is : How to use same actions for differ pop-up buttons with in a similar view?Where i put my code.
    Plz sugges me.
    <b>Points will be sured.</b>
    Sanket sethi

    Hi ,
    u can use the method SUBSCRIBE_TO_BUTTON_EVENT of the IF_WD_WINDOW interface ... to handle the event fired by the popup .....used this method after creating the popup window ...
    regards
    Yash

  • How to install NW2004s abap and/or java on Oracle 10g on SLES 10 32 bit?

    Does anyone know - How to install NW2004s abap and/or java on Oracle 10g on SLES 10 32 bit?
    Does SAP offer the software for trial for this?
    Jay

    Hi Check the link page you shall get the PDF and then goto Page 50 .you shall find the details.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3096e412-7308-2b10-4999-e16c64ce5eeb
    Thanks
    Rishi Abrol

  • How to achieve same start date for two ATO Items- req to built together

    We have two ATO Items and these to be built & shipped together which have different leadtimes, How we can have achieve same start date when we release from ASCP.
    E.g: ATO_Model1*24234 SO Line 1, the rolled up LT=10Days
    ATO_Model2*325325, the rolled up LT=3
    So, under normal scenario ASCP will suggest two different release dates based on LT. So, I would like to start both Job togther considering the max leadtime.
    Hoping for your expert advice.
    Thanks

    Hi,
    Please check Vendor Master data: FK02 ->company code data -> Payment transaction accounting: unflag 'individual payment'.
    Make a test and let me know if it's okay.
    regards

  • How to call same vi for 4 times in a single vi?

    Hi.. I ve one vi named 1D array Mult. I need to call this vi four times in another vi program. The problem i ve experienced is all the four vi outputs are same.
     My question is: How to call the same vi for many number of times?
    Thanks in advance
    Solved!
    Go to Solution.

    There is no problem (programmatically) with calling the same VI by placing it 4 times onto the block diagram.  You do not have to rename them VI1, VI2, VIn if they all do the same thing, as you have done here with 1D-arrayMult...  It's just messy.
    You may need to make re-entrant in certain cases.
    A better way to do it would of course be to use a For loop as shown (I left what you did in tact).
    Are the two formula nodes identical?  I didn't check.  If so, use a for loop there too.  Build your A and B matrices to a 3D array and auto-index in For loop - single instance of your formula node.
    It is quite concerning what you have done in your 1-D Array VI.  I have no idea what it is supposed to be doing, but it appears to be nothing; it is completely wrong.
    There are backwards wires, your While loop does nothing (there is not shift-register) - how will it Stop?!, your cases 0, 1 and 2 are all the same!  Timer of 1000ms??! hmm..
    If you are trying to multiply two matrices (arrays) together then just use the native LV function to do it and to add them at the end try this:
    Hope this helps you!
    Message Edited by battler. on 03-12-2010 03:49 AM

  • How to use same form for Editing info and creating info.

    Hi all,
    Here my aim is to select the user from list and edit the user info. There is one more option to create the new user.
    Currently I am using two separate input forms one for Editing and one more creating new user.
    Can anyone tel me, how to use the same form for both editing and creating.
    Thanks,
    Ramesh Biradar

    Hi Ramesh,
    I'll make some assumptions about how you're going about this, and then give you a possible solution:
    I assume that you have a table with selection on one page. To edit an item, you wish to select it's radio button and click an edit button to take you to another page with the item filled in to edit it. To create a new item, you'd like to click a "new" button and go to the same page.
    If this is correct, here's the basic steps:
    1). Assuming you have both the list and edit pages already created, make sure you have a JSF navigation case defined going from the list page to the edit page. I'll call this navigation case "goToEditPage" for this discussion.
    2). To make the edit button, drag a command button from the component palette and drop it on the af:TableSelectOne (the column in your table containing the radio buttons for selection).
    3). Set the action property on this command button to "goToEditPage".
    4). Now, to make the create button, drag a command button from the component palette somewhere on the page. I like to put mine in a panelButtonBar inside the actions facet of an af:Page component.
    5). Now, for the Action property of this command button, bind it to a method in your page's backing bean. The code will look something like this:
    public String performNew()
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("Create");
        Object result = operationBinding.execute();
        if (!operationBinding.getErrors().isEmpty())
          return null;
        return "goToEditPage";
    }Hope this is helpful, Ramesh.
    Regards,
    John

  • How to achieve Delegation & Substitution for GP system in UWL for CE 7.1

    Hi all
    Could you please guide me , how to achieve delegation & substitution concept for GP system in UWL for CE 7.1.
    when i am trying to click on the Manage Delegation dropdown link which was there in top right corner of the UWL screen , then i am getting the error as " No system is activated for substitution rule " .
    Could you please tell me in our scenario how to activate the System for delegation rule since we are using GP system for GP related tasks in UWL. in all the documents they have mentioned how to achieve the same in R/3 workflow tasks but we are looking for GP tasks how to activate system.
    Is there any changes are required in UWL XML files for achieving this substitution & delegation rule for CE 7.1??
    In EP 7.0 how this delegation & substitution was enabled in UWL , could you pls tell me what are the changes are required to be done??
    if anybody helps on this then it is great help!
    Regards
    Sunil

    Hi Sr,
    There is Trails view in Result . which is newly introduced by Oracle.
    With the help of this you can achive this solution.
    Thanks & Regards
    Rahul

  • Does anybody know a reliable hashCode-function for strings?

    Hello,
    I would like to exchange hashcodes between clients and server, both running at different jre's (even msjvms are running it) - and for the same string they should be identical.
    Javadoc mentions that Object.hashCode() may vary from imlpementation, but I would need an implementation which would be consistent across jvms.
    Does anybody know a reliable function which does compute a integer-hash-value out of string?
    Reliable means that its quite unlikely that two different strings get the same hash-value (although I know this cannot be guaranteed 100%).
    Thanks in advance, lg Clemens

    Even the hashcode() API points out that
    it is just a suggestion that it returns the memory
    address of an object, an implementation that might
    differ from other JVMs. So if you'd rely on that
    behaviour, you'd need to check JVM vendors as well.True, and that is why you shouldn't rely on the fact that Object.hashCode returns the memory address, but I think it's safe to rely on the fact that String.hashCode returns the same hashCode on all platforms (if they are using the same Java version).
    The javadoc for String.hashCode says:
         * Returns a hash code for this string. The hash code for a
         * <code>String</code> object is computed as
         * <blockquote><pre>
         * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
         * </pre></blockquote>
         * using <code>int</code> arithmetic, where <code>s</code> is the
    * <i>i</i>th character of the string, <code>n</code> is the length of
    * the string, and <code>^</code> indicates exponentiation.
    * (The hash value of the empty string is zero.)
    * @return a hash code value for this object.
    So that contract must be fulfilled by all implementations.
    Kaj

  • How to achieve automated posted for invoice and stock transfers

    Hi,
    I have following queries for an RFP, can some one give hints on how to achieve them in SAP
    o Receive self-billing documents from the customer, stating the deliveries and amounts that are settled and paid
    o Automatic posting of invoice documents from the vendor, based on the data from the purchase order and goods receipts
    o Process material stock transfers between two plants that use different SAP systems
    Thanks & Regards
    Raghu

    Hi,
    Normally when we do GR we take the cenvat credit by capturing & posting the excise invoice.
    This can be done using the t.codes - MIGO or J1IEX.
    So when the Material doc is posted the Part 1 register gets updated with Qty received.
    If we post the excise inv using either MIGO or J1IEX the Part 2 register gets updated.
    Now if you have done both the above then inorder to cancel the excise inv.
    1. You have to cancel the Material Doc (so system wil use the Mov type 102)
    2. Now Post your excise inv using J1IEX so that your Part1 reg will be updated ( i.e you are reversing the Cenvat Credit that you have availed).
    3. Finally you have to cancel the Excise inv document using J1IEX so that your Part 2 register wil be updated.
    Make sure that you do the above steps as per the above sequence else system will show the error as you mentioned.
    Hope its clear.
    Regards,
    Kiran

  • How to use destination function for javascript

    Hi,
    I used javascript:var a = window.open('OA.jsp?page=/oracle/apps/cdar/admin/brandupload/webui/SupportPG&retainAM=Y&OARF=printable', 'a','height=500,width=900,menubar=yes,toolbar=yes,location=yes'); a.focus(); in destination URL property, it can work to popup another window.
    But I want to setup a Oracle function for this javascript, and use Destination FUNC property on the button to popup window. But it can not work after I setup a SSWA jsp function with WEB HTML.
    Could some one help this?
    Thanks,
    Eileen

    Eileen,
    How are you adding the OA function ? I have also tried destination url property but not the destination function.Probably you should do sth like this :
    In ProcessRequest :-
    <OABean> <var name> = (<OABean>)webBean.findChildRecursive("<Bean Id>");
    <var name>.setOnClick("javascript:window.open ('OA.jsp?OAFunc=<funcName>','new','height=550,width=850,status=yes,scrollbars=yes,toolbar=no,menubar=no,location=no' );
    OABean is the bean on click of which the page should open like a hyperlink or sth like that.
    Hope this helps.

  • How To create Library Functions for Validate Items

    Hi all,
    My form Consists data block blk_user with two items
    username and password
    Both user name and Password are required Fields.
    When user left these items Empty To show Alert
    I Created Below Procedure and Called in Form_Level ON-ERROR Trigger.
    PROCEDURE pcd_io_alert IS
         itm_name VARCHAR2(20);
    BEGIN
         IF Error_type ='FRM' AND Error_code = 40202 THEN
         Message(get_item_property(NAME_IN('SYSTEM.CURSOR_item'), PROMPT_TEXT )||' Should
    Not Be Empty');
         SET_ALERT_PROPERTY('ALT_IO',ALERT_MESSAGE_TEXT,
              (get_item_property(NAME_IN('SYSTEM.CURSOR_item'), PROMPT_TEXT ))||' Should Not
    Be Empty');
         itm_name := Show_alert('ALT_IO');               
    RAISE FORM_TRIGGER_FAILURE;
         END IF;
    END;
    It working fine.
    Could You Tell how to call or create this procedure as Library functions and call the created library in form To SHow Alert. Actually I want to create library functions to Validate and Show Alert Mesages.
    Regards
    R.MaheshBabu.

    Hello,
    Could you give Some examples or links related to how To create and call library functions For validate Items..For creation you already created one procedure and you called on error. So for creation and call it is clear. Now you are talking about validation for items. It depends on your requirement. As you check validation in items's triggers you can also check validation in function/procedure of library. You can use parameter to pass values and check the validations. And you can create the procedure/function in library like this...
    PROCEDURE My_Proc(Parameter_Name IN DATATYPE) IS
      Variables Declarations...
    BEGIN
      -- Here check the validation on the passed value.
    EXCEPTION
      -- Exception Handling part...
    END;
    FUNCTION My_Proc(Parameter_Name IN DATATYPE) RETURN DATATYPE IS
      Variables Declarations...
    BEGIN
      -- Here check the validation on the passed value.
      RETURN <ANY VALUE>;
    EXCEPTION
      -- Exception Handling part...
    END;
    Is it Possible to use system variable ':system.cursor_value' while creating PL/sql library functions?Yes, because it is clear as you used for CURRENT_ITEM like NAME_IN('SYSTEM.CURSOR_item') so you can use SYSTEM VARIABLES.
    -Ammad

Maybe you are looking for