Using SUBSTR to convert part of an IP address to a NUMBER and then sort

Hello!

I have a table in APEX that IP numbers and was looking for a way to be able to sort out them.

I wrote the following script:
SELECT TO_NUMBER (SUBSTR (IP, 11)) y
OF NETWORKINFO y
ORDER BY y

Which produces the results I'm looking for.

However, I use the 'FORM ON A TABLE WITH REPORT' by their SUMMIT. It is perfect for what I need, but here's my question:

How can I go about adding my custom SQL string to be able to use the feature to sort of this 'FORM ON A TABLE WITH REPORT "?

In the above form, it gives the ability to sort by any column. Is there a way I could do a column hidden, associated with the IP column to sort results?

Sorry if I'm not in all this that claire here - let me see if I can be more specific.

I have the IP addresses which of course do not sort numerically. So I wrote the SQL script above to convert a portion of these IP addresses in a number format.

Is it possible to combine the two in the search function in 'Form on a Table with report' so I can get a user sort by IP number, but behind the scenes it sorts using the SUBSTR value from above?

Thank you for pointing me in the right direction on this subject!

-Igor

Hi Igor,.

You can get a custom sort order added to your IP column without needing a second column.

Consider that the sorting is done strictly from left to right across a string in the column. The string can be any content valid HTML. So you can wrap your string in, say, a SPAN tag and add an attribute to the tag that contains the sort order, you need to forward the text that is displayed to the user. As long as the attribute is properly structured (in other words, all instances are the same length, for example), then sort will work correctly. For example:

SELECT
'' || IP || '' Y
FROM ...

Now you must make sure that the PAD_IP_ADDRESS() function returns the correct values. In IP addresses, you have whatever it is "0.0.0.0" to "255.255.255.255". To sort "digitally", you need fill one or two numbers to get three numbers for each value of - so, "0.0.0.0" becomes "000.000.000.000." You can create a function to do this - something like:

CREATE OR REPLACE FUNCTION PAD_IP_ADDRESS
(
  pIP IN VARCHAR2
)
RETURN VARCHAR2
IS
  vIP VARCHAR2(15);
  vTEMP APEX_APPLICATION_GLOBAL.VC_ARR2;
  vSEP VARCHAR2(1);
BEGIN
  vSEP := '';
  vIP := '';
  vTEMP := APEX_UTIL.STRING_TO_TABLE(pIP,'.');
  FOR x IN 1..vTEMP.COUNT
  LOOP
    vIP := vIP || vSEP || TRIM(TO_CHAR(TO_NUMBER(vTEMP(x)),'000'));
    vSEP := '.';
  END LOOP;
  RETURN vIP;
END;

The result of this would look like:

<span title="001.001.001.001">1.1.1.1</span>
<span title="002.255.255.255">2.255.255.255</span>
<span title="010.001.199.098">10.1.199.098</span>

Andy

Tags: Database

Similar Questions

  • "Windows Media Center cannot detect the IR control cables, which are necessary to control the set-top box. Fixing parts IR that supports the IR control cables and then try again. IR HARDWARE NOT FOUND ".

    Original title: when setting up Windows Media Center, I get the error message: "IR hardware not detected".

    I have an internal TV Tuner that has been installed by HP, when I bought recently a "computer build-your-own." (According to the control panel Device Manager, my tuner is a Win TV HVR 1290, made by Hauppauge). The computer came with Windows 7. While installing Windows Media Center, after setting up the TV Signal (on channel 3) I am able to see a video thumbnail on my computer screen. I am also able to change the channel using my remote control U-Verse (not the Windows remote control supplied with the computer). So far so good! I then hit next and get the following message: "Windows Media Center cannot detect the IR control cables, which are necessary to control the set-top box. Fixing parts IR that supports the IR control cables and then try again. IR HARDWARE NOT FOUND ".  After you receive this message, the installation procedure is completed. I called HP that support intalled the tuner. They had not the slightest idea what to do. I then called Hauppage customer (manufacturer of TV Tuner). They said that I need to plug one end of the IR Blaster cable that shipped with the computer in a slot in the back of my computer (they told me which slot). They said so to run the IR all the way cable to my cable box and the other end of the cable to my cable box of band. They said it was necessary to be able to use my Microsoft Remote to instruct the box to change channels (cable IR stuck on the box). I told her that I did not use the Microsoft Remote, I could change the channel with my U-verse remote (that I preferred to use anyway). He said that it took the cable on the band decoder in order to remove the error message and the installation of Windows Media Center. I then called U-Verse technical adapter who informed me of their set-top boxes (made by Cisco Systems) do not have the ability to receive signals IR IR Blaster cable (or any othe IR signal source). Microsoft is apparently not understand how U-Verse set-top boxes are designed to work and sells a product incompatible remote control/IR. My question is this: How do I set up Windows Media Center, in order to avoid getting the error message "IR hardware not detected" when you install Windows Media Center and just use the remote control of the U-Verse that I prefer to use in the first place. Once understand you this point, please send the information to HP, At & T U-Verse and others. Thank you.

    Ron, I have something for you!

    and for all the people who have this problem :)

    Hi, I had the time of IR not detected in Windows 7 Ultimate with a TV wonder 650 card and a box of digital adapter from Verizon for my PC... Go on the road to installation and after the Media Center channel search, choose manual configuration. Choose the aerial signal (I aso picked after this analog) l. After he sought more, he finds no channels.  Do not be afraid. Just accept it and go to the main settings page in the Mediacenter. If I remember correctly, then select TV Guide. Choose Add channel. I added the channel 3.

    Since my Verizon box has no IR for the computer, I added the channel 3 for the media Center and I change the channels with my Verizon remote. All my stations in the Verizon box go to Channel 3.

    The story here is so, for some reason any Windows detects that only my box channel signal TV and you must manually configure the media center on the air, then go to settings and add the channel you want in the guide.

    Why the guide TV control which channel you can tune is beyond me, but the scanner locks all channels, it does not detect. they must be added manually in the guide.

    My TV works and looks okay now.

    It actually works!

    the only problem is that it is not in HD

    but there is something


  • When I use my clipping on an image mask, fills the form I use the whole layer instead of just being a small shape Panel and then I put my picture on the shape layer, a clipping mask, but the form becomes clear with just a slight edge. The photo behind

    When I use my clipping on an image mask, fills the form I use the whole layer instead of just being a small shape Panel and then I put my picture on the shape layer, a clipping mask, but the form becomes clear with just a slight edge. The photo behind it does not move. I did this project of class before and it worked fine so I'm not sure if I have something started or... Any thoughts?

    I thought about it. That's all just stupid on my part and a bit of frustration because photoshop is my sworn enemy of then adobe added in. Thanks tho!

  • My iPad and iPhone will be printed using AirPrint on my printer HP Deskjet 2540 for about 40 minutes and then will not be able to find all of the available air printers. No idea why.  The deskjet printer shows that there is a wireless connection.

    My iPad and iPhone will be printed using AirPrint on my printer HP Deskjet 2540 for about 40 minutes and then will not be able to find all of the available air printers. No idea why.  The deskjet printer shows that there is a wireless connection.

    Hi Mpsfeldt,

    Thank you for using communities Support from Apple!

    Your question, it looks like you are only able to use AirPrint sporadically. We know that situations of this kind can be frustrating, but we are here to help.

    To begin the process of solving problems, I suggest you to read about the section If you can not print on your printer AirPrint in the following article.

    On AirPrint - Apple Support

    Best!

  • Hello. I bought Lightroom, paid license 1 year view, did not have serial. E number and then past the 30 day trial and may not use the product or work more hard. I paid has been deducted from my credit card. How I'm going to work now?

    Hello. I bought Lightroom, paid license 1 year view, did not have serial. And number and then past the 30 day trial and may not use the product or work more hard. I paid has been deducted from my credit card. How I'm going to work now?

    Hi Sergior96769872,

    I saw your Adobe ID (email address), you used to post on the forums, and I see an active subscription on it.

    Please see Help below links: { make sure you use the same Adobe ID (email address) that you used to purchase the subscription }

    Connect and disconnect activate Cloud Creative applications

    Adobe Creative Cloud apps back in test mode after 2015 set CC to update

    * NOTE: Make sure that your firewall of your computer or security software firewall does not block Adobe, if you are not sure of it can just disable the firewall for a while and then log off and log on creative application of cloud and check.

    If it still gives you an error of the trial, then please refer to the troubleshooting listed below:

    If you are using MAC:

    1-force Quit the sub process in the same sequence as shown below from Activity Monitor: see, use the monitor activity on your Mac - Apple Support

    • Creative cloud
    • Basic timing & sync to basic support
    • CC library & process CCX
    • Adobe Common Desktop
    • Adobe update daemon
    • Broker CIB Adobe
    • After that, everything that said adobe on it do a force quit for her

    2 - right click on the Finder icon, then select the "Go - To" folder. You will get a text box, type in the following command and then press the 'return '. ("Not to be missed ~ symbol")

    ~/Library (it will open the folder of the user's library.)

    3. browse to the Application Support > Adobe > trash OOBE folder and folder AAM Updater

    4 - CUT any installed security software with firewall system.

    5 - go to: Apple icon > system preferences > Security & Privacy > General > "allow applications downloaded on" change this anywhere (to make these changes click the padlock in the corner at the bottom left of this window and enter your computer password)

    These changes are temporary you can restore these changes back to normal once your creative cloud app is running *.

    6 - restart the cloud creative app and connect


    If you use the WINDOW:

    1 complete the process / Task Manager tasks in the same order, as mentioned below the Manager tasks. See, Open the Task Manager

    • Creative cloud
    • Basic timing & sync to basic support
    • CC library & process CCX
    • Adobe Common Desktop
    • Adobe update daemon
    • Broker CIB Adobe
    • After that, everything that said adobe on it do a force quit for her

    2 - C:\Users\\AppData\Local\Adobe\ MAA UPDATER and two OOBE (App data & Program Data is hidden folder please see, Show files and folders hidden in Windows 7, 8.x, 10, or Vista)

    3 - CUT any security software installed with firewall system, also if your having any browser Add On installed for blocking advertising that turn off too.

    These changes are temporary you can restore these changes back to normal once your creative cloud app is running *.

    4 - raise the cloud creative app and connect

    Let us know if that helps.

  • My Macbook Pro shows off my HP printer online after the first use (print or digital). I have to turn the printer off and then on again to print or scan for even once.

    My Macbook Pro running El Capitan 10.11.6 shows my printer HP (envy 110) as offline after a print or scan session. I have to restart the printer each time I use it, and then the Mac it falls again after printing or scanning session.

    I loaded the latest drivers on the Apple site without success. The two are on a wireless home network.

    Help!

    OS X El Capitan: print troubleshooting

  • Can I publish to PDF, as I used to do before I made the mistake of downloading this upgrade and then complete and sign or what I need to do this through Adobe DC?

    If I use WordPerfect and normally I take a court document, publish to PDF and then used the old Adobe to fill and sign my signature I scanned in my computer, how to make "this signature to appear.  It gives me a that is not mine. I saved it as a PDF file, but I can't seem to give me the possibility to insert into the document.  Help!  I hate this new update. Was chatting with people for two hours yesterday.  They told me I had to come to this forum to find answers. Pray someone can help.

    Hello

    Can I know which application you use currently and what OS? If you are using Acrobat Reader DC and you want to use your signature that you have scanned in the form of handwritten image then you can do service fill & sign.

    Open the PDF in Reader DC.

    Since the right set of tools, click Fill & sign

    You will get tools up to the Center just above the document

    Click the sign on the right

    Select "Add a Signature" from the menu drop-down

    This will give you the window where you can type your signature, draw it or use a picture

    Click on the Image and choose your signature on your computer and sign the document.

    Thank you

    Abhishek

  • How can I report an attack from malicious software by using your video download? Avast has refused to let it download and then survey myself, it was as an attack.

    An update for Mozilla video appeared when I opened Mozilla this morning. I clicked Yes, because the videos have been seriously lagging behind. Avast flashed immediately that it was a virus, so I stopped it download. After returning from lunch, it does the same thing. The download shows as Video.exe and Avast is described as: URL: hxxp://69.4.238.156/14/NewVideoPlayerSetup.exe and Infection: URL: wrong I don't know enough about software, nothing to do with this, but thought you should be informed that I very rarely get attacks of Mozilla. As a side note, somehow a program called optimizer Pro seemed to drag on my computer at the same time and tries to download himself with the virus.

    Thanks for all the work you do. Mozilla is my favorite browser and you guys are doing a great job with it.

    SRoss62

    More all products that Mozilla has are to say a mozilla.org site link.

    https://mozillalabs.com/en-us/projects/
    https://www.Mozilla.org/en-us/products/

    The only real video related Mozilla, it's https://wiki.mozilla.org/Shumway and more info on http://mozilla.github.io/shumway/

    The site that you downloaded this NewVideoPlayerSetup.exe of was a scam because it uses the inexperience of users and the popularity of Mozilla and Firefox browser to trick people to install this kind of things.

    Next time if you are unsure, you should ask someone will then tell you if it is legitimate or not for example.

  • Securities is no longer play in my music (using iTunes game, wifi...), has done before, can download and then play, but not stream - all, it was fine before!  Help!

    I hope that someone has had a similar problem and a solution!  I tried resetting the phone (5s, latest ios etc...) to factor settings, setting back via iCloud backup, reset connections network again, you name it!  Basically, I play all my music (which was more often downloaded from my PC at home using iTunes game, as I already had a vast collection of CDs before buying my first phone) via a wifi connection and have had zero problems (using various home wifi connections) and besides... until a week ago.  Today, only some beaches (and incredibly, they can vary from day to day...) on some albums (in general, not an entire album, either...) won't play - he simply "jump through" them.  However, I can upload them on my phone (on the same wifi connection, you mind) and they will play very well!  Obviously, however, I don't want to (can't - much too) to download all my songs to play!  Any suggestions would be most appreciated!

    Make sure that your device is updated... Sometimes new songs are not compatible with the old software.

  • Windows Mail... I want to use my password again to get my email. I did initially and then he asked if I wanted she remember me, I thought that it meant just my email address... But now I don't have to sign to read

    I went from mail to windows mail cox... I still had to sign on windows messaging like any other mail each time to read my mail... Then I got an aking window, if I wanted to remember me... I thought that meant my e-mail address... So I said yes... And now all I have to do is click on windows mail and it rises.  I don't like it... I want to have to connect to read... Help, please.

    You do not sign in Windows Mail, because it doesn't have a password option.
    You do not have to provide your password to the e-mail account on the server in order to
    access it.
    If you want to set up Windows Mail for do not remember the password, go to
    Tools - accounts - (your account) - properties - servers
    Uncheck the Remember password box]
    Ok
     
    This threshold will not prevent others from reading your email already downloaded on
    your computer, but if you put a password on your Vista logon account, and
    Don't let not another use it.
     
    --
    Dave N.
    MS - MVP (Mail)
    Windows 7 Ultimate 64
    "brillantmrsw" wrote in message
    News: * e-mail address is removed from the privacy... *
     
    I went from mail to windows mail cox... I've always had to sign on windows
    the post office like any other mail each time to read my mail... Then I got a window
    Endre if I wanted her to remember me... I thought that meant my email
    address... So I said yes... And now all I have to do is click on windows
    mail and it happens.  I don't like it... I want to connect to
    read... Help, please.
     
     

    Windows 7 Ultimate 64

  • After using my Firefox browser to access my Yahoo mail, I don't and then disconnect. Left click of my mouse will not sign off the coast. I have to close my computer to close my e-mail address. How can I fix?

    I'm unable to sign my e-mail at Yahoo. Make a left click on the mouse does not close my e-mail address.

    Hi ampterson.

    It could be that an add-on is causing this problem. First, click on the Firefox button > help > restart with disabled modules. If this solves the problem, it means one of your Add - ons is the cause. See Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems for steps to know which.

  • Highlight the parts of an email address on macbook

    I am typing an address e-mail with only a part of it said - this part before the @.  Mail keeps correcting and highlights the entire address.  Any suggestions?

    Go ahead and type in the email address. Select it and then click on edit on the top menu link Edit > remove the link... at this point, it will be treated as normal text.

  • I do my job to the computer on a MAC computer. I want to create a document using Pages and then convert the document to PDF and send a group email. I want to send the PDF using the pdf for each receiver icon must click the icon to open t

    I do my job to the computer on a MAC book PRO. I want to create a document using Pages and then convert the document to PDF and send a group email. I want to send the PDF using the pdf for each receiver icon must click the icon to open the document. My problem is the document does not show the icon, but rather the document is already open. I spoke with 2 Apple. 'Experts' care and can help me. Can someone tell me what to do?

    It's a question of how the recipients e-mail programs deal with attachments. Many e-mail programs will open all the files they can handle, including files jpg and PDF, by default, and if the recipient has not changed that there is nothing you can do about it. The only solution is to the compress first, then it will be delivered as an attachment, allowing the recipient to decompress and open it.

  • I have adapters and a power converter, but has been told by someone who travels internationally that the block performs the conversion of power for me.  I want to assure that I do not blow on my phone.  Use the power converter to charge my iphone and appl

    I have adapters and converter of power for international travel.  I was told by someone who often visits that the converter is not necessary for apple products.  I don't want to ruin my phone or watch - can I use my power converter?

    If you use the Apple adapter supplied, you will simply need an adapter to use in other countries. The adapter can be used with voltages between 100-240 v AC 50-60 Hz

  • I installed a game for windows XP and then used the troubleshooting tool to convert so that I can play in 7.__it still doesn't react. What should I do? Please answer__

    I installed a game for windows XP and then used the troubleshooting tool to convert so that I can play at 7.
    It still fails. What should I do? Please answer

    Hello

    a. what game do you have installed?
    b. do you get errors trying to run the game in compatibility mode?

    Look for error messages in the event viewer. If you find error messages after return the exact error message so that we can help you better.

    Measures to check the application event log:

    1. click on start.
    2. in the search box type eventvwr.msc, and then on enter.
    3. now, click Application in the event viewer (local).
    4. now locate the event log on the right side of the event viewer window.

    http://Windows.Microsoft.com/en-us/Windows7/open-Event-Viewer 
    http://Windows.Microsoft.com/en-us/Windows7/what-information-appears-in-event-logs-Event-Viewer

    You can try to perform the clean boot on your computer and check if that helps.

    From your computer by using a minimal set of drivers and startup programs so that you can determine if a background program is interfering with your game or program. This type of boot is known as a "clean boot".

    To perform a clean boot on a computer, follow these steps.
    1. click on start, type msconfig in the search box and press ENTER.

    If you are prompted for an administrator password or a confirmation, type the password, or click on continue.

    2. in the general tab, click Selective startup.
    3. under Selective startup, clear the check box load startup items.
    4. click on the Services tab, select the hide all Microsoft Services check box, and then click Disable all.
    5. click on OK.
    6. When you are prompted, click on restart.
    7. after the computer starts, check if the problem is resolved.

    Please follow the system in the boot environment. If the problem does not occur, it indicates that the problem is related to an application or a service, we have disabled. You can use the MSCONFIG tool again to reactivate the disabled one by one element to find the culprit.

    If your issue is resolved, follow the how to determine what is causing the problem section in KB article to narrow down the exact source.
    For more information visit: http://support.microsoft.com/kb/331796

    After you determine the startup item or the service that is causing the problem, contact the manufacturer of the program to determine if the problem can be solved. Or, run the System Configuration utility, and then click to clear the check box of the element of the problem.

    To restore your computer to a Normal startup mode, follow these steps:

    1. click on start in the box start the search.
    2. type msconfig and press ENTER.

    If you are prompted for an administrator password or a confirmation, type the password, or provide confirmation.

    3. on the general tab, click Normal Startup - load all device drivers and services and then click OK.
    4. When prompted, click on restart.

    You can check its compatibility with windows 7 in the Compatibility Center.
    http://www.Microsoft.com/Windows/compatibility/Windows-7/en-us/default.aspx

    Hope this information is useful.

Maybe you are looking for

  • DVD maker download

    Hello... I have vista 32 Home premium on my computer acer laptop and I can not find creation of dvd anywhere on it... i'm assuming that I removed it in a crazy 'clean up' of programs I have not used at the time (made with movie maker too, but re-down

  • How to get rid of fonts (secure system)?

    For some strange reason, that my Windows 7 has a huge list of fonts (~ 200), which I can't read, half of many I don't even know the name of the language! So far that hasn't bothered me a lot, but Word apparently detects and offers these fonts do my l

  • Expiration of key ring

    Hey everybody, I posted earlier about a matter of license I also have an expiration of key ring in my critical errors, it will affect my environment? Kind regards

  • I bought a photo twice and as return - what to do?

    I bought a picture through the botton pressing twice on how I return it?

  • accident of the CC since the last update

    Since the last update (April 3 weeks ago) CC 2014 crashes after 8 seconds after opening. The CC of normal Photoshop works very well. Who knows this problem and maybee knows what to help. Service takes to long (the last time 4 weeks).Thank you for you