UNION changes type of field

Statement 1:
SELECT E0380.CardValue
FROM (SELECT E0465.CardValue FROM E0465 UNION ALL
SELECT null AS CardValue FROM E0465) E0380
Statement 2:
SELECT E0465.CardValue FROM E0465
I use OleDbCommand to execute these 2 statements. For statement 1 I use GetDecimal method to get value.
For statement 2 I use GetDouble to get value. The type of field CardValue is FLOAT. Why the type in these 2
statements are different? How to solve this problem?
My Oracle is 10g and connection string is "Provider=OraOLEDB.Oracle;Data Source=EMS;Password=abc;User ID=S000"
Thanks a lot
Edited by: user1095915 on May 8, 2012 10:59 AM

I believe the behavior you're describing is apparent outside of OLEDB, so the database sql forum may be better equipped to assist.
I tested the following, so we could easily see the resulting datatype from the union:
SQL> create table floattab(col1 float);
Table created.
SQL> SELECT E0380.col1
  2  FROM (SELECT floattab.col1 FROM floattab UNION ALL
  3  SELECT null AS CardValue FROM dual) E0380;
      COL1
SQL> create table tt as SELECT E0380.col1
  2  FROM (SELECT floattab.col1 FROM floattab UNION ALL
  3  SELECT null AS CardValue FROM dual) E0380;
Table created.
SQL> desc tt;
Name                                      Null?    Type
COL1                                               NUMBER
SQL> desc floattab;
Name                                      Null?    Type
COL1                                               FLOAT(126)
SQL>If I read the docs correctly, it looks like this is probably expected, but the database folks may be able to comment better since the behavior does not seem related to OLEDB.
http://docs.oracle.com/cd/B19306_01/server.102/b14200/queries004.htm
Hope it helps,
Greg

Similar Messages

  • Dynamically change type of field.

    Hi.
    Is it possible to change the type of a textfield when you call a screen?
    For example I have screen 130 with textfield txt_Input.
    At PBO I call setfields.
    Now is it possible to change the type of txt_Input to type I or C or ... in Module setfields?
    So they can't enter a letter when I need a number..
    Greets

    HI
    Taks this field as field-symbol
    like field-symbols: <fs1>
    at run time you can assign any type to it
    like
    data: v_matnr like mara-matnr.
    clear <fs1>
    <fs1> = v_matnr.
    Regards
    Aditya

  • Form fields from InDesign changing type of field in Acrobat

    I created a form in InDesign CC 2014 and saved as PDF, Acrobat XI Pro. Some, but not all, of the "Combo Boxes" in InDesign got automatically converted to "List Boxes" in Acrobat. They should have been "Drop Down" boxes in Acrobat because that is the Acrobat equivalent of InDesign's Combo Boxes. Anyone know how to prevent this unwanted change?

    Hi Jay ,
    If possible please share the file on [email protected] and cc it as well on [email protected] so that we can analyse the file at our end and see what exactly is happening .
    We would surely help you with the and assist you in the best possible way .
    Regards
    Sukrit Dhingra

  • Changing data types of  fields in structures

    Hello,
       Currently we are working for upgrade to ECC 6.0 .
       In some transactions we are using BAPI_MATERIAL_SAVEDATA to create material.
      We have some additional fields in MARA and MARC table , which we fill using BAPI_TE_MARA and BAPI_TE_MARC structures.
        In these structures we have different data types for fields earlier in 4.6C
    Now this function module is only working if we change  data types of  fields in these structures only to char type. It is going for dump , if we maintain any other data type.
      Could any body tell me why should we change for char data type ?
    Regards,
      SATYA

    Hi,
    Check enhancement category (Extras --> Enhancement Category) for structures before enhancement. For example, for BAPI_TE_MARA structure, enhancement category is given as character type or numeric type. That means you can add the fields of data type only C and N. No other data types are allowed. If you select as not classified then you can add any data type. This option plays important role while enhancement.
    Regards,
    Prasanth

  • Could not changed cost center field in document type RE - FSG

    Dear Experts,
    I would like to change 'cost center field' in act document type RE (invoice receipt) through transaction FB02
    I have changed the field of 'cost center' in field status group in OBC4 and OB41 (posting key 50 and 86)
    The field staus group both in OB41 and OBC4 are already set as 'optional entry' but field of cost center is still could not be changed/edit (grey area).
    Kindly advice
    Thank you.

    Hi Chandra,
    Can you please details the coding part if you can remember ..so that would be helping me lot...Since it's production issue , we have implement immd.
    Regards,
    Lalit
    Edited by: Lalit  Sharma on Dec 24, 2009 6:45 AM
    =======================
    This problem can be closed. I got the note.
    Edited by: Lalit  Sharma on Jan 12, 2010 12:50 AM

  • How to Change the Value Field Type of a Value Field

    Hi,
    How can I change the value field type from Currency to Quantity of a value field? I have tried to do it in KEA6. I can change the value field and its description, but not the value field type from currency to qty. If I change this config, is there any other changes that I need to make so there is no side issue of this change?

    Hi Prem,
    Once you created value field as quantity or currency, you can not change this nature of value field. Based on this, system creates lots of data and tables. For this reason system will not allow any changes in quantity or currency.
    Alternative way is to remove the old value field and  create a new value field assign to operating concern and put all your seetings.
    Please let me know if you require any clarifications.
    Thank you,
    Regards,
    Santosh
    Reward points if helpful.

  • Pernr change type field

    Hi,
    Does anybody know if is possible to change type field PERN ?? We need this field were type char, not type numc.
    Thank you in advance,
    Marta.

    Hello Marta,
    I think you mean the structure PERNR right? No don't change this structure this will affect a lot in your system as this field is also use in HR.
    Regards,
    Raynard

  • Change type field active mode while selecting Change number type

    Dear All,
    Our requirement is to get the list of Change type in the CC01 T-code when we click the change master. When we select ECR then we are getting the change list of change type. But, when we select the change master as type, then change type is coming as grey field. So we want the list of change type in change master
    Please suggest
    Regards
    Honyal

    Any input ?????????
    please
    Regards
    Honyal

  • How can we change the input field on a view stop showing zeros

    Hello,
           To make screen look consistent with other character input field. How can we change the input field on the view stop displaying zeros even though the data type is NUMC and data type should not be change?
    Edited by: sap_learner on Mar 25, 2010 5:44 PM
    Edited by: sap_learner on Mar 25, 2010 5:49 PM
    Edited by: sap_learner on Mar 25, 2010 5:55 PM

    hello Manas Dua,
                           Thanks for your help. I am able to resolve my problem.
    My code will help  the future comers to resolve this kind of issues.
    *The code is applied to method WDDOINIT of the default view.
      DATA lo_nd_terms_input    TYPE REF TO if_wd_context_node.
      DATA lo_nd_terms_input_i TYPE REF TO if_wd_context_node_info.
      DATA lv_zeros             TYPE wdy_attribute_format_prop.
      lv_zeros-null_as_blank = 'X'.
      lo_nd_terms_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
      lo_nd_terms_input_i = lo_nd_terms_input->get_node_info( ).
      lo_nd_terms_input_i->set_attribute_format_props(
        EXPORTING
          name              = `ENTER THE ATTRIBUTE NAME`
          format_properties = lv_zeros     ).
    Edited by: sap_learner on Mar 26, 2010 5:02 PM

  • Error when trying to set a date type edit field

    Hi all
    I have an edit text field in a form which is bounded to a date type
    database field using dbDataSource.
    When i try to set the edit text field value with Today's date by code.
    I recieve an error message that the value which
    i'm trying to set is not legal. the  error number is [131-183].
    I use the following code to set the edit field:
    If oEditText.Value.Trim = String.Empty Then
                Dim strDate As String
                Dim sboBob As SAPbobsCOM.SBObob =
                 oCompany.GetBusinessObjec(SAPbobsCOM.BoObjectTypes.BoBridge)
                 rs = sboBob.Format_DateToString(Microsoft.VisualBasic.Today)
               strDate = rs.Fields.Item(0).Value.ToString().Trim()
    Try 
           oEditText.Value = strDate
    Catch ex As Exception
        SBO_Application.MessageBox("error setting
    current date: " & ex.Message)
    End Try
    End If
    My question is how can i set the edit field with a valid value?

    Hi!
    When writing to EditText.Value you must always use the B1 "DB-Format" as String.
    The following examples are assuming (it's a must!) that the EditText-Fields are bound to a corrosponding DataSource (Type Date, Price etc...)
    MyDateEditTxt.Value="20080207"
    MyPriceEditTxt.Value="1341.79"
    The best of it: It's Windows and SBO-GUI-Language independent.
    EditText.String must always be written with the format of the actual Language of the SBO-GUI, which can be changed by the user....
    You may also have a look at my statements regarding these problems near the end of this thread:
    [How to pass date value to an UDF;
    Cheers,
    Roland

  • How to restrict change type in CC31

    Hi ,
    I have a new requirement in which I need to restrict change types in txn CC31 (Create ECR).onlya set of people should create a ECR with one change type and another set of ppl with another change type, but I am not able to find any auth object with the field CCART(Change types) to provide these restrictions .
    Is creating a new auth object the only way ? please let me know if there is any other possibility  or any other auth objects which can be used for the same ?
    Thanks,
    Nanda

    Fields of such types (e.g. document types, master data accounts, etc) are often not the same field name that you are looking for in an authorization object, but rather grouped in their master records and the authority-check is against the assigned group value.
    More often than not, if no group value is assigned to a record then no check is made.
    So what you can try to look for is a BEGRU type field of an object in the code and look to see where it is gettings its value from.
    Might be worth a try...
    Cheers,
    Julius

  • What events change the Created field in, finder, get info

    On my laptop, in finder, in the get info screen there are 2 fields the Created Date and Modified Date fields.
    I was looking at these fields for an app that I use on my iPhone, it was listed in finder, so I clicked the get info option.
    The created date and modified date were 10/16 both the same.
    I have not used this app in a long time, my question is this.
    What event changes the created field?  If the app was downloaded on the Iphone will the created field get updated in finder?
    or if it was an update on itunes, would that change the created date in finder?
    Does the created date mean that the app was downloaded and installed on that date?

    Thank you so much.  That works just fine.  However, I also just discovered something.  Evidently, at least some of the fields in list view are editable.  By adding Grouping to the columns shown and clicking on the empty field, I was actually able to type whatever I needed into the field.
    I have not yet tried it with other fields, but will do so to see if it works for all fields in the list view.
    Laura

  • QM03-Custom tab-Change to text field not reflecting-FG - XQQM-screen-0106

    Hi,
    I have a requirement to change the text field on a custom tab of QM03 transaction. Quality notification type is Z1 and the tab is "Checklist". Both are custom defined.
    The existing text field is of 3 lines. The new text message is of 8 lines. When I did the changes on the custom screen 0106 in the function group XQQM, the changes are not reflected on the QM03 transaction's custom tab. Only first 3 lines were reflecting the change and rest of the 5 lines are not appearing on the screen.
    Pointers on this will be definitely helpful.
    Regards,
    Mallika.

    I had a similar problem, but it was with the message line. I found that with Web Forms, I had to issue the Synchronize; a second time, but in Client/Server Forms 6i, the first synchronize worked. Here is the code I used:
    <pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy"> SYNCHRONIZE;
    if Get_Application_Property(User_Interface) = 'WEB' then
    synchronize;--first does not work on web
    end if;</font></pre>
    Let us know if this works.

  • No message for validation error "format", type "date", field "date-expired"

    Dear
    Guys,
    i am getting the following error : ((No message for validation error "format", type "date", field "date-expired"))
    When trying to upload adobe connect 7 license to the adobe connect 7 configuration wizard. the problem occurs because my server was install on Arabic Saudi Arabia date format while installation, but if i change the windows date format to US then the problem still occurs, and formatting windows is not possible, could anybody help??
    Regards

    Thank you for replying,
    No i am not on host mode, a have installed it deferent times ago successfully, but the only problem now is that during the installation windows server 2008 the default language, time and date. Was set Arabic Saudi Arabia. And even changing it does not solve the problem, as i mentioned above.

  • Adobe changes my numeric field to include commas when validation fails

    Adobe changes my numeric field to include commas when validation fails. My numeric validation setting is num{zzzzzzz9.99}. I want my numeric field to display as 99999999.00, no commas and only to have 2 decimals places. I added this validation to the Display, Edit, Validation and Data tabs under the validation pattern dialog box.
    When validation fails, adobe changes the display of the field to include commas and drops the decimal places:
    999,999,999
    How can I prevent this from happening? Any feedback is greatly appreciated.
    I've also added a change event to the field as well:
    \\only allows numbers and period.
    if (xfa.event.newText.match(/[^0-9.]/))
    xfa.event.change = "";
    \\only allows 11 characters to be entered.
    var maxLength = 11;
    if(xfa.event.newText.length >maxLength)xfa.event.change = "";

    I want it to display only numbers followed by 2 decimal places.
    999999999.00
    If I type all numbers in my field like 999999999999 and I go over the character limit of 11. My validation fails and then my numeric field is displayed with commas, 999,999,999 without the 2 decimal places. Is there a way to prevent adobe from automatically changing my fields?

Maybe you are looking for