Conversion functions

Can anyone suggest a reading on conversion functions in Oracle 9i?
how to convert a varchar to a number?

look into doc
http://download-east.oracle.com/docs/cd/A91202_01/901_doc/server.901/a90125/functions142.htm#1003400
SQL> select to_number('12'), to_char(12) from dual;
TO_NUMBER('12') TO
             12 12added query
Message was edited by:
devmiral

Similar Messages

  • Need help for Conversion Function in Oracle

    Hi, Can Any One help me Please.
    I need a Oracle conversion script for converting from decimal to hex. and decimal to datetime.
    Thanks In Advance.

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

  • Conversion function module

    Hello Friends,
              When ever i down load into excel file the filed 'WERKS' is becoming from '0780' to 780 and when i try to upload i am getting as 780 which is creating  some problems. Is there any conversion function module to convert the the field WERKS from 780 to 0780.
    Thanks in advance.
    Siva Kumar.

    Hi
    When you are using FM 'GUI_DOWNLOAD' to download to excel file, you need to populate the parameter FILE TYPE with DBF.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = p_file
    <b>filetype = 'DBF'</b>
    Thanks
    Vijay
    PLZ reward points if helpful

  • Using conversion functions

    When using the numeric conversion functions, such as to I16, what determines whether a number greater than the upper limit is coerced to the upper limit or is wrapped around from the lower limit?

    > When using the numeric conversion functions, such as to I16, what
    > determines whether a number greater than the upper limit is coerced to
    > the upper limit or is wrapped around from the lower limit?
    >
    In general, LV will coerce the way that the CPU does. Integers to
    integer will take the lower portion, performing a modulo operation.
    Float to integer will pin, typically to the correctly signed maxInt.
    If it is important to your algorithm, build a quick test VI.
    Greg McKaskle

  • Informix Date Conversion Functions

    I am converting some Informix ESQL/C programs to Oracle Pro*C.
    I was wondering if there are any libraries out there that do the same thing as the Informix Date conversion functions(to avoid re writting them).
    Thank You
    null

    Hi ,
    Please try this one.
    if ITAB_DTL-date   <> ''.
                       CONCATENATE ITAB_DTL-date+6(2) '.'
                                   ITAB_DTL-date+4(2) '.'
                                   ITAB_DTL-date+0(4)
                              INTO ITAB_DTL-w_date.
    endif
    Thanks
    Karthik

  • How can I create a conversion function?

    Hi!
    I want to know hot to create a conversion function.
    I want to display at program screen the format 000.000.000-39 but register 00000000000(char 11).
    Thanks

    Yes you can.  I will point you to an example.  You can do the same.
    1. Display domain PS_POSNR in SE11.
    2. Click on the Definition tab.
    3. Look at the field called Convers routine. It says ABPSP
    4. Double-click on this field.  This shows two function modules, one called *..INPUT and the other called *..OUTPUT.
    You will have to create a function group with those two function modules and assign the conversion routine in the domain,

  • Currency conversion issue in SPM. We are getting incorrect results with SPM conversion function from one of the document currency to USD.

    Currently we are using SPM 2.0 version and we have been facing currency conversion issues.
    Please help me in following aspects.
    1) Where actually currency conversion happens in SPM. Is it the global program which does the conversion or other way.
    2) We have conversion issue for one of the currency where conversion function is giving incorrect results when converting from one of the document currency to USD. here The respective document currency is considering the 1:1 ratio with Dollar which is actually incorrect.
    3) We have verified in both BI side(currency tables) and even ECC side.
    Please help me in understanding this issue and let me know if you need more information on this.
    Its an production issue and appreciated your immediate inputs.
    Thanks
    Kiran

    Hi Arun,
    The following information may be helpful to you.The SSA_HELPER_PROGRAM has options regarding currency settings.
    EXCH_RATE_TYPE: This flag governs the exchange rate type which will be used for currency conversion in data management. For example if RSXAADMIN contains an entry EXCH_RATE_TYPE = „ZSPM‟ then the conversion type used for currency conversion is ZSPM. The default value for the exchange rate type is „M‟. More details can be found in the note 1278988.
    CURRENCYCONVERSION: By default data management converts all the measures in transaction currency to reporting currency and copies over to the corresponding measure in reporting currency. If the measure in reporting currency is already available in source it might be desirable to disable the currency conversion. To disable the conversion you can make an entry CURRENCYCONVERSION = „ „ in the table RSXAADMIN. This can also be achieved by running the program SSA_HELPER_PROGRAM with the option DEACTIVATE_CURRENCYCONVERSION. The conversion can be reactivated by running the same program with option ACTIVATE_CURRENCYCONVERSION.
    UNITCONVERSION: Similar to above. To deactivate unit conversion you can use the program with option and DEACTIVATE_UNITCONVERSION and to reactivate ACTIVATE_UNITCONVERSION. By default both the conversions are switched on
    EXTERNAL_CURRENCIES: Normally most of the international currencies are stored with two decimal places however certain currencies do have 0 and 1 decimal place too. For example JPY has 0 decimal places. SAP internal format stores even these currencies with 2 decimal places and at the time of display it changes the value to right decimal places. In case a file from external source is loaded to SPM it might have the format with 0 decimal places in the file. To convert it to SAP standard format post processing needs to be done on this value. If that is the case you can set the flat EXTERNAL_CURRENCIES = „X‟ in the table which will enable the post processing for these values. This flag can also be set and reset using the helper program using the option TURNON_EXT_CURRENCY_FORMAT and TURNOFF_EXT_CURRENCY_FORMAT.
    Kind Regards,
    John Harris
    Senior Support Engineer, SAP Active Global Support

  • How to call CLOB to BLOB conversion function within stored procedure?

    I have a tiny APEX application from which I need to be able to print. I’ve used these two resources: (Is there an inexpensive APEX report printer for invoices/checks/statements? and http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13363/up_dn_files.htm#CJAHDJDA)
    I guess that in order to be able to download the RTF document stored in CLOB, I need to convert it into BLOB. I’ve found this function for this purpose on Oracle forums:
    CREATE OR REPLACE FUNCTION     c2b( c IN CLOB ) RETURN BLOB
    -- typecasts CLOB to BLOB (binary conversion)
    IS
              pos PLS_INTEGER := 1;
              buffer RAW( 32767 );
              res BLOB;
              lob_len PLS_INTEGER := DBMS_LOB.getLength( c );
    BEGIN
         DBMS_LOB.createTemporary( res, TRUE );
         DBMS_LOB.OPEN( res, DBMS_LOB.LOB_ReadWrite );
    LOOP
         buffer := UTL_RAW.cast_to_raw( DBMS_LOB.SUBSTR( c, 16000, pos ) );
         IF          UTL_RAW.LENGTH( buffer ) > 0
         THEN
                   DBMS_LOB.writeAppend( res, UTL_RAW.LENGTH( buffer ), buffer );
         END IF;
         pos := pos + 16000;
         EXIT WHEN pos > lob_len;
    END LOOP;
    RETURN res; -- res is OPEN here
    END c2b;And I am trying to use it in the modified download procedure that I also have found on Oracle forums:
    CREATE OR REPLACE PROCEDURE DOWNLOAD_WO(v_id IN NUMBER)
    AS
            v_mime          VARCHAR2(48);
            v_length     NUMBER;
            v_file_name     VARCHAR2(2000):= 'WO_Download.rtf';
            lob_loc          CLOB;
              v_blob      BLOB;
              v_company        jobs_vw.company%TYPE;
              v_project        jobs_vw.project%TYPE;
              v_description     jobs_vw.description%TYPE;
              v_date_          jobs_vw.date_%TYPE;
              v_job_no          jobs_vw.job_no%TYPE;
              v_apqwo               jobs_vw.apqwo%TYPE;
    --          v_mime           VARCHAR2(48) := 'application/msword';
    BEGIN
            SELECT     mime_type, report, DBMS_LOB.GETLENGTH(report)
              INTO     v_mime,lob_loc,v_length
              FROM     report_layouts
              WHERE     rl_id = 22332925279634283;
    -- JOB_VW record:
        SELECT     job_no
                   ,date_
                   ,description
                   ,apqwo
                   ,project
                   ,company       
         INTO     v_job_no
                   ,v_date_
                   ,v_description
                   ,v_apqwo
                   ,v_project
                   ,v_company
         FROM     jobs_vw
         WHERE     id = 214;
    -- Replace holders with actual values:
        lob_loc := REPLACE(lob_loc, '#COMPANY#', v_company);
        lob_loc := REPLACE(lob_loc, '#PROJECT#', v_project);
        lob_loc := REPLACE(lob_loc, '#DESCRIPTION#', v_description);
        lob_loc := REPLACE(lob_loc, '#DATE_#', TO_CHAR(v_date_, 'DD/MM/YYYY'));
        lob_loc := REPLACE(lob_loc, '#JOB_NO#', v_job_no);
        lob_loc := REPLACE(lob_loc, '#APQWO#', v_apqwo);
                  -- set up HTTP header
                        -- use an NVL around the mime type and
                        -- if it is a null set it to application/octect
                        -- application/octect may launch a download window from windows
                        owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
                    -- set the size so the browser knows how much to download
                    htp.p('Content-length: ' || v_length);
                    -- the filename will be used by the browser if the users does a save as
                    htp.p('Content-Disposition:  attachment; filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
                    -- close the headers           
                    owa_util.http_header_close;
                    -- download the BLOB
    --                wpg_docload.download_file( Lob_loc );
                             v_blob := c2b(lob_loc);
                             wpg_docload.download_file( v_blob );
    end DOWNLOAD_WO;
    /Unfortunately when I try to compile the download_wo stored procedure I am getting this error:
    Error at line 64: PL/SQL: Statement ignoredThe 64th line is:
    v_blob := c2b(lob_loc);How should I correctly call c2b within download_wo? Any advice is greatly appreciated.
    Thank you for your time.
    Daniel

    Hello there,
    Well, its invalid :(
    Object C2B is Invalid. I didn't know since when I run the create ... function, I only get this feedback:
    Statement processed.
    0.19 secondsI am investigating.
    Daniel

  • Date Conversion Function Modules YYYYMMDD to MM/DD/YYYY

    Hi,
    I have a requirement to Conver the Dats from format: YYYYMMDD into the Format : MM/DD/YYYY. Can you  please suggest me a suitabble Standard Function Module if exists? If not please suggest me a solution for this data conversion.
    Thanks,
    Rajan.SA

    Hi,
    You can use WRITE FORMATING.
    Here the sample code:
    DATA: BEGDA       TYPE TEXT10,
          ENDDA       TYPE SY-DATUM.
      WRITE SY-DATUM TO BEGDA MM/DD/YYYY.
      WRITE SY-DATUM TO ENDDA MM/DD/YYYY.
    And of course you can use other format, like:
    ... DD/MM/YY
    ... MM/DD/YY
    ... DD/MM/YYYY
    ... MM/DD/YYYY
    ... DDMMYY
    ... MMDDYY
    ... YYMMDD
    Or you can use concatenate statement:
        concatenate SY-DATUM+4(2) SY-DATUM+6(2)
        SY-DATUM(4) INTO BEGDA separated by '/'.
    Regards,

  • Content conversion functionality inside Seeburger

    Hello,
    I am trying to find out what are the content conversion features, probably BIC, inside Seeburger adapter. As of this moment, the standard file adapter has one limited functionality: each record must have an end separator. I was wondering whether Seeburger is able to fix it

    Yes, we use BIC to convert EDI Data to XML in our Adapters.
    It can also process Fixed/Variable length fields and you dont need to have record separators (if there is a positional way to find the end of record). It can be called as a module right after the file adapter.
    If you send me a mail I can get you in contact with our professional service, so they can do setup a demo for your data format.
    Bernd - [email protected]
    Chief Architect

  • Conversion Function module for Volume

    hi,
      Is there any standard function module to do the conversion of VOLUME.
    for example : if i have source volume in one unit & i want it in another unit.
    regards,
    srikanth,Intelligroup.

    If it is a straight conversion and you do not need to use the conversion factors tied to a material then you can do something like this.
    report zrich_0001.
    parameters: p_qtyi type p decimals 2,
                p_uomi type t006a-msehi,
                p_uomo type t006a-msehi,
                p_qtyo type p decimals 2.
    at selection-screen.
      call function 'UNIT_CONVERSION_SIMPLE'
        exporting
          input                      = p_qtyi
    *   NO_TYPE_CHECK              = 'X'
    *   ROUND_SIGN                 = ' '
         unit_in                    = p_uomi
         unit_out                   = p_uomo
      importing
    *   ADD_CONST                  =
    *   DECIMALS                   =
    *   DENOMINATOR                =
    *   NUMERATOR                  =
         output                     = p_qtyo
    * EXCEPTIONS
    *   CONVERSION_NOT_FOUND       = 1
    *   DIVISION_BY_ZERO           = 2
    *   INPUT_INVALID              = 3
    *   OUTPUT_INVALID             = 4
    *   OVERFLOW                   = 5
    *   TYPE_INVALID               = 6
    *   UNITS_MISSING              = 7
    *   UNIT_IN_NOT_FOUND          = 8
    *   UNIT_OUT_NOT_FOUND         = 9
    *   OTHERS                     = 10
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    Regards,
    Rich Heilman

  • Unit conversion  function module

    Hi,
    Can anyone give me the details of this function module
    Function Module name: MENGE_UMRECHNEN.
    its urgent.
    Thanks in advance.
    vaibhav

    Hi Vaibhav,
    This function module gives you the provision of conversion of quantities from Base Unit of Measure to any of the Alternative Unit of Measures or vice-versa.
    But this function would be done only for the materials and its limitation would be determined by the data maintained for a material in T006 table.
    Using this FM you can convert a material quantitity of unit 'X' to unit 'Y' only if 'X' and 'Y' are of the same dimension.
    <b>Reward points if this helps,
    Kiran</b>

  • Data conversion functions ??

    Hi,
    whats the function to convert a numeric data to char ??
    I have a field value which is numeric and when I use it in my BDC program I get a runtime error
    CONVT_NO_NUMBER
    Unable to interpret "/" as a number.
    On debugging, I could see in the code that NODATA is represented as "/" and when it is being compared with my numeric field data, this mismatch is reported. So I think it would be right for me to pass on the value after conversion. the statement currently looks like
    perform bdc_field       using 'RF022-GJAHR'
                                   bkpf_rec-gjahr.
    where gjahr contains data such as 2004, 2005 etc.
    Please help..
    thanks

    Thanks to all for your quick response... Find below my code.. I have recorded BDC for FB12 and pasted that code in my report program, ZFB12 and so the entire code is as follows...
    i am getting error for the last but one line , i.e.,
    perform bdc_field       using 'RF022-GJAHR'
                                   bkpf_rec-gjahr.
    i dont find any means to pass SPACE !! how do i do that ??
    REPORT  ZFB12TEST.
    TABLES:     BKPF.
    DATA: BEGIN OF bkpf_rec OCCURS 0,
                    bukrs LIKE BKPF-BUKRS,
                    blart LIKE BKPF-BLART,
                    cpudt LIKE BKPF-CPUDT,
                    budat LIKE BKPF-budat,
                    belnr LIKE BKPF-BELNR,
                    gjahr LIKE BKPF-GJAHR,
          END OF bkpf_rec.
    SELECT-OPTIONS: so_bukrs FOR BKPF-BUKRS,
                    so_blart FOR BKPF-BLART,
                    so_cpudt FOR BKPF-CPUDT,
                    so_budat FOR BKPF-budat,
                    so_belnr FOR BKPF-BELNR,
                    so_gjahr FOR BKPF-GJAHR.
    include bdcrecx1.
    start-of-selection.
    SELECT bukrs blart cpudt budat belnr gjahr into table bkpf_rec from bkpf
    where bukrs IN
    so_bukrs and blart in so_blart and cpudt in so_cpudt and budat in
    so_budat and belnr in so_belnr and gjahr in so_gjahr.
    loop at bkpf_rec.
    perform open_group.
    perform bdc_dynpro      using 'SAPMF05M' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF022-BUKRS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SEL'.
    perform bdc_field       using 'RF022-BUKRS'
                                  bkpf_rec-bukrs.
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  '19/07'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PICK'.
    perform bdc_dynpro      using 'SAPLF022' '1001'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF022-GJAHR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=GO'.
    perform bdc_field       using 'RF022-BELNR'
                                  bkpf_rec-belnr.
    perform bdc_field       using 'RF022-GJAHR'
                                   bkpf_rec-gjahr.
    perform bdc_transaction using 'FB12'.
    perform close_group.
    endloop.

  • Quantity Conversion Function Module

    Hi,
    I am using BW7.0's feature - Quantity Conversion (TCode: RSUOM).
    I could use it for converting quantity for different unit on the fly during report time.
    Now, I would like to do convert during data upload. Is there any function module that can help?
    Please note that the quantity conversion factor is "Material dependent".
    Thanks in advance.
    Best Regards,
    Chris

    Hi,.
    1) In the BEx Tab page of
    Characteristic 0MATERIAL, maintained the field "Base Unit of Measure" as 0BASE_UOM .
    2) In the BEx Tab page of
    Characteristic 0MATERIAL, maintained the field "Unit of Measure for Char." by click on the New button, it will generate a DataStore Object, which will store information for calculating the conversion factor.
    3) Fill in the DataStore generated with data, using the DataSource 0MAT_UNIT_ATTR.
    Note that we must NOT use the the former infosource technique and update rules for loading data to it. Use transformation and DTP, else the SID could not be loaded to it.
    (I stuck with this problem before..:))
    4) Create a Quantity Conversion Type through TCode RSUOM, the Conversion factor can choose 1,3 or 4, with reference to 0MATERIAL InfoObject.
    5) Then in any query of cube with 0MATERIAL in it, the quantity conversion type defined in step 4 could be use for displaying data in other UOM~
    Hareesh

  • How can i convert the firefox-history-timestamp in places.sqlite into a normal date format? The firefox-timestamp is not equivalent to the unix-timestamp, that's why I ask. I could not find a conversion function. Does anyone know something about this?

    As I opened the places.sqlite with an sqlite-editor I found out that firefox saves the last_visit_date via a timestamp which is 16 digits long. I realized that the first 10 digits are similar to the corresponding unix-timestamp but not equal. So.. how can i convert the firefox-timestamp into a normal date? Or into the corresponding unix-timestamp?

    Write a bash script or 'C' program to change the date format and then use the sql update function to receive the stdio output 'where date_field='embeded date value'.

Maybe you are looking for

  • HP Pavilion DV7; System will not boot; Memory Test Failed using Advanced System Diagnostic​s

    Not sure exactly how, but I managed to contracted several variants of the nasty Rovnix virus and now my system will not even boot into Safe Mode after trying to restore to several different restore points.  Enabled bootlogging, but not sure how to re

  • How can I implement this with CWGraph control?

    Who can help me,i meet a difficult problem: Now i have a form(historygraph.frm), four DTPicker controls(DTPicker1,DTPicker2,DTPicker3,DTPicker4), and three command control(cmdFind,cmdNextPage,cmdPreviousPage). My database is SQL SERVER 2000, In my ta

  • Data Ownership for Reports - ex Customer ageing

    When we run Customer Ageing. The Ageing details for the customer belonging to the Sales employee to be shown. Currently shows all the customers. Ex - Customer 1,2,3 belong to Sales employee A        Customer 4,5,6 belong to Sales Employee B Now when

  • Refund of $100 request {Removed per Forum Guidelines​}

    To whom it may concern, On Monday 11/24 I placed the following order from bestbuy.com after receiving an email for Black Friday early access: Order number: {Removed per Forum Guidelines} Apple® MacBook® Pro Intel Core i5 13334 Display 4GB Memory 500G

  • Failing at Prerequisite on Installing Apche

    Hi All, I am Installing Oracle 11g Fusion Middle ware (Oracle HTTP Server) on Enetrprise Linux 5 on VM. I have Installed Successfully Orale 11g DB Release 2 & when I am trying to Install Oracle HTTP Server ( A part of Oracle 11g Fusion Middle ware) G