Location based query not working Urgent!!!

Hi
I m using orcacle8.1.6 and i m not able to execute the foll query..
select /*+ordered*/ c.customer_id,
c.cust_first_name,
c.cust_last_name,
sdo_nn_distance (1) distance from warehouses w,
customers c where w.warehouse_id = 2
and sdo_nn (c.cust_geo_location, w.wh_geo_location, 'sdo_num_res=5', 1) = 'TRUE'
order by distance;
Its giving me error @ sdo_nn_distance as invalid column name...i think it might be problem with version..
if its so...
can somebody suggest me a query to fetch five customers closest to the warehouse whose warehouse ID is 2 in this case...
Thanks in advance..

As you've guessed, this is a version issue. You need to be running 9i to have access to sdo_nn_distance.
You should be able to do this in 8.1.6:
select /*+ordered*/ c.customer_id,
c.cust_first_name,
c.cust_last_name,
sdo_geom.sdo_distance(cust_geo_location,a.diminfo, wh_geo_location,b.diminfo) distance
from warehouses w, customers c,
user_sdo_geom_metadata a, user_sdo_geom_metadata b
where w.warehouse_id = 2
and sdo_nn (c.cust_geo_location, w.wh_geo_location, 'sdo_num_res=5', 1) = 'TRUE'
and a.table_name='CUSTOMERS'
and a.column_name='CUST_GEO_LOCATION'
and a.table_name='WAREHOUSES'
and a.column_name='WH_GEO_LOCATION'
order by distance;

Similar Messages

  • Location based wifi not working as expected

    I would expect that location based wifi would either turn wifi off if not in a place with saved networks, or turn wifi on if arriving in a place with saved networks, but it does neither. I have tested this by turning wifi on when at home, then periodically checking status in places with no networks saved or open, and it's still on, and also by turning wifi off when away from home, then checking at home to see if it's turned on, and it isn't. So doesn't seem to be working either way. I have stamina mode active, and some people have said that location based wifi won't work with this.but most say works just fine, and would have expected Sony to say if different power saving options were incompatible. Always have location sensing GPS turned on. Often have mobile data off. Some have said that this is necessary for location based wifi to work, but others not, and to my way of thinking, location based wifi should turn wifi off whenever out of range of saved network, and add long as phone has some way of knowing where it is to wake up wifi, then it shouldn't matter which location modality it uses. Can anyone shed any light on this? Google's not being very helpful. Thanks

    Hi and welcome to the community! Since you're new please be sure that you have checked out our Discussion guidelines.
    You do need to have data turned on and as such you must also have Stamina mode turned off for this to work sorry.
    What are your thoughts about this forum? Let us know by doing this short survey.
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • Location based reminders not working in IOS8 on iphone 5s, please help?

    Location based reminders are not working when using Siri since upgrading to IOS8. Asking Siri to "remind me when I get home" also turns off reminders in Location Services. Please help

    I have the same issue with Siri turning off the location setting for reminders.  In fact my location based reminders do not work at all. IPhone 5s, ios 8.1, upgraded to 8.1.1 and that did not fix these issues.
    SEems like Apple does not test the location setting every other upgrade to iOS. They break it, then fix it then break it etc...

  • Location based printing not working

    Hello all,
    I've been searching for an answer but coming up with nothing so I figured I'd give it a shot and ask. After installing a fresh version of Leopard (with the latest updates) on a computer and then copying the user data back onto said computer, the location based printing doesn't work anymore. The printers used to switch automatically, now they do not. They switched when going from one office (city) to the next. (I believe it used the different subnet addresses to tell where it was at on our network.)
    Any ideas on how to "fix" it. All I see is that it's just supposed to work so there really isn't anything to fix.
    Thanks in advance,
    Eric

    Hello Eric,
    I am surprised to hear that you had this working. I use the Location function to switch between three different Ethernet connections (office, lab and training room) and I have never found that I can set a particular printer for the respective subnet.
    As you know, you set your default printer in System Preferences > Print & Fax. I thought that if this was set to 'Last Printer Used' it would remember which printer was last used for the respective Location, but it always shows the last printer used regardless of which Location I selected.
    FYI - I also have an alternate account which I use for home (also set as a Location for wireless connection). This is defaulted to a different printer compared to the work account, but is not influenced by the Location setting.
    I would be interested to hear if anyone else has had this working.
    PaHu

  • Location based WiFi not working

    When I'm not at home I keep my xperia WiFi turned off. When I come home it doesn't turn automatically on even if I got my home WiFi registered on my phone! I always have to do that manually. Of course I have the option ON in "location based WiFi". Could somebody help me, please?

    You may need to perform a software repair using PC companion.The process will erase all internal memory.You might need to charge your device for about 1-2 hours before so the device has at least 60% battery.
    Make sure the device is not connected to computer or laptop and turned off (sometimes you have to press power button and volume up until the device vibrates 3 times or on some devices you have to press the small button near the SIM tray or on the back of the device).
    Open PC companion->support zone->phone/tablet software update->repair my phone/tablet blue highlighted.Follow the steps given,do not connect your phone until prompted to press volume down while plugging USB cable. If PC companion does not start the repair process, you might need to run it in compatibility mode with Windows 7 (in some cases XP).
    All we have to decide is what to do with the time that is given to us - J.R.R. Tolkien

  • Location based reminder not working?

    I'm unable to create a reminder that is location based if the location is not in the address book. Is this normal?
    For example, I can't say: remind me to get xxx when arriving at walmart: I would expect it to ask which walmart and then specific or even specify which walmart from the beginning but Siri only says it does not understand. Can this not be done?

    Yeah, has to be in the address book. If you want to add places you don't really want address cards for you could put them in a separate group, then just ignore that group when viewing.

  • Location based reminders not working

    Why when I make a reminder does it not give me the option to Set by location?

    check that you have location services on in settings

  • Does location based services (LBS) work for international locations (outside the USA)?

    Does location based services (LBS) work for international locations (outside the USA)? For example does it work in Canada, European countries etc. Any help is appreciated.

    Yes, but possibly limited to coverage of Skyhook database..
    Applications that use location services also use the data from Skyhook...
    Skyhook is a service that records the MAC addresses of Cell Base stations/towers and wireless access points.
    Google Maps vehicles records the wireless AP data at the same time they get street view images.
    There was some controversy over this - but they effectively record the location and the MAC address of any AP they find as they drive round. This gets sent to a massive database at Skyhook and is used to either locate without GPS or enhance/aid the GPS information. It's also why the location is always the road outside!
    If your location/MAC relationship has not been mapped by Skyhook, Google or others - then the good news is that you can add it - although it can take a month or two at least - to work. The reason is that it depends which database is being used by Skyhook's clients..
    Add your Wireless Access Point (or Wireless Router) here: http://www.skyhookwireless.com/howitworks/submit_ap.php
    The main website for Skyhook is here: http://www.skyhookwireless.com
    Hope that helps...!

  • IPhone 6 location services/gps not working

    Anyone else have an issue with iPhone 6 location services/gps not working? I have had it happen to me twice where it stopped working for good 7 or 8 hours and then all of sudden it starts working again. For example, directions don't work, every time I open Apple Maps it will say "Cannot determine location", then when I press the location icon on the bottom left, it will try to search again and have an approximate location but not exact, where as the iPad that I have right next to it is able to pin point the exact location. Sometimes the location circle is pulsing blue sometimes its gray. If I am driving and have tracking on it won't track, and so on.  I have tried to setup the phone as new without restoring the backup, when it stopped working with no luck, it still didn't work. I went and restore it back from backup and few hours later it started to work again. This has happened twice now since I got the phone last Friday.

    Check your "Privacy" settings on your iPhone see what apps are using your location.

  • Location switching does not work on Vista

    Hi, my location switching does not work.  I have reinstalled my Access Connection several time but still does not work. I have several profiles and I need to switch manually depending on my location profile. My Access Connetion however seem to know the right profile (dot  next to the profile indicate it picked up the right wireless signal) but never connect to the profile
    Is there any Vista feature that is controlling the access as well? Do I need to disable? I remember the older version of Access Connection will ask to disaable some windows services when using Access connection.
    My Config is
    - R61
    - Intel(R) Wireless WiFi Link 4965AG. File Version 11.1.1.16
    - OS Vista 32 Business - with up to date patches
    - Access Connection 4.42 for Vista Build 7RCN38WW
    Thank you in advance for pointers

    Hi, my location switching does not work.  I have reinstalled my Access Connection several time but still does not work. I have several profiles and I need to switch manually depending on my location profile. My Access Connetion however seem to know the right profile (dot  next to the profile indicate it picked up the right wireless signal) but never connect to the profile
    Is there any Vista feature that is controlling the access as well? Do I need to disable? I remember the older version of Access Connection will ask to disaable some windows services when using Access connection.
    My Config is
    - R61
    - Intel(R) Wireless WiFi Link 4965AG. File Version 11.1.1.16
    - OS Vista 32 Business - with up to date patches
    - Access Connection 4.42 for Vista Build 7RCN38WW
    Thank you in advance for pointers

  • My auto location service is not working on iphone 4s after updating to ios 8.1.3

    Hi every one
    i have recently facing a problem my compass and other apps which require location service are not working on my Iphone 4s, after i have upgrade my iphone ios to 8.1.3. Settings are correct i.e. location service is 'ON' and apps require location service are allowed to use my location.
    is anyone facing the same issue. Need your valuable suggestions and advices.
    Regards
    Muhammad Shahbaz
    Pakistan

    Greetings Biyase, 
    Thanks for contributing to the Apple Support Communities. 
    It sounds like the Outlook app is not launching after you updated iOS. In this case, I recommend the troubleshooting steps found at this link:
    If an app you installed unexpectedly quits, stops responding, or won’t open - Apple Support
    Sincerely,
    Jeremy 

  • I have a 4s i upad te to ios7 and the location (GPS) is not working

    I have a 4s i upad te to ios7 and the location (GPS) is not working, mapa is working, but cant find places or tell me my location...  Can ana One help me ????

    Hello James,
    The flashing WLAN light means activity (data getting transferred). Try disconnecting all your devices and check whether the light is still flashing or disconnect the router from internet and do the check.
    Do you have your SSID as linksys or the default one? If your neighbor has the same SSID, then traffic could result from your neighbor's one. Try changing your SSID and password. Make your security WPA/WPA2.
    Hope this helps,
    Thanks
    Vijay

  • Cancel Query not working

    Problem Summary
    Cancel Query not working on 11.5.10
    Problem Description
    While finding orders, window pops up the cancel query but when user tries to click the cancel button, query does not cancel.

    jemar98 wrote:
    Problem Summary
    Cancel Query not working on 11.5.10
    Problem Description
    While finding orders, window pops up the cancel query but when user tries to click the cancel button, query does not cancel.Please post the details of the application release, database version and OS.
    Was this working before? If yes, any changes been done recently?
    Please review (Canceling Long Running Queries in Oracle Applications 11i [ID 138159.1]) and make sure you complete all the steps.
    Thanks,
    Hussein

  • Oracle date parameter query not working?

    http://stackoverflow.com/questions/14539489/oracle-date-parameter-query-not-working
    Trying to run the below query, but always fails even though the parameter values matches. I'm thinking there is a precision issue for :xRowVersion_prev parameter. I want too keep as much precision as possible.
    Delete
    from CONCURRENCYTESTITEMS
    where ITEMID = :xItemId
    and ROWVERSION = :xRowVersion_prev
    The Oracle Rowversion is a TimestampLTZ and so is the oracle parameter type.
    The same code & query works in Sql Server, but not Oracle.
    Public Function CreateConnection() As IDbConnection
    Dim sl As New SettingsLoader
    Dim cs As String = sl.ObtainConnectionString
    Dim cn As OracleConnection = New OracleConnection(cs)
    cn.Open()
    Return cn
    End Function
    Public Function CreateCommand(connection As IDbConnection) As IDbCommand
    Dim cmd As OracleCommand = DirectCast(connection.CreateCommand, OracleCommand)
    cmd.BindByName = True
    Return cmd
    End Function
    <TestMethod()>
    <TestCategory("Oracle")> _
    Public Sub Test_POC_Delete()
    Dim connection As IDbConnection = CreateConnection()
    Dim rowver As DateTime = DateTime.Now
    Dim id As Decimal
    Using cmd As IDbCommand = CreateCommand(connection)
    cmd.CommandText = "insert into CONCURRENCYTESTITEMS values(SEQ_CONCURRENCYTESTITEMS.nextval,'bla bla bla',:xRowVersion) returning ITEMID into :myOutputParameter"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.ReturnValue
    p.DbType = DbType.Decimal
    p.ParameterName = "myOutputParameter"
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion"
    v.Value = rowver
    cmd.Parameters.Add(v)
    cmd.ExecuteNonQuery()
    id = CType(p.Value, Decimal)
    End Using
    Using cmd As IDbCommand = m_DBTypesFactory.CreateCommand(connection)
    cmd.CommandText = " Delete from CONCURRENCYTESTITEMS where ITEMID = :xItemId and ROWVERSION = :xRowVersion_prev"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.Input
    p.DbType = DbType.Decimal
    p.ParameterName = "xItemId"
    p.Value = id
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion_prev"
    v.Value = rowver
    v.Precision = 6 '????
    cmd.Parameters.Add(v)
    Dim cnt As Integer = cmd.ExecuteNonQuery()
    If cnt = 0 Then Assert.Fail() 'should delete
    End Using
    connection.Close()
    End Sub
    Schema:
    -- ****** Object: Table SYSTEM.CONCURRENCYTESTITEMS Script Date: 1/26/2013 11:56:50 AM ******
    CREATE TABLE "CONCURRENCYTESTITEMS" (
    "ITEMID" NUMBER(19,0) NOT NULL,
    "NOTES" NCHAR(200) NOT NULL,
    "ROWVERSION" TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL)
    STORAGE (
    NEXT 1048576 )
    Sequence:
    -- ****** Object: Sequence SYSTEM.SEQ_CONCURRENCYTESTITEMS Script Date: 1/26/2013 12:12:48 PM ******
    CREATE SEQUENCE "SEQ_CONCURRENCYTESTITEMS"
    START WITH 1
    CACHE 20
    MAXVALUE 9999999999999999999999999999

    still not comming...
    i have one table each entry is having only one fromdata and one todate only
    i am running below in sql it is showing two rows. ok.
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  '830' and  '850'  and t1.U_frmdate ='20160801'  and  t1.u_todate='20160830'
    in commond promt
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  {?FromEmid} and  {?ToEmid} and t1.U_frmdate ={?FDate} and  t1.u_todate={?TDate}
    still not showing any results..

  • Since updating the recent OS on my iPad my location services do not work.  Maps "Cannot determine location"  and "Find Me" is running in circles.  How can I delete the update on my iPad???

    Since updating the recent OS on my iPad my location services do not work.  Maps "Cannot determine location"  and "Find Me" is running in circles.  How can I delete the update on my iPad???

    You can't delete the update and your problem probably is not in the Update.
    Check to see if Location Services is turned ON. (Settings > Privacy > Location Services)
    What model iPad Mini do you have? WiFi or WiFi + Cellular
    Have you recently changed WiFi routers?

Maybe you are looking for