Converting from BASE 64 to Decimal Base 10

I have an requirement to convert a value from base 64 to decimal base 10
for ex if i give b the resultant output should be 27
as per the website -- http://convertxy.com/index.php/numberbases/
I tried using the UTL_ENCODE.BASE64_ENCODE with UTL_RAW.CAST_TO_RAW
select utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('b'))) from dual
but i am not getting the desired result
Kindly guide me in this issue
With Warm Regards
SSR

The base64 encoding for 27 is not b
SELECT UTL_RAW.cast_to_varchar2 (
          UTL_ENCODE.base64_encode (
             UTL_RAW.cast_to_raw (
                '27')))
          base64
  FROM DUAL
BASE64
"Mjc="27 ist the position of b in
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
which you need in the first step to convert base64 to decimal.
select
instr(
  'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
,'b'
) -1 d
from dual
d
27
vice versa
select
substr(
  'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  ,27 + 1
  ,1
) d
from dual
D
"b"You dont get a result with your approach because b is not a valid base64-encoding.
Otherwise thsi should give a result
SELECT UTL_RAW.cast_to_varchar2 (
          UTL_ENCODE.base64_decode (
             UTL_RAW.cast_to_raw (
                'b')))
          base64
  FROM DUAL
BASE64
but it doesnt, it does in the case below
SELECT UTL_RAW.cast_to_varchar2 (
          UTL_ENCODE.base64_decode (
             UTL_RAW.cast_to_raw (
                'Mjc=')))
          base64
  FROM DUAL
BASE64
"27"Edited by: chris227 on 12.03.2013 07:36
Edited by: chris227 on 12.03.2013 07:41
Edited by: chris227 on 12.03.2013 07:46
Edited by: chris227 on 12.03.2013 08:20

Similar Messages

  • Converting from binary to decimal

    i writ this program to let the user input his number and then it will be converted to decimal,but how can i limited the rang of my digit,or if i want him to enter 4 digits only what can i do,,,and if i dont limit a range how can i make it?

    this is my code
    import javax.swing.JOptionPane;
    public class Ch4_25
    public static void main(String[]arg)
         int F,d1,d2,d3,d4,num=1;
         String N = JOptionPane.showInputDialog("Enter the number");
         num=Integer.parseInt(N);
         d1=num/10000;
         num=num%10000;
         d2=num/1000;
         num=num%1000;
         d3=num/100;
         num=num%100;
         d4=num/10;
         F= d4*1+d3*2+d3*4+d2*8+d1*16;
         JOptionPane.showMessageDialog(null,"the number is"+F);
         System.exit(0);
    }     

  • Unit conversion from Sales unit to Base unit

    HI,
          I am working on 2lis_11_vaitm and 2lis_11_v_ssl sources.
    Both these sources have quantities in Sales unit.
    In BW how do i convert these quantities to Base unit.
    Both sales unit and base units are available in the sources. But value avialable only in Sales unit.
    I am using delivery quantity from 2lis_11_v_ssl and Cumulative order quantity in 2lis_11_vaitm.
    Kindly suggest a way.
    Regards,
    Adarsh
    Edited by: adarsha a on Sep 6, 2008 3:27 PM

    Hi...
    You can use the function module CF_UT_UNIT_CONVERSION to convert from one
    unit to the another.
    Hope this helps you...
    Regards,
    Debjani...

  • How to get additional field from the second list base on lookup information column ?

    Hi everyone,
    Currently I created a SharePoint hosted Apps project and I need to know how can I get additional field from the second list base on lookup information column. example List1 Have 2 columns column1 and column2(Lookup Information from list2 (category)),
    List2 have 3 columns title, and category, and color.  so how can get the title and color from list2 base on this lookup information column (SharePoint Hosted apps and Javascript code)? that is possible?
    Best regards,
    ------------------------------------------------------------ ---Tola---

    You can build one custom lookup control. Refer to the following post
    http://www.stuartroberts.net/index.php/2012/10/03/enhanced-lookup-field-part-1/
    Alternatively, try the following solution from codeplex
    http://sp2010filteredlookup.codeplex.com/
    http://filteredlookup.codeplex.com/
    --Cheers

  • IPad 2 icons go missing from desktop on rotating basis

    As stated, iPad 2 icons go missing from desktop on rotating basis. My iPad was new as of Xmas day. I have NOT synced to iTunes (I don't want to at this time) and I have NOT upgraded the software to iOS 5.0.1 (still on 5.0).
    I have downloaded about twenty apps; five of which cost money from Apple's app store.
    I don't get it. This is a new device that I have been using for less than ten days for only an hour or two a day; I don't believe new purchasers of iPads should be having to contend with icons going missing (icons take turns disappearing when swiping back and forth between the pages of app icons, the names of icons remain, however).
    I have re-booted the iPad. At first the icons all reappear and all seems well until about an hour of usage of opening up various apps and using them, and then the problem re-appears. I have done this three times now, and have resorted to just contending with the problem as the apps will still launch and they run fine, it is just that the full icon doesn't appear (only the name of the app and a missing icon above the name of the app):
    I am thinking the cause could be due to one of two problems/issues, but wonder what others' thoughts are.
    1). Glitchy App. If it is due to a glitchy app (and does not Apple test these apps before giving the all -clear to be downloaded from the Apple app store?), how best to figure out which one it is?
    2) Glitchy OS (iOS 5.0). If this is due to a glitchy 5.0 iOS, is there no other choice than to upgrade to 5.0.1? I really do not want to do that just yet unless it is necessary. [And if it is necessary, would Apple really release a glitchy iOS knowing ahead of time it had problems? Seems strange....]
    Anyone got any ideas or have been experiencing the same issue (is it a known issue)?

    And if you restore as new, you can re download the apps for free as long as you are using the same apple id. 
    If it was a single bad app, you would have said so.  If it was a common problem with the os, it would have been reported by a zillion users. 
    I think your os got corrupted. ( potentially from a bad app, or maybe just gremlins). It is a new machine, just start over.  Reload the apps in small groups so that if it is a bad app, you can narrow the issue down.

  • How could I choose some bytes from HEX string and then convert it to a decimal value?

    Hi I am working with an OMRON E5EN temperature controller using VISA serial to get data, I send the Read from Variable Area command and get this string  in hexa 0230 3130 3030 3030 3130 3130 3030 3030 3030 3030 3041 3203 71 or .01000001010000000000A2.q in ASCII this string means:
    02 STX
    3031 3030 Node and subadress
    3030 End Code Normal Completion
    3031 3031 Command Read from Variable Area
    3030 3030 respt code Normal completion
    3030 3030 3030 4132 Hexadecimal A2 = 162  (this is the temperature data that I want to show in decimal)
    03 ETX
    71 Block Check Character
    I want to choose the eight bytes for the temperature data and convert it to a decimal number. I have seen the examples to convert a Hexa string to decimal but I do not know how to choose the specifics bytes that I need.
    I have look for a driver but i didn´t find any. I am a beginner so please include especific topics for me to study in your answer.
    Thanks
    Carlos Fuentes Silva Queretaro Mexico 

    If the response always has the temperature starting with byte 15 and is always 8 bytes in length, you can use the String Subset function to get those bytes out of the string.  Then use Hex String to Number to convert to a decimal number.
    Well someone already beat me to the solution:
    Message Edited by tbob on 01-04-2008 04:42 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    HexStr2Decimal.png ‏7 KB

  • Adobe offline form with capablity to read data from a local data base.

    Hi ,
            We have customer requirement for a offline Adobe form which will be used by Sales rep, this form when saved to the local hard disk is required to read data from another local data base available in the laptop  and prefill a few fields in the form . 
    Is this requirement technically feasible using Adobe forms?
    Thanks
    Srikanth S

    Well may be it's possible because if you go to the Data View in ALD and create a new Data Connection --> OLEDB database --> Build --> It gives you various options for connecting to different DBs but frankly speaking I have never tried it.
    Check the ALD help for more information on the topic.
    Using LiveCycle Designer > Working with Data Sources > Connecting to a data source > To create a data connection to an OLE database
    Chintan

  • Convert from Comma notation to Decimal Notation, Any FM ?

    Hi Experts,
    I am looking to convert from Europe format to US format for Quantity & amount fields, I mean
    e.g. Europe:  12.3456,78 -> US: 12,3456.78
    pls. i can not use offsetting, replace, pattern, overlay, concatenate etc.
    So, pls. let me know that, Is there any SAP FM for this purpose of DECIMAL NOTATION conversion?
    thanq
    Edited by: Srinivas on Feb 22, 2008 10:48 PM

    use.
    Replace all occurances of ',' in w_value with '.'.
    Check this thread.
    REgarding converting  ','  TO  '.'

  • I want to convert from decimal (5, 2) to decimal (3,0) in data services

    Hi All,
    I want to convert from decimal (5, 2) to decimal (3,0) in data services.
    if anybody knows please let me know with syntax.

    https://scn.sap.com/community/data-services/blog/2013/06/12/conversion-functions-in-bods-with-examplespart3
    https://scn.sap.com/community/data-services/blog/2013/06/12/conversion-function-in-bods-with-examplespart3

  • Convert a channel from Hexidecimal to Decimal

    Is there an easy way to convert a channel from HEX to Decimal without having to change every individual measurement. 
    I am currently using the following command:
     HEXnumCOVNVERTED = (CLng("&h" & HEXnumTOconvert))
    Just curious if there was an easier way around this. 
    BBANACKI

    Sure,
    and you can use the same command for it. Simply use the DIAdem Calculator, which is capable of doing the calculation for a complete channel - row by row.
    The syntax would be something like: ch("dec") = CLng("&h" & ch(1))
    In the formula, replace Ch(1) with the channel you would like to convert.
    Ingo Schumacher
    Systems Engineer Sound&VibrationNational Instruments Germany

  • Extracting data from ms sql data base

    Hi Experts,
    we have a requirement of extracting data from MS SQL data base,could any one pls help me with the approach to extract data
    from ms sql data base(actually we have to extract the data from PRIMAVERA i.e the back end data base is MS SQL data base and the application is built on java)so we have got two options one is using ud connect and the other one is using PI(XI).i came to know the two approach have based on differenct methods,pull and push mechanism.and also for PI,it can be extracted using
    real time data acquisition property in dtp and for db connect it don't support real time data acqusition.
    so pls guide me,which mechanism would be feasible to extract the data from PRIMAVERA to SAP BI.and can you suggest with methods is more efficient.
    Thanks in advance.

    Hi thanks for the reply,
    initially we tried with db connect,but our Bi system(oracle) is mount on unix OS and the Primavera(MS Sql DB)is on windows OS.so we could not found the data base shared library  once if the DB client is installed on the application server.so we are working around with the other possibilities,so can you suggest me which could be favarable in our case.
    Thank You.

  • What is the most sensible way to extend a wifi signal. I am in a cinderblock house and I have to buy something that will give me a single network but added range from my airport extreme base station.

    What is the most sensible way to extend a wifi signal. I am in a cinderblock house and I have to buy something that will give me a single network but added range from my airport extreme base station.

    Use an Airport Express. Configure the AEBS to allow it's wireless network to be extended. This is a dropdown menu option under the Wireless tab. Configure the Airport Express to Extend an Existing Network also under it's Wireless tab. You will need to provide the name of your network used in the AEBS as well as the network's access password.

  • I told my wireless network to forget two airport expresses so that I could rename them.  Now the network does not see them even when plugged in about 10 feet away from the airport extreme base station.  Does "forget" mean forever?  How to reset?

    I told my wireless network to forget two airport expresses 1 1st gen, 1 2nd gen so that I could rename them.  Now the network does not see them even when plugged in about 10 feet away from the airport extreme base station.  The network does recognize a totally new 2nd gen express.  Does "forget" mean forever?  How to reset?

    The network does recognize a totally new 2nd gen express.
    Then, it sounds like you have already reset the 2nd Gen Express, and now you need to set it up again, like you did the first time. Only, this time, assign the device name that you want to the AirPort Express.
    Do NOT use the name that Apple suggests.....which will be something goofy like........Sueswimsf's Red Apple AirPort Express
    Assign a simple name.....something like     2ndGenExpress

  • Convert from String to Int

    Hi,
    I have a question.
    How do I convert from String to Integer?
    Here is my code:
    try{
    String s="000111010101001101101010";
    int q=Integer.parseInt(s);
    answerStr = String.valueOf(q);
    catch (NumberFormatException e)
    answerStr="Error";
    but, everytime when i run the code, i always get the ERROR.
    is the value that i got, cannot be converted to int?
    i've done the same thing in c, and its working fine.
    thanks..

    6kyAngel wrote:
    actually it convert the string value into decimal value.In fact what it does is convert the (binary) string into an integer value. It's the String representation of integer quantities that have a base (two, ten, hex etc): the quantities themselves don't have a base.
    To take an integer quantity (in the form of an int) and convert it to a binary String, use the handy toString() method in the Integer class - like your other conversion, use the one that takes a radix argument.

  • Keys lost in converting from sybase to oracle

    I am trying to convert from sybase 12 to oracle 10 using the migration workbench.
    The oracle data base created does not have the primary keys that were in the sybase data base. I used the tool to create migration scripts, Create.sql and Drop.sql. These scripts create the tables but do not have primary keys in them.
    Another question is I have user types from the sybase database. Is it possible to change them in the tool? Right now it looks like I can only change the basic database types as in smallInt.

    Hi <Please Supply Your Name>,
    What version of SQL Developer are you using?
    "Create.sql" and "Drop.sql" sound like old OMWB names, Just want to double check.
    Thanks
    Dermot.

Maybe you are looking for