hexadecimal to ascii convert function - I need null result for others

Hello

I have a coloumn which is vachar2 and it has numbers hexadecimal ascii codes together. I need to convert strings in ascii codes, but keep numbers.

I can convert hex ascii as below

Select utl_raw.cast_to_varchar2 (hextoraw ('4B414C414E42494C4749')) of double;

Select utl_raw.cast_to_varchar2 (hextoraw (EXCHANGE_ID)) from myTable;

results;

--------

Capture.JPG

Result has many characters that are corrupted due to the number who have coloumn. I only need the significant values like "Kalanbilgi" or "Arayanibil".

Your rules, but this always guessing a bit, you can get on the right track. I thought that...

  • If the passed value contains one of the letters A through F, it must be hex and must be converted to ASCII.
  • If it contains an odd number of digits, it cannot be a string of two-digit hexadecimal codes, so it must be a number.
  • If the converted ascii text contains characters but letters and numbers, it is not valid, so it takes a number
  • Otherwise, it is an ASCII string.

With this set of rules (add or change the way you want) we can do this:

WITH testdata (val) AS

(SELECT "905071917837" FROM DUAL UNION ALL

SELECT "905394609716" FROM THE DUAL UNION ALL

SELECT "905558434737" FROM THE DUAL UNION ALL

SELECT "90555843473" FROM THE DUAL UNION ALL

SELECT '4B414C414E42494C4749' FROM DUAL UNION ALL

SELECT '2444' DOUBLE UNION ALL

SELECT '41726179616E6942696C' OF THE DOUBLE

)

-End of the test data-

SELECT the val

CASE

WHEN val! = TRANSLATE(val,'9ABCDEF','9') THEN ascii_val - contains the letters, must be hexagonal

WHEN LENGTH (val) / 2! = TRUNC ((val) LENGTH / 2) THEN val - an odd number of characters, must be a number

WHEN TRANSLATE (UPPER (ascii_val),'* ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ',' *') only IS NOT NULL THEN val - ASCII contains illegal characters, should be in number

Of OTHER ascii_val

END val_out

(SELECT TRIM (UPPER (val)) val,

UTL_RAW. CAST_TO_VARCHAR2 (HEXTORAW (Val)) ascii_val

OF testdata)

Something like that should do the job (even if you have still some false positives), but the difficulty in the interest of your design, if you do not have to guess what the content of this average field in the future.

Tags: Database

Similar Questions

  • Satellite L500-14F - need audio driver for XP

    Hello!

    I would like to ask your help with the following problem:

    I bought a Satellite L500-14F (PLSJTE) and I would like to use it with windows XP, but I failed get the audio driver.

    I would appreciate your help!
    THX!

    Hello

    The Satellite L500 doesn t supports Windows XP then you will need to look for other pilot sites.

    In your case I am looking on the site of the factory of the sound chip. Normally, you can also download the audio driver.

    And don t forget to install SP3 before installing the audio driver. SP3 contains 2 fixes for Audio cards high definition and you will need!

  • Function that returns null instead of the expected value

    I use SQL Developer version 3.2.20.09. When I run a certain custom stand-alone function, I get a result null instead of the numeric result. Other people in my workgroup to get the correct result. When I run the function by using SQL Plus, I get the expected result. Is it possible there are a few settings in SQL Developer that is causing this behavior?

    Any ideas appreciated.

    -Debi

    Yes, but without seeing your code, it is difficult to know for sure. The first thing I would check is your NLS settings in tools > Preferences.

  • Where is the Convert function in DW?

    I want to convert web pages in HTML 5, but I could not find the option "Convert" in the file menu.

    The "Convert" function is no longer supported in DW?

    I do not remember a feature ' file > convert ' in the program, but maybe it's just because I've always used the following...

    To change a page existing coding HTML5 to html4, xhtml, etc., you can...

    1. open the page in DW

    2. click on modify > Page Properties > title/encoding > change the Document Type (DTD) of HTML 5 drop

    3. valve apply then OK

    4. Rinse and repeat for all pages of a site

    To change the default encoding of new pages that you create with DW...

    1. go in Edition > Preferences > new Document

    2. change the drop Type of default Document (DTD) in HTML5

    3. valve apply, then close

  • I need to flip for mac app

    Try to delete unnecessary applications. I need to Flip for Mac with El Capitan?

    What apps yo want to delete?

    You must follow the instructions in the developer. Some may simply be moved to the trash while others require the use of the app to uninstall functionality.

    What is Flip for Mac?

  • I need a link for windows 7 starter 32 bit X 16-96078

    I need a link for windows 7 starter 32 bit X 16-96078. If possible!

    Hello

    HP do not offer a download for the recovery media option, but there are two options available.

    1. you can order a set of replacement of the recovery media using the link below - it will reinstall the operating system, all the drivers, and almost all of the original software (the exception being often tests of MS Office).  They will also recreate all of the original scores, including the recovery Partition.

    Order HP recovery disks.

    2 you can use the following method to create your own Windows 7 Starter 32-bit installation media.

    Before you try the following, make sure that you can still read all the key character product activation 25 on your label Windows COA (5 blocks of 5 alphanumeric games).

    An example of a COA label can be seen here.

    You can create Windows 7 installation yourself using another PC. However, it not there no download directly available for Windows 7 Starter, so you'll need to download another version (one will do, but the link below is for Windows 7 Home Premium 32 bit - the source of the image is Digital River).

    Windows 7 Home Premium 32 bit SP1.

    For the key on your label of COA to work, you must now use the method described in the following link to convert this ISO to an all-version Installer - the section that require you to edit the ISO is Step 1 DVD universal (although you will create an installer from usb, the method to change the ISO is the same).

    http://www.SevenForums.com/tutorials/85813-Windows-7-universal-installation-disc-create.html

    Once done, use an application like Rufus to create a bootable Windows 7 usb flash drive.

    Use the Flash drive to perform the installation, enter the activation key of Windows on the label of the COA in the request and one time Setup is complete, use the 'method of phone", described in detail in the link below to activate the operating system - this method supported by Microsoft and is popular with people who want to just have a new installation of Windows 7 without additional software load normally comes with OEM installations.

    http://www.kodyaz.com/articles/how-to-activate-Windows-7-by-phone.aspx

    You may need for your laptop, software and additional pilots are in entering either the complete model number or Nr here.

    Kind regards

    DP - K

  • Need some clarification for upgrade

    Experts in the morning,

    I need some references for the process to upgrade between 10 and 11 g.

    I always use DBUA to update our database.


    For most administrators recommend NOT following options. I am confused.

    Experts, please guide me to travel in the right direction.

    > > Is this really necessary until the upgrade process, which is the real benefit?

    SQL > exec DBMS_STATS. GATHER_DICTIONARY_STATS;


    > > To activate my database in NOARCHIVELOG MODE, it provides massive difference during the upgrade process?

    SQL > alter the noarchive base newspaper;


    > > TRUNCATE table audit SYS. AUD$

    SQL > truncate table SYS. Storage of AUD$ drop;


    > > Depends on length process,.

    Size of the database

    Number of synonyms

    Number of data files

    Size of the recovery logs

    Number of installed components

    For the types of data and not the XDB user objects.

    > > Deletion of FILES NETWORK completely from 10 g $ORACLE_HOME, creating newfiles in 11 g $ORACLE_HOME


    $ rm - rf tnsnames.ora

    $ rm - rf listener.ora


    Thanks in advance.

    Hello

    > Is this really necessary until the upgrade process, which is the real benefit?

    SQL > exec DBMS_STATS. GATHER_DICTIONARY_STATS;

    1 prior to advantage, was causing problem - degrade the performance of your database? What its not beneficial?

    Logically, if you see the dictionary is on your information about your database - default provided with products and items of custom applications. Now during the upgrade - given that the term refers to a new addition of things monofores or gout or new table segmetns is getting added to your existing dictionary. Now, if I don't keep his stats up to date on my dictionary itself then update itself is the process of taking time. It will hit my sqls himself upgrade performance

    Thus, in order to reduce this impact - prior to your downtime in pre-upgrade task you can collect stats on your dictionary. While during upgrade if you run / run research in its stats its would take very little time to collect minor statistics and it will not affect the order of execution of ddl or dml SQL out that focus on changes in your dictionary.

    > To activate my database in NOARCHIVELOG MODE, it provides massive difference during the upgrade process?

    SQL > alter the noarchive base newspaper;

    2. I don't know who s/n, suggested the above step to achieve. Not a good, better I would have fired the DBA immediately. Despite that I have perform the update level or no, keep you the database in log mode archive.

    To upgrade, its gives no performance improvement for your upgrade process. What is your intention on the upgrade?

    You want to run through the upgrade in 15 minutes? Listen you dictionary database or application objects develop the direcrtly would increase the upgrade. Is not all synonyms - maybe a few times - up to what the table - dictionary of data updated in upgrade tis - for example bitand 12 c on synonyms function table is changed, so his punches performance - it is not a must and was cause depends on the base of the environment for the environment. Reason for this how you store your environment that will reduce the burden of upgrading

    > TRUNCATE table audit SYS. AUD$

    3. I hope I answered this question is another thread

    > Length upgrade depends on.

    Size of the database

    Number of synonyms

    Number of data files

    Size of the recovery logs

    Number of installed components

    For the types of data and not the XDB user objects.

    It is partially dependent on the data dictionary and how clean it is, whatever. Clean - number sense of invalids and statistics.

    Number of components installed in a concern - it might be a minimum until we reached and deliver the bad SQL with performance.

    Size of database and data file and restore logs is out of reach... If my database is to have 10 k datafles, my upgrade script will go and touch all the header files of data blocks, is indicated in MOS linsks or docs. No, he will not be at level of offers to work on something of dictionary and Oracle database metadata.

    > Deleting FILES of network completely from 10 g $ORACLE_HOME, creating newfiles in 11 g $ORACLE_HOME

    You have any load 2 mins to copy files during upgrade spending. Fact the DBA is so busy that he can afford 2 mins tasks.

    It is out of reach, you have to manage.

    -Pavan Kumar N

  • Boolean converter doesn't work is not for the string data type

    Hi gurus,

    I am creating a Boolean converter based on the O/N value for column EO, but every time I select the checkbox that's throwing error "attribute with the value false precision/scale not valid."

    If I add PrecisionRule = 'false' for TestFlag to the EO, I had ORA-12899: value too large for column 'XX '. "" "" FDY_TEST '. "" TEST_FLAG' (real:, maximum of 5: 1).

    Seems that it is still store 'true' / 'false' char to instead "Y/N", even if the POS in the converter class return System.out.println ("getAsObject - value is Y")

    If I use the transitional attribute (TestFlagDummy) and change the EOImpl to TestFlagDummy getter and setter, it works very well.

    I was wondering why the converted does not, in which case the other converter for string I test to convert the value entered for upper case works very well.

    Appreciate any help.

    Definition EO

    ------------------

    < attribute

    Name = "TestFlag.

    Precision = '1 '.

    ColumnName = "TEST_FLAG."

    SQLType = 'VARCHAR '.

    Type = "Java.lang.String"

    ColumnType = "VARCHAR2".

    TableName = "FDY_TEST" >

    < DesignTime >

    < name Attr = "_DisplaySize" Value = "1" / >

    < / DesignTime >

    < / attribute >

    Converter class

    -----------------------

    public class YNConverter

    implements the converter, ClientConverter

    {

    public Object getAsObject (FacesContext facesContext, UIComponent uiComponent, String value)

    {

    If (true".equals (value)) {" "}

    System.out.println ("getAsObject - value is Y");

    }

    else {}

    System.out.println ("getAsObject - value is N");

    }

    return "" true ".equals (value)?". Y":"N";

    }

    public String getAsString (FacesContext facesContext, UIComponent uiComponent, Object value)

    {

    System.out.println ("getAsString - Value is" + value.toString ());

    Return "Y".equals (value.toString ())? "true": "false";

    }

    public String getClientLibrarySource (FacesContext facesContext)

    {

    Returns a null value.

    }

    public Collection < String > getClientImportNames()

    {

    Return Collections.emptySet ();

    }

    public String getClientScript (FacesContext facesContext, UIComponent uiComponent)

    {

    Returns a null value.

    }

    public String getClientConversion (FacesContext facesContext, UIComponent uiComponent)

    {

    Returns a null value.

    }

    }

    USER INTERFACE

    ---

    < af:selectBooleanCheckbox

    label = "#{bindings." TestFlag.label}"id ="sbc1.

    value = "#{bindings." TestFlag.inputValue}.

    Converter = autoSubmit "YNConverter" = "true" / >

    Kind regards

    Ferrere

    Your link should look like this:

    
      
        
      
    
    

    VO attribute similar to the following:

      
    

    and EO attribute similar to the following:

    
      
        
      
    
    

    Dario

  • I canceled my account same day and join as convert PDF word has not converted correctly how to get credit for membership cancellation

    I canceled my account same day and join as convert PDF word has not converted correctly how to get credit for membership cancellation

    You need to contact Adobe customer service:

    They will check and help you. (Live chat)

    Contact the customer service

  • Do I need an update for nikon raw d5300 CS5

    Do I need an update for nikon raw d5300 CS5

    The D5300 has 8.3 ACR which is not compatible with CS5

    Camera Raw plugin | Supported devices

    So you will need to use the free DNG Converter

    DNG Converter

  • How to convert a Photoshop Album 2.0 for Photoshop elements 13.0 catalog catalog?

    I have a lot of photos with tags and metadata in Photoshop Album 2.0 version and I want to shoot you images, metadata and tags in Photoshop Elements version 13.0 on a Windows 7 computer. Searching the Web I found that this must be done with the convert function.  I tried file, catalogs to manage, convert and point to the folder holding my Photo project Catalog.psa file, but nothing happens. Apparently, it is not the .psa file.  How can I get my .psa catalog migrated to 13 items?

    Hello

    See if that helps.

    Convert catalogues organiser for 64-bit versions. Photoshop Elements 13 or later version

    Brian

  • Need a script for marginal elements consists of two tags

    Hello world

    I need a script for the marginal elements with two paragraph tags. Object styles, library items are all available for this work. My requirement is to cut two paragraph tags and put it in the library and also using styles of both object elements. Is this possible? Can help you to do this. For more information, I have attached this file also.Screen shot 2011-04-05 at 4.41.13 PM.png

    Waiting for your answer...

    Hi try this code...

    main();
    main() {} function
    If {(app.documents.length!=0)}
    {if(App.Libraries.Length!=0)}
    myStyleDialog();
    }
    else {}
    Alert ("Please open library.");
    }
    }
    else {}
    Alert ("Please open a document and try again.');
    Exit (0);
    }
    }

    function myStyleDialog() {}
    var myLabelWidth = 120;
    var myParaStyleNames = myGetParagraphStyleNames();
    var myObjStyleNames = myGetObjectStyleNames();
    myDialog = app.dialogs.add var ({name: "Choose the Styles instead of anchoring"});
    {with (MyDialog.dialogColumns.Add ())}
    {with (borderPanels.Add ())}
    {with (dialogColumns.Add ())}
    {with (dialogRows.Add ())}
    {with (dialogColumns.Add ())}
    staticTexts.add ({staticLabel: "choose paragraph Style1:", minWidth:myLabelWidth});})
    }
    {with (dialogColumns.Add ())}
    myParaStyleDropdown1 = dropdowns.add ({stringList:myParaStyleNames, selectedIndex:0});})
    }
    }
    //---------
    {with (dialogRows.Add ())}
    {with (dialogColumns.Add ())}
    staticTexts.add ({staticLabel: "choose paragraph Style2:", minWidth:myLabelWidth});})
    }
    {with (dialogColumns.Add ())}
    myParaStyleDropdown2 = dropdowns.add ({stringList:myParaStyleNames, selectedIndex:0});})
    }
    }
    //----------
    ~ {with (dialogRows.add ())}
    ~ {with (dialogColumns.add ())}
    ~ staticTexts.add ({staticLabel: "Object Styles:", minWidth:myLabelWidth});})
    //~                             }
    ~ {with (dialogColumns.add ())}
    ~ myObjectStyleDropdown = dropdowns.add ({stringList:myObjStyleNames, selectedIndex:0});})
    //~                     }
    //~         }
    }
    }
    myReturn = myDialog.show ();
    if(myReturn == true) {}
    myParagraphStyle1 = myParaStyleNames [myParaStyleDropdown1.selectedIndex];
    myParagraphStyle2 = myParaStyleNames [myParaStyleDropdown2.selectedIndex];
    myObjectStyle = myObjStyleNames [myObjectStyleDropdown.selectedIndex];
    myDialog.destroy ();
    }
    else {}
    myDialog.destroy ();
    }
    }
    }
    function myGetParagraphStyleNames() {}


    var myStyleNames = app.documents.item (0).paragraphStyles.everyItem () .name;
    Return myStyleNames;
    }
    ~ function myGetObjectStyleNames() {}
    ~ var myObjStyleNames = app.documents.item (0).objectStyles.everyItem () .name;
    ~ return myObjStyleNames;
    //~ }

    //----------------------------------------------
    myDoc var = app.activeDocument;
    var myDoc.stories = monarticle;
    var myParas, myCount = 0;
    myLib var = app.libraries [0];
    var AnchorItemName = prompt ("Enter the name of library point exactly", "", "anchor point");

    for (i = 0; i
    {
    myParas = .paragraphs [i] monarticle;
    If (myParas.length > 3)
    {
    for (j = 0; j
    {
    firstPara var = myParas [j];
    var nextPara = myParas [j + 1];
    var firstParaStyle = firstPara.appliedParagraphStyle.name;
    var nextParaStyle = nextPara.appliedParagraphStyle.name;
    If ((nextParaStyle == myParagraphStyle2) &&(firstParaStyle == myParagraphStyle1))
    {
    myText = myLib.assets.item (AnchorItemName) .placeAsset (firstPara.insertionPoints [0]) [0];
    firstPara.move (LocationOptions.after, myText.insertionPoints [0]);
    nextPara.move (LocationOptions.after, myText.insertionPoints [-1]);
    myText.fit (FitOptions.frameToContent);
    myCount ++;
    } //End If
    } //End of iteration Para
    } //End of If paralength > 2
    } //End of iteration history
    Alert ("Found and dealt with Occurrences" + myCount);

    --------------

    Green4ever

  • Null values for DB2 are causing problems

    Hello
    I have another problem with the link to the database to DB2 on IBM iSeries Access for Linux 64-bit OEL5 with gateway database Oracle and unixODBC 2.2.14.
    DB link works. However, null values for DB2 are causing problems. "The columns Date null on db2 return a date ' 30.11.0002 ', and the columns of characters that are null return an error ORA-28528: heterogeneous Services data type conversion error.
    isql returns the correct results.

    How can I fix? May set some parameters for the conversion of the data on the entry door?

    Thank you.

    If the driver is not fully ODBC level 3 compliant and functions of the spleen, we are lost. But sometimes drivers ODBC level 3 compliant, but lack the correct implementation of 64-bit. In these cases, we can tell the gateway to use the 32-bit ODBC 3 standard adjustment level in the gateway init file:
    HS_FDS_SQLLEN_INTERPRETATION = 32

  • I liked the old version of iTunes that allowed me to delete songs from my camera if I needed to make room for other things. Does anyone know why it was changed?

    I liked the old version of iTunes that allowed me to delete songs from my camera if I needed to make room for other things. Does anyone know why it was changed?

    You have to ask Apple why the design has changed. You should still be able to delete songs by changing your selection of synchronization and synchronize.

    Or you can delete songs directly on your iPad and other iOS devices, directly in the music app or via settings > general > storage & use iCloud > storage management > music

  • Need software preinstalled for Portege M780

    Hello

    I have reinstalled windows 7 pro on my Portege M780 and I need Toshiba pre installed Apps
    It was 7 Pro 32 bit and clean, I installed 7 Pro 64-bit Iv caught everything that is available in the download section for 7 64-bit, but not all is here.

    I used to have the cam, control rotation of the screen, DVD app and more I'm not even sure what to do as I have only had the day before installing windows :(
    If someone could help that would be great thank you

    PS I can't scanner finger to work anyway, once I installed it and set up com would not start after the login screen but did in safe mode then I disabled in Device Manager. Ideas Anyony Cheers

    I tried the pre installed applications recovery unsuccessfully :(

    Original recovery image that you got with your laptop contains the operating system, all necessary drivers, tools specific to Toshiba and utility and sure some additional software such as a DVD player, an antivirus, Office of test application.

    When you have installed OS on Toshiba download page you will find drivers, tools and utilities only. These additional requests will not be available. That you can have if you install original recovery image.

    Very important information of the end: Toshiba offer all that for operating systems supported only so if you can't find it on the download page, I can just say unlucky.
    In this case, you should try to find the right proposed drivers for other models, but with the same hardware components and it is quite complicated.

Maybe you are looking for

  • Hi, Firefox team! You can add games in this browser?

    With the games, the costume designers of Firefox will be very happy! Games like Minecraft, series Angry Birds, neighbors of series of hell, Ricochet series etc... and achievments. This browser is incredible, you can do more...

  • HP Pavilion 6680ev: upgrade hard drive HP Pavilion

    I was wondering if I can update this machine and put an SSD drive on this machine

  • T6 IR remote?

    Received a T6 digital SLR kit for a trip. Camera and objectives are functioning as they should, but it came with an infrared remote shutter release. I can't find a setting on the camera to enable it. The T6 has an infrared sensor and if so, how do I

  • OCR problem

    OfficeJet Pro 8600 more supposed to have integrated OCR capability.  When I scan it provides PDF format as save option.  What should I do to get this in an editable format and MS Word?

  • Display the host logs and (PAC) files to tail-F

    I chose (CAP) F to view a log file and am stuck to try to get the newspaper.  At the bottom of the screen, it says: waiting for data... (interruption to abort)  So what key or keys are used to make the demolition?Thank you!