Having trouble using the replace() function

Hey everybody. :)
I've written a query which finds the address for a company (from 5 columns and concatenates them into one). These columns are street, town, county, telno and faxno.
Some of the companies have a null value for the county, so when I write the query it returns a result like... 3 Main Street, Manchester, , 0384758948, 04857846927, but if there was a county it would be 3 Main Street, Manchester, Greater Manchester, 0384758948, 04857846927.
I've been trying to write the query so if there isn't a county, it just removes the comma and the address becomes 3 Main Street, Manchester, 0384758948, 04857846927... but I just can't seem to figure it out so I thought I would come and ask the professionals. :)
set linesize 100
column suppname heading 'Supplier Name'
select suppname, street || ', ' || town || ', ' || county || ', ' || postcode || ', ' || telno || ', ' || faxno "Supplier Address"
from Suppliers
where county is null
replace(county, county, '');
This gives me a 'command not ended properly' error, but I can't for the life of me figure out why.
Thank you in advance. :)

with t as (
select '3 Main Street' street,
       'Manchester' town,
       null county,
       0384758948 postcode,
       0485784692 telno
  from dual
union
select '3 Main Street' street,
       'Manchester' town,
       'Greater Manchester' county,
       0384758948 postcode,
       0485784692 telno
  from dual)
select nvl2(street, street, null) ||
       nvl2(town, ', ' || town, null) ||
       nvl2(county, ', ' || county, null) ||
       nvl2(postcode, ', ' || postcode, null) ||
       nvl2(telno, ', ' || telno, null)
  from t

Similar Messages

  • Having trouble with the str()function

    I'm having trouble with the str() function. The first parameter is the value and I want to set the format but I keep getting an error. I do it like this. str(locals.array[8]-locals.array[9],"%$.6f"). I get a runtime error, so I tried to remove the "" but now the I get a syntax error.

    Hi,
    Can not see a problem with your statement.
    I have attached a TS2.0.1 example using you expression.
    Regards
    Ray Farmer
    Regards
    Ray Farmer
    Attachments:
    Sequence_File1.seq ‏20 KB

  • Having trouble with the video function..

    I just purchased the 60GB ipod photo. I'm transferring music files easily. However, I'm having trouble with the video function. I've loaded Itunes 6, reloaded the original setup disk, and have loaded the latest updates for the unit. I can download movies from the itunes store and save them to my library, but I cant seem to transfer the video files to the ipod. Ive reinstalled itunes and the update 6 with no success. After syncing the ipod it only shows the music files even after all that Ive tried. Additionally, there is no evidence of the video function on the main menu after the update attempts. Can someone tell me what I'm doing wrong? I'm eager to get past this problem so that I can start tranfering personal movies and video files.

    You Have an iPod Photo, You do NOT have a 5th Generation Video iPod. Get it? You need the 5G model to play video.
    If the salesman told you it was the 5G model he lied, was ignorant or both. If video is important or if thats what you thought you were getting you will need to return your 4G iPod photo for new iPod.
    Rotsa Ruck!

  • I'm having trouble with the repeat function on iTunes 11.

    I'm having trouble with the repeat function on iTunes 11.  The buttons are there but will not allow me to repeat an album when selected under artist from remote app on iPhone.  I have downloaded the update for the remote app but the repeat function now repeats all albums under that artist name.  Selecting the album directly under albums works but is not as easly to access.  Any thoughts?

    Sorry, downgrading is not supported.

  • HT6029 Having trouble restricting the restore function on an iPad through Apple Configurator

    Having trouble restricting the restore function on an iPad through Apple Configurator
    I cannot find the setting the allow/disable this feature.

    Configuration profiles do not allow you to apply a static IP address to a device.
    Instead, it would be highly recommended to configure static IP addressing within the DHCP server itself. This would accomplish what you want without worrying about which proifle goes on what device, etc. Configurator can also export the MAC addresses to make life easier in setting this up.
    Right click the 'All Devices' in the Supervise tab, click Export Info > Device Information > WiFi MAC Address.

  • I'm having trouble using the iTunes and Apps store because i can't register my Nigerian mastercard. What should i do. i'm trying to register it in the Nigerian iTunes store.

    I'm having trouble using the iTunes and Apps store because i can't register my Nigerian mastercard. What should i do. i'm trying to register it in the Nigerian iTunes store.

    Is this a new Apple iD? If it is, and you have already set it up, then you have two options:
    1.     Temporarily put a Credit Card or Gift Card on the account to download the free app. If you put a credit card, then once you have downloaded the app, you should be able to go into your Account preferences and change the payment option to = None.
    2.     You can download the fee App, and then set up a new Apple ID.
    Cheers,
    GB

  • Hi, I am having trouble using the smooth tool on a logo that I created. I have watched tutorials and something isn't working for me. When trace with the smooth the line just disappears and doesn't smooth anything out. Please help.

    Hi, I am having trouble using the smooth tool on a logo that I created. I have watched tutorials and something isn't working for me. When trace with the smooth the line just disappears and doesn't smooth anything out. Please help.

    Sorry, that's Monika with a k
    On Tue, Nov 18, 2014 at 2:26 PM, Monika Gause <[email protected]>

  • I'm having trouble using the safari. It won't open the screen stays black

    I'm having trouble with the safari it won't open the screen stays black also apps won't open it just kicks me out

    Try this:
    Settings>Safari>Clear History, Cookies and Data

  • I just had my logic board replaced. now im having trouble using the interent even with a strong connection and the internet is working on other devices!! please help me :(

    I just had my logic board replaced. i am now having trouble with using the interent even with a strong connection. all other devices are having no problem with the internet. please help

    Test while started in Recovery : if the problem persists, then it likely is a hardware issue.
    Resetting the System Management Controller (SMC) probably won't change anything, but you can readily do it before contacting the repairers.

  • I am having trouble using the IMAQ command RejectBord​er. Can somebody give me some guidance?

    My image is 768x576, which I confirmed by right-clicking on the Image Info property. I set a border using the Image.Border = 20.
    When I threshold, then do a RejectBorder, blobs along the top and left sides of the image are eliminated, but not those along the right or bottom.
    Any ideas?

    Try setting the property image.BorderWidth to be different values and see if this changes the blobs that are eliminated. The border should be even all the way around the image.
    Take a look at the example program called Blob Analysis in the folder C:\Program Files\National Instruments\VB\Samples\IMAQ\2. Functions\Binary Analysis for an example of using this function.
    Hope this helps -
    Julie S
    Applications Engineer
    National Instruments

  • My ipod is having trouble with the lock function. It is pausing when I lock and sometimes going to the beginning of the podcast I listened to.

    Any help?

    ''' "... vulnerability in your software?" ''' <br />
    And it affects IE, too? Ya probably picked up some malware and you blame it on Firefox.
    Install, update, and run these programs in this order. They are listed in order of efficacy.<br />'''''(Not all programs detect the same Malware, so you may need to run them all to solve your problem.)''''' <br />These programs are all free for personal use, but some have limited functionality in the "free mode" - but those are features you really don't need to find and remove the problem that you have.<br />
    ''Note: If your Malware infection is bad enough and you are mis-directed to URL's other than what is posted, you may have to use a different PC to download these programs and use a USB stick to transfer them to the afflicted PC.''
    Malwarebytes' Anti-Malware - [http://www.malwarebytes.org/mbam.php] <br />
    SuperAntispyware - [http://www.superantispyware.com/] <br />
    AdAware - [http://www.lavasoftusa.com/software/adaware/] <br />
    Spybot Search & Destroy - [http://www.safer-networking.org/en/index.html] <br />
    Windows Defender: Home Page - [http://www.microsoft.com/windows/products/winfamily/defender/default.mspx]<br />
    Also, if you have a search engine re-direct problem, see this:<br />
    http://deletemalware.blogspot.com/2010/02/remove-google-redirect-virus.html
    If these don't find it or can't clear it, post in one of these forums for specialized malware removal help: <br />
    [http://www.spywarewarrior.com/index.php] <br />
    [http://forum.aumha.org/] <br />
    [http://www.spywareinfoforum.com/] <br />
    [http://bleepingcomputer.com]

  • Anyone having trouble with the snooze function for the alarm?  ...after update.

    I've been using my phone as an alarm clock lately and after the latest firmware update I can't get the snooze to work on the alarm.  The alarm goes off like it should and I select "snooze" with the ring but the alarm never goes off again.  I was almost late to work the first time it did it.
    Just checking to see if anyone else has experienced this.  I have to say, I am not impressed with the latest "update" at all and have spent WAY too much time trying to get things to work again.  If it wasn't a company issued phone I would've dropped the service long ago (no service at my desk at work or at home).

    Try going into settings, apps and then manage apps.  At the top scroll over and make sure all is selected.  Scroll down and find the alarm app and tap on it.  If clear data is populated then tap on it.  After that tap on force close...you will get a warning but just press ok.  If clear data is grayed out at least try force stop.  Set your alarm back up and see if that works. 

  • I am having trouble using the clone tool and eraser tool.

    I am not able to see my brush get bigger as I increase the size.  Once I clone an area, it selects what I want to clone, but it won't paste it on the photo.  I cannot also use my eraser tool.  It does not show the line that usually is shown in white before it erases the area. I am working on a background copy. 

    Suggest that you reset all tools to default.
    Look for this box icon with lines in it on a tool's option bar. This is for PSE v. 12 and perhaps for v.11 (I'm not certain about 11)
    For earlier versions of PSE, look for a little arrow, top left, on the option bar

  • Anyone having trouble with the recording function on the rear camera on iPad ios7?

    The rear camera shows while I'm recording video but I'm just getting sound when I play it back.

    Have you tried restarting or resetting your iPad?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after It shuts down, press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds).

  • I'm having trouble using the Ipod Updater

    Itunes is not recognizing my ipod. I was told by the apple support to download the Ipod Updater and restore my factory settings. I downloaded the Ipod Updater as instructed, but when I go to open the program is keeps saying "Error reading setup initializing file".
    I'm all ears...

    "Make sure your folder names don't contain strange characters
    If the iTunes installer (iTunesSetup) is not responding or appears frozen after launching the installer or the iPod installer (iPodSetup) reports "Error reading setup initialization file" then the folder(s) where the installer is stored may contain unusual characters. This often results from copying a folder to your Windows system from a disk or network that is not natively formatted for Windows. If you notice that the iTunes or iPod installer or stored in a folder like this, either rename the folder or move the iPod or iTunes installer to another location before launching."
    http://docs.info.apple.com/article.html?artnum=93976

Maybe you are looking for

  • How to open a popup and get some data from a model class

    Hi experts, mi problem is the next. I am opening a popup from a view that is  controlled by a controller named identificador.do, the controller class is z_identity_cl. the window that is opened is other view controlled by nocupentes.do, with a contro

  • Subtotal in alv grid output.

    hi experts,                i want to display subtotal in the alv output using control break statement, without using alv functionality and layout. my code is given below, how can i add subtotal field and display them in alv , *& Report  Y_VARUNSHARMA

  • Summary field printing on the first line when it supposed to prin last page

    i have created manual report. in the end of the report i have summay columns. wheni run in oracle reports it perfectly shows the grand totle. when i generate to file (PDF) thegrand total print on the first line. can some one tell me wht is it printig

  • PI - Problem with a receive WSDL message with encode (envelope)

    Hello, I'm having a ploblem with a PI interface with the scenario below (synchronous): ECC (proxy) <-> PI <-> 3rdParty (soap) The WSDL provided has a kind of envelope (soapenc:arrayType). Here's the structure declaration:          <xs:complexType nam

  • Plogi ORga

    HI gurus, when we are doing integration between OM and PA. from the experts of this forum i came to know that we have to activate plogi orga with X . then what is this reports used for? RHINTE00,RHINTE10,RHINTE20,RHINTE30 .(already we are doing integ