Append space when the value is 0

Hi,
I need to pass space if the field value is '0'. I have field which returns '00000000' in the output. For this i need to pass space. I tried many ways to pass space to this field. But its displaying as '00000000' only. How to pass space to this field. In database the field value is displayed as 0.
Regards,
Ram

hi ram,
suppose char1 = '000001'.
do this.
REPLACE all occurances of '0' in char1 WITH space INTO char2.
char2 ='1'.
rgds
anver
if helped pls mark points
Message was edited by: Anversha s

Similar Messages

  • Why have to append spaces when data type is char?

    I have a tabe MyTable which has tow columns(code char(8),name varchar2(16)) and there is one record ('003','mike') in the table,I retrieve the table use the code :
    ......//get database connection
    String sql = "SELECT * FROM MyTable where code = ?";
    PreparedStatement st = conn.prepareStatement(sql);
    st.setString(1,"003");
    ResultSet rs = st.executeQuery();
    ......//other code
    I cann't retrieve the record,I have to append 5 space to the parameter to get data: st.setString(1,"003 ").
    When column's data type is char , I have to append spaces to the parameter values? why?

    or if you want to do it at the API level, you can use the Oracle extension
    OraclePreparedStatement.setFixedCHAR
    public void setFixedCHAR(int paramIndex,
                             java.lang.String x)
                      throws java.sql.SQLException
        Use this method when binding to a CHAR column in the
    where clause of a Select statement. A non padded
    comparision will be done unlike in setCHAR and setString
    case. Not particularly needed for an insert as the
    database will pad it.
    Parameters:
    paramIndex - index of the bind variablex - the literal/variable to be bound.like..,
    String sql = "SELECT * FROM MyTable where code = ?";
    PreparedStatement st = conn.prepareStatement(sql);
    ((oracle.jdbc.OraclePreparedStatement)st).setFixedCHAR(1, "003");
    pstmt.executeQuery();Regards
    Elango.

  • I have deleted my private folder and do not have enough space to reinstall my operating system. How can i transfer files from my hard drive to an USB drive to free up space when the operating system isn't working. or do i need to erase disk?

    i have deleted my private folder and do not have enough space to reinstall my operating system. How can i transfer files from my hard drive to an USB drive to free up space when the operating system isn't working. or do i need to erase disk through disk utilities without erasing data (but will it delete my programs such as photoshop, office, creative suite?

    Connect the computer to another Mac and put it in FireWire Target Disk mode, or use the Disk Utility to clone the drive or image specific folders with the USB drive as the target. After you've copied off everything you want, you'll likely need to erase the drive and reinstall the applications.
    (69695)

  • Changing the colour of a text box when the value is zero

    Hello
    I have some code in an expression that changes the fill colour of a text box in a matrix in an SSRS report.
    When the value in the year fields is greater than zero then fine it changes the colour to what I want it to be but when the value is zero then the colour just stays white.
    I'm not testing the value in the year fields but in the Tier field. It seems to default to no colour when the year fields are 0 though.
    The code I am using is as follows
    =switch(Fields!TIER.Value=1,"PaleGreen",Fields!TIER.Value=2,"Cyan",Fields!TIER.Value=3,"Beige")
    This code is in the year field textbox fill property.
    I have loaded a screenshot to show an example showing what is happening in the matrix.
    Thanks for any help on this
    Regards
    John

    Hi John,
    According to your description, you want to change the background color of a textbox when its value is greater than zero. If in this scenario, we can use the expression below to control the BackgroundColor property of the textbox:
    =iif(Fields!SalesAmount.Value>0,"Yellow","White")
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to Refresh The Page When The Value of selectinputData Changes

    Hi;
    I have a select input date component and I want to refresh the page when the value of selectinputdate changes. What is the way to do it?
    Also what is the way to do the same thing with choosedate component?
    Thank you very much...

    Hi Turhan,
    You may want to read about the Partial Page Refresh (PPR) capabilities in ADF Faces. You can make the selectInputDate's partialSubmit property "true" and then cause the specific components you wish refreshed have their partialTriggers property set to the ID of the selectInputDate.
    Hope this helps,
    John

  • Getting mandatory attribute validation error when the value is defaulted through customization

    Hi
    I am getting Mandatory attribute validation error when we default the value through customization.
    In the UI we have attribute called Last Name which is mandatory at EO level. Customer wanted to default Last name to some value, through page composer it is defaulted to some text and saved.
    When ever we open the page the the same value is defaulted as Last Name and appearing in the UI. But when we submit the page, EO level validation is failing. hence we are getting last name is missing.
    When i debug the code last name attribute value for EO is blank.
    In the UI the attribute last name is associated with bindings  --> #{bindings.lastname.inputvalue}
    The validation is failing if we remove the default binding associated with inputtext box.
    Can some body help what can be reason and is there any solution?
    Thanks,
    Praveen

    version 12.1.2
    I am struggling with same situation, I can't set the default value at business component because, the default value comes from a REST service at run time. In page A,  I have a field F1 that contains value from REST service. Page B has a database bound field F2, whose default value should come from F1 in Page A when a user navigates from Page A to Page B. If I set the value of F2 to be the value of F1, then it displays the value in the UI, but nothing gets submitted to EO and fails at commit.
    To make things difficult, here is my situation: Page A lives in bounded taskflow TF1, and Page B lives in bounded taskflow TF2. So I have created an input parameter P1 in TF 2, which carries over the value of F1 in Page A to Page B. When I am in Page B, I can successfully see the value of the taskflow input parameter P1. So, how do I  programmatically set the value of field F2 with the value of input parameter P1?
    I tried setting the F2.inputValue  in a method call M1 in  taskflow TF2 prior to Page B, but I get null pointer exception as it can't see field F2 yet.
    It seems like a simple thing to do, but I have spent a lot of time trying to make it work without any success.
    I would greatly appreciate any guidance.

  • DefaultCellEditor in JTable can not update itself when the value changes

    Hi,
    I have a JTable which has 4 columns. The 3rd column has a comboBox. whenever I select an item from the first row, the cell at (currentrow, 4thcolumn) will be updated according to the item selected.
    Now the problem is, after selecting the item in any cell with 3rd column, the row is updated correctly, but then all comboBox in column 3 are gone! I cannot figure out what causes this. Please help! Any suggestion will be greatly appreciated!
    Jing

    Thanks! Could you give more details on how to use the second approach?
    I have a table with two columns, one called ID and the other called Value. I'm using JComboBox for the Value column. Whenever I select an item from the comboBox, I want the value in the cell under the ID column to change value to the value selected in the comboBox.
    The problem I'm having now is although I can change the value in the comboBox and which triggers the event to change the value under the ID column, when I click the comboBox of another row, the cell under ID of the previous row changed also, before the value under ID of the current selected row.
    I think the problem is there is no distinct comboBox for each row of the table. Seems like when one box change and trigger an event, that event performed in every other rows in the table.
    Following is the code:
    public class Test extends JPanel{
         DefaultTableModel tm;
         JTable table;
         JScrollPane nscrollPane;
         public int total=4;
         public Vector datavec, thvec;
         public Test(Vector datavec, Vector thvec){
              this.datavec=datavec;
              this.thvec=thvec;
         tm = new DefaultTableModel(datavec,thvec);
              table = new JTable(tm);
              table.addMouseListener(new PopupListener(table));
    // table.addMouseListener(new PopupListener(table));
    //tm.setTableHeader(table.getTableHeader()); //ADDED THIS
    int height = table.getRowHeight()*table.getRowCount();
    table.setPreferredScrollableViewportSize(new Dimension(500, height));
    //Create the scroll pane and add the table to it.
    nscrollPane = new JScrollPane(table);
    setUpNNColumn(table, table.getColumnModel().getColumn(1));
    //Add the scroll pane to this panel.
    add(nscrollPane);
    public void updateLabel(Integer size)
         int r=table.getSelectedRow();
         if(r!=-1)
         ((Vector)datavec.elementAt(r)).setElementAt(size, 0);
         repaint();
    public void setUpNNColumn(JTable table, TableColumn nnColumn) {
              //Set up the editor for the sport cells
              JComboBox comboBox = new JComboBox();
              comboBox.addActionListener(new ComboBoxListener());
              int num=total/2;
              for(int i=0; i<2; i++){
                   comboBox.addItem(new Integer(num*(i+1)));
              comboBox.setSelectedIndex(1);
              nnColumn.setCellEditor(new DefaultCellEditor(comboBox));
    private class ComboBoxListener implements ActionListener{
         public void actionPerformed(ActionEvent e)
              JComboBox cb = (JComboBox)e.getSource();
    Integer size = (Integer)cb.getSelectedItem();
         updateLabel(size);
    private static void createAndShowGUI(Vector a, Vector b) {
    \ JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("Nearest Neighbor Fact Table");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    Test newContentPane = new Test(a, b);
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
         int patidx, hitnum=2;
         Vector a=new Vector();
         Vector a1=new Vector();
         Vector a2=new Vector();
         a1.add(new Integer(1));
         a1.add(new Integer(4));
         a.add(a1);
         a2.add(new Integer(2));
         a2.add(new Integer(4));
         a.add(a2);
         Vector b=new Vector();
         b.add("ID");
         b.add("Value");
         //StatTableGUI.createAndShowGUI(gd);
         Test.createAndShowGUI(a,b);
    Any suggestions? Thanks!
    Jing

  • How to change row background when the value was changed?

    hello expers!!
    i need your help...plz help me.
    i want my table row(specific) background changes when the user changed the value in a cell. I am able to know that a value in a cell was changed but the problem is i dont know how to change row color background. I've researched over the internet on how to solve this problem but nothing was found.
    please see the link to help you visualize what i mean. tnx!
    [http://www.flickr.com/photos/28686474@N04/2708299927/]
    tnx in advance!! code snippet will be a great help...
    Edited by: kagaw3000 on Jul 27, 2008 8:22 PM

    final JTable table = new JTable(data, columnNames) {
    int lastRowChanged = -1;
    @Override
    public void tableChanged(TableModelEvent e) {
         super.tableChanged(e);
         lastRowChanged = e.getFirstRow();
         repaint();         
    @Override
    public Component prepareRenderer(TableCellRenderer renderer,
                   int rowIndex, int vColIndex) {
    Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
         if (rowIndex == lastRowChanged) {
              c.setBackground(Color.RED);
         } else { 
              c.setBackground(getBackground());
         return c;        
    ...........this code will changed background color when data was changed BUT if i changed another data in another row the previous backgound color(RED) will be erase. To make it more clearer, it will only change background color of a row only to one row NOT to multiple rows(that is being edited).

  • How do I create a URL to filter a view when the value I have from list one is the ID that was used by list 2 to pull in the list 1 title?

    My list "Tasks" has an record with Title = "Build SSIS for Duke Energy" and its ID is 1. Then I have a list "Journal" where I have tracked entries related to the progress of the task. When I create the Journal entries I passed
    in the ID of the task 1 which then pulled the title into the Journal's Associated task lookup column. Now I'd like to have a column in the Tasks list that would have a URL to take me to all journal entries related to the Task. But passing in the ID 1 of the
    task does not work. 
    If the lookup column has the actual Title from the task in all the time and it is not dynamically pulled every time the list is queried shouldn't I be able to filter on the Title e.g. "Build
    SSIS for Duke Energy"  

    I ended up going with a workflow to build the URL and sending the title to the look-up column. 
    I tried the script at that site and ran into several problems. It didn't work with views that were grouped, the calculated links did not show on the edit and view forms. I assume those forms would have to be changed to run the script also.
    In addition to, I have to add a CEWP to each view and I was also losing the "Items" and "List" options (next to "Browse") from the ribbon until I clicked around in the list. 
    What are the downfalls of a workflow? I ask because many people default to using a similar TextToHTML script like you mentioned.

  • Trouble using a pattern match in the GO URL when the value starts with %

    Hi guys,
    We are trying to use a Go URL as follows:
    [http://hostname.com:9704/analytics/saw.dll?Go&Path=/users/administrator/Test/TestReport&Action=Navigate&col1=TestReport.SUBJECT&op1=like&val1="%25D8D8%25"|http://hostname.com:9704/analytics/saw.dll?Go&Path=/users/administrator/Test/TestReport&Action=Navigate&col1=TestReport.SUBJECT&op1=like&val1="%25D8D8%25"]
    Basically, we want to send the filter : SUBJECT like '%D8D8%' in the GoURL. However, the report that opens up does not fetch any rows because BI somehow messes up the clause by not recognizing the leading %25 (which is an escaped % character). Instead it resolves the %25D8D8%25 into something like �D8% .
    As you can see, the %25 at the end however gets resolved correctly but somehow the one at the beginning gets clubbed with the leading D8 to give �.
    Any idea, how to get BI to accept a leading escaped % character when doing a pattern match in the Go URL?

    I'm heading to the Apple Store in Danbury CT tomorrow to test out a MacBook Pro. I'll happily post what I like and dislike here.
    Waiting for a MacBook Pro...   Other OS  

  • Calling a java script function when the value of an item changes

    Hi,
    I have got 2 items which are of "Text field(disabled,saves state)" type. The items are "P2_Industry" and "P2_Industry_segment". Have a link next to each item label, so that a pop up opens. Industry pop up shows all the industries and based on the selected industry, the industry segment pop up shows only the corresponding industry segment. Now, there is a problem. Once an industry and an industry segment is selected, if we change the industry, the industry segment does not change, which is not right. I want the industry segment field value to become null once the industry field is changed. Thought of writing an onChange html cell attribute, but don't know why, it is not working in the case of "Text field(disabled,saves state)" item. It works fine for just "Text field" item.
    Could anyone please help me with a solution as the item must be of "Text field(disabled, saves state)" type.
    Thanks,
    Vignesh

    Hi,
    This is the function I use to return value for P2_INDUSTRY and a similar one for P2_IND_SEGMENT as well.
    <script>
    function test(){
    var radioLength = document.wwv_flow.p_ind_array.length;
    var retVal = '';
    if(radioLength == undefined)
              if(document.wwv_flow.p_ind_array.checked)
                   retVal = document.wwv_flow.p_ind_array.value;
              else
                   return "";
         for(var i = 0; i < radioLength; i++) {
              if(document.wwv_flow.p_ind_array.checked) {
              retVal = retVal + ';' +document.wwv_flow.p_ind_array[i].value;
    retVal = retVal.substring(1, retVal.length);
    opener.document.getElementById('P2_INDUSTRY').value = retVal;
    window.close();
    </script>
    I guess the change needs to be done in page 2 only because, on change of INDUSTRY, the function needs to be triggered to clear INDUSTRY_SEGMENT value.
    Thanks,
    Vignesh
    Edited by: Vignesh N on Nov 3, 2009 12:37 AM

  • Change the style of a numeric field when his value is 0

    I need show a numeric field in some reports with color red and italic font, but only when the value of number is low than zero. In another case the text must be normal. Is really possible do that? That applies to section details or final summaries.
    Many thanks for the help.

    Hi
    To make your number filed in Red :
    Right click on the field and go in format field click on Font tab and go in Color formula editor and give the following formula :
    If Sum(fieldValue} < 0 Then CrRed else CrNoColor
    Now go in Style formula editor and give the following :
    if sum() < 0 then Critalic
    This will make your field red and italic when it is less than 0
    Thanks,
    Sastry

  • Send email when a value in the table reached a certain number

    Hello,
    I have a value in a table that when this value is equal or greater than a certain value, I want to send an email to alert. How do I accomplish this? Do I create a trigger? Do I write an o/s korn script and schedule to run continuosly and check for the value to send an email? Thanks.

    Hi, i think that the best form is create a trigger on the table, when insert o update the data send the email when the value accomplish the condition.
    Look the next code, it is a package that send emails,
    CREATE OR REPLACE
    PACKAGE oracle_administrator.dbms_mail_server
    IS
    P_SERVERNAME VARCHAR(50);
    P_RCPT VARCHAR(50);
    P_FROM VARCHAR(50);
    P_TO VARCHAR(50);
    P_SUBJECT VARCHAR(50);
    P_BODY CLOB;
    P_MAIL UTL_SMTP.CONNECTION;
    PROCEDURE INIT_SERVER;
    PROCEDURE SEND_EMAIL;
    PROCEDURE WRITE_DATA(PARAM_DATA IN CLOB);
    END;
    CREATE OR REPLACE
    PACKAGE BODY oracle_administrator.dbms_mail_server
    IS
    PROCEDURE SEND_EMAIL
    AS
    BEGIN
    UTL_SMTP.CLOSE_DATA(P_MAIL);
    UTL_SMTP.QUIT(P_MAIL);
    END;
    PROCEDURE INIT_SERVER
    AS
    BEGIN
    P_MAIL :=UTL_SMTP.OPEN_CONNECTION(P_SERVERNAME);
    UTL_SMTP.HELO(P_MAIL,'hostname');
    UTL_SMTP.MAIL(P_MAIL,'dbaoracle');
    UTL_SMTP.RCPT(P_MAIL,P_RCPT);
    UTL_SMTP.OPEN_DATA(P_MAIL);
    UTL_SMTP.WRITE_DATA(P_MAIL,
    'FROM: ' ||P_FROM || UTL_TCP.CRLF||
    'TO: ' || P_TO || UTL_TCP.CRLF ||
    'SUBJECT: ' ||P_SUBJECT || UTL_TCP.CRLF ||
    'MIME-VERSION: 1.0' ||CHR(13)|| CHR(10)||'CONTENT-TYPE: TEXT/HTML' || CHR(13)||CHR(10));
    END;
    PROCEDURE WRITE_DATA(PARAM_DATA IN CLOB)
    AS
    BEGIN
    UTL_SMTP.WRITE_DATA(P_MAIL,PARAM_DATA);
    END;
    END;
    Luck
    Have a goof day.
    Regards

  • Contract Release Reset when decreasing the Value

    Hi,
    As per our client requirement we need to reset the contract Release Strategy when there is a change in Total Value of contract.
    As per standard behaviour on decreasing the total value of the contract release is not reset.
    How we can acheive this.
    Regards,

    As you already have the answers in your question..
    That release strategy will never re-set if the value is decreased.
    It always gets reset if the value is increased with earlier value.
    Why you want to reset the release when the value is decreased, as the system value which was set earlier already had been released by your approver.
    And contract is ready to proceed for further process.
    The system behaves like even you decrease the value which was falling under the old value so it will not trigger the release again.
    If you want to reset the release again then you need yo increase the value which has not been released earlier..

  • Cascading LOV does not work when setting the value of the parent LOV with DA

    Hello All,
    Using APEX 4.2.2.
    I have tow LOVs
    Parent LOV item is: P50_TYPE
    Child LOV item is :  P50_PROJECT_ID
    In other words in the attributes of the item P50_PROJECT_ID we have :
    > Cascading LOV Parent Item(s): P50_TYPE
    > Page Items to Submit: P50_TYPE
    > List of values definition: something similar to:
    Select * from mytable where type = :P50_TYPE
    I use DA that execute JS code to set the value of the P50_TYPE item
    something similar to:
    > $('#P50_TYPE').val(2);
    Having done this, the P50_PROJECT_ID item does not get refreshed, when the value of P50_TYPE is changed. Namely, P50_PROJECT_ID remains empty, unless end user manually changes the value of P50_TYPE.
    Any help please ?
    Regards,

    Thanks Scott,
    By the way, I remember reading a thread posted by you about  Sumneva Drag & Drop Report Region plugin that was answered by Tom . But, I cannot find this plugin anywhere. Does not it supported in APEX 4.2 ? Is there any alternative out there ?
    If you use it, and it works find with you, can you please send it to me on [email protected] ?
    Regards,
    Fateh

Maybe you are looking for

  • Problem with my Ipod from Iphone

    Two days ago, i put in my Iphone some video files, all was good, i could see all files, all perfectly, but yesterday i dont know how, but i cant see no one of them, i know there are there all files because, the space of that video file are there, i d

  • How to deselect the itemlistbox entries

    hi,     using itemlistbox for currency display, once user select the value and press the save button. In itemlistbox value want to be deselect. while am using invalidate() method it clearing the value in listbox . i don want to clear just deselect th

  • I HAVE A CREATIVE SUITE 5.5 DESIGN PREMIUM

    I WANT TO RE-INSTALL IT ON A MAC BOOK HOW TO DO ?

  • Multi Approval "approverObjects" parameter

    We're trying to use the "Multi Approval" WF and it's asking me to put a parameter called "approverObjects"; for the "approvers" parameter we�re adding the List of approvers but for this one(approverObjects), it's different because it's expecting a li

  • Print Checks in FCH5

    Hi folks! Does any of you know a way to print check automatically in trx FCH5, after the check is created? I've search userexits and ampliations, but i've found nothing... Please HELP!