Select data with SDO_RELATE in lat long coordinate system(8307) in 10gR2

Hi all,
I have problem with selecting data from table.
Data are in lat lon coordinate system 8307.
These requests don't return any data:
SELECT ISSUE_ID FROM MAP_ISSUES WHERE SDO_FILTER(GEOMETRY, sdo_geometry (2003, 8307, null, sdo_elem_info_array (1,1003,1),sdo_ordinate_array(-180,-90, 180,-90, 180,90, -180,90, -180,-90)) ) = 'TRUE';
SELECT ISSUE_ID FROM MAP_ISSUES WHERE SDO_RELATE(GEOMETRY, sdo_geometry (2003, 8307, null, sdo_elem_info_array (1,1003,1),sdo_ordinate_array(-180,-90, 180,-90, 180,90, -180,90, -180,-90)), 'MASK=ANYINTERACT' ) = 'TRUE'
Optimized polygon does return all data correctly:
SELECT ISSUE_ID FROM MAP_ISSUES WHERE SDO_FILTER(GEOMETRY, sdo_geometry (2003, 8307, null, sdo_elem_info_array (1,1003,3),sdo_ordinate_array (-180,-90,180,90)) ) = 'TRUE'
Smaller polygon select data correctly too.
SELECT ISSUE_ID FROM MAP_ISSUES WHERE SDO_FILTER(GEOMETRY, sdo_geometry (2003, 8307, null, sdo_elem_info_array (1,1003,1),sdo_ordinate_array (52,-7, 54,-7 , 54,-5 , 52,-5, 52,-7)) ) = 'TRUE'
I have tried changed polygon to be clockwise, counter clockwise, make the area a bit smaller( 160 instead of 180, 89 instead of 90) nothing has helped.
My explanation than was, that Earth is sphere and each defined polygon defines TWO polygons in the sphere and there is convention that the smaller is chosen to select data. It would make sense along the previous results, but than I found one post which says that this is bug http://www.frontoracle.com/oracle-database/703/180703-size-of-are-of-interest-smaller-equals.html
I have found in other thread that max only 1/2 of Earth could be selected Different results using SDO_RELATE with polygon and rectangle type but it seems not true, because optimized bounding box works fine!
What is right? Is there anything in official documentation?
Is it bug.
Max 1/2 of Earth could be selected in one request.
Each polygon defines two areas in the Earth and the smaller one is used to do spatial SDO_RELATE operation?
Thanks!
Regards,
Zdenek

Zdenek,
A bug, or limititation, whichever you choose. IMHO if you ask for something, and don't get what you expect, it is a bug that could be fixed.
But for 10g anywho, the following applies, which is why I choose 120 degree breaks for my code as it is less than 180...
The following size limits apply with geodetic data:
■ No polygon element can have an area larger than one-half the surface of the Earth.
■ In a line, the distance between two adjacent coordinates cannot be greater than or
equal to one-half the perimeter (a great circle) of the Earth.
If you need to work with larger elements, first break these elements into multiple
smaller elements and work with them. For example, you cannot create a geometry
representing the entire ocean surface of the Earth; however, you can create multiple
geometries, each representing part of the overall ocean surface. To work with a line
string that is greater than or equal to one-half the perimeter of the Earth, you can add
one or more intermediate points on the line so that all adjacent coordinates are less
than one-half the perimeter of the Earth.
Bryan

Similar Messages

  • How to create a polygon with the Lat/Long Coordinates

    I have set of Lat/Long coordinates and I need to create a polygon geofence. Can any of you know how to do this please share your thoughts with me
    I have the following coordinates
    -84.3087, 39.3465; -84.3118904, 39.3306296; -84.3265158, 39.3372422; -84.2866, 39.3371; -84.2958, 39.3284; -84.2888, 39.3241
    Thanks

    Assuming these are long/lat values, the polygon can be defined as:
    sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 1),
    sdo_ordinate_array(-84.3087, 39.3465, -84.3118904, 39.3306296, -84.3265158, 39.3372422, -84.2866, 39.3371,
    -84.2958, 39.3284, -84.2888, 39.3241, -84.3087, 39.3465))
    siva

  • Loading Polygon Lat/Long Coordinates

    Am working with Census 2000 data. I have added coordinates to cen00_state
    based on the centroid values in INTPTLAT (latitude) and INTPTLON (longitude).
    SQL> describe cen00_state;
    Name Null? Type
    STUSAB NOT NULL VARCHAR2(2)
    REGION NOT NULL VARCHAR2(1)
    DIVISION NOT NULL VARCHAR2(1)
    STATECE NOT NULL VARCHAR2(2)
    STATE NOT NULL VARCHAR2(2)
    AREALAND NOT NULL VARCHAR2(14)
    AREAWATR NOT NULL VARCHAR2(14)
    NAME NOT NULL VARCHAR2(20)
    FUNCSTAT NOT NULL VARCHAR2(1)
    GCUNI NOT NULL VARCHAR2(1)
    POP100 NOT NULL NUMBER(9)
    HU100 NOT NULL NUMBER(9)
    INTPTLAT NOT NULL VARCHAR2(10)
    INTPTLON NOT NULL VARCHAR2(11)
    LSADC NOT NULL VARCHAR2(2)
    HUD_REGION_ID NOT NULL NUMBER(2)
    HUD_REGION_NAME NOT NULL VARCHAR2(11)
    CKEY NOT NULL VARCHAR2(2)
    STATE_GEO_LOCATION MDSYS.SDO_GEOMETRY
    SQL> -- Select state data for New Hampshire
    SQL> select * from cen00_state where state = 33;
    ST R D ST ST AREALAND AREAWATR NAME F G POP100
    HU100 INTPTLAT INTPTLON LS HUD_REGION_ID HUD_REGION_ CK
    STATE_GEO_LOCATION(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_O
    NH 1 1 12 33 23227265747 988970050 New Hampshire A N 1235786
    547024 +43.309253 -071.540147 01 1 Region I 33
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-71.540147, 43.309253, NULL), NULL, NULL
    Metadata dictionary entry...
    SQL> select * from user_sdo_geom_metadata where table_name = 'CEN00_STATE'
    TABLE_NAME
    COLUMN_NAME
    DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
    SRID
    CEN00_STATE
    STATE_GEO_LOCATION
    SDO_DIM_ARRAY(SDO_DIM_ELEMENT('LONG', -180, 180, .005), SDO_DIM_ELEMENT('LAT', -
    90, 90, .005))
    8307
    Index...
    SQL> select * from user_sdo_index_info where index_name like 'CEN00_STATE%';
    INDEX_NAME TABLE_NAME
    COLUMN_NAME
    SDO_INDEX_TYPE SDO_INDEX_TABLE
    SDO_INDEX_STATUS
    CEN00_STATE_SIDX CEN00_STATE
    STATE_GEO_LOCATION
    RTREE MDRT_37FFD$
    VALID
    SQL> -- Query example
    SQL> -- How close are the New England states to New Hampshire (centroid)?
    SQL> select /*+ordered*/
    a.name,sdo_geom.sdo_distance (a.state_geo_location, b.state_geo_location,
    .005,'unit=MILE') distance_in_miles
    from cen00_state b, cen00_state a
    where b.state = 33 and a.state <> 33
    and sdo_within_distance (a.state_geo_location,b.state_geo_location,
    'distance = 150 unit=MILE') = 'TRUE'
    order by distance_in_miles
    NAME DISTANCE_IN_MILES
    Massachusetts 74.4552857
    Vermont 75.246055
    Rhode Island 109.036884
    Maine 139.790842
    Connecticut 139.841283
    Since the coordinates are the centroid location within a particular
    geographic level, I want to store the polygons. For the Census 2000
    table cen00_anrc:
    SQL> describe cen00_anrc;
    Name Null? Type
    STATE NOT NULL VARCHAR2(2)
    ANRC NOT NULL VARCHAR2(5)
    ANRCCC NOT NULL VARCHAR2(2)
    AREALAND NOT NULL VARCHAR2(14)
    AREAWATR NOT NULL VARCHAR2(14)
    NAME NOT NULL VARCHAR2(90)
    FUNCSTAT NOT NULL VARCHAR2(1)
    GCUNI NOT NULL VARCHAR2(1)
    POP100 NOT NULL NUMBER(9)
    HU100 NOT NULL NUMBER(9)
    INTPTLAT NOT NULL VARCHAR2(10)
    INTPTLON NOT NULL VARCHAR2(11)
    LSADC NOT NULL VARCHAR2(2)
    CKEY NOT NULL VARCHAR2(7)
    ANRC_GEO_LOCATION MDSYS.SDO_GEOMETRY
    I obtained the polygon coordinates from the Census Bureau for the ANRC geography.
    The data was loaded into a table:
    SQL> describe poly_4pt;
    Name Null? Type
    STATE VARCHAR2(2)
    ANRC VARCHAR2(5)
    GID VARCHAR2(32)
    GEOMETRY MDSYS.SDO_GEOMETRY
    An example query:
    SQL> select * from poly_4pt where gid = 68;
    ST ANRC GID
    GEOMETRY(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    02 01570 68
    SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARR
    AY(173.602191, 52.444285, 173.732254, 52.5124549, 173.73627, 52.512422, 173.7695
    03, 52.512072, 173.772799, 52.509905, 173.772402, 52.506877, 173.766595, 52.5032
    94, 173.754979, 52.496127, 173.739385, 52.493257, 173.722218, 52.4846423, 173.70
    7741, 52.477377, 173.700056, 52.4655878, 173.695719, 52.458935, 173.691601, 52.4
    45935, 173.69386, 52.438694, 173.702252, 52.434804, 173.704299, 52.432192, 173.7
    12323, 52.421033, 173.719161, 52.397703, 173.725102, 52.360316, 173.725696, 52.3
    56579, 173.722229, 52.3565693, 173.651293, 52.35637, 173.644793, 52.357598, 173.
    640825, 52.359428, 173.606767, 52.378249, 173.595397, 52.391893, 173.593253, 52.
    3948411, 173.588794, 52.400973, 173.562061, 52.4011506, 173.559891, 52.401165, 1
    73.559254, 52.4008288, 173.556548, 52.3994015, 173.543778, 52.392666, 173.539462
    , 52.3916242, 173.512162, 52.385035, 173.503009, 52.384534, 173.495585, 52.38412
    77, 173.483843, 52.383485, 173.475268, 52.3840144, 173.465442, 52.384621, 173.45
    5586, 52.389656, 173.3955, 52.402647, 173.385704, 52.404072, 173.36964, 52.40396
    09, 173.362396, 52.4039108, 173.356927, 52.403873, 173.356103, 52.405563, 173.38
    0058, 52.431843, 173.440111, 52.453664, 173.445696, 52.455031, 173.467698, 52.44
    4473, 173.476243, 52.441909, 173.485468, 52.4415431, 173.490265, 52.4413527, 173
    .496641, 52.4410998, 173.501022, 52.440926, 173.525161, 52.448137, 173.530105, 5
    2.449968, 173.550002, 52.467067, 173.549605, 52.469989, 173.545302, 52.476, 173.
    555739, 52.479472, 173.556228, 52.4794307, 173.562814, 52.4788745, 173.587554, 5
    2.476785, 173.597091, 52.4847036, 173.623883, 52.506948, 173.680586, 52.512878,
    173.732254, 52.5124549))
    Now I want to load the polygons into cen00_anrc doing a join between
    poly_4pt and cen00_anrc with anrc as the join field. After a number
    of attempts to do so I am received an error saying that the SRID criteria
    doesn't match at various levels. Unfortunately I can't seem to reconstruct
    the query that I was using earlier to get to the point where I was
    getting the SRID error.
    Questions:
    - Can I store polygons as lat/long coordinates? If affirmitive, then
    what are the proper values for the header information for SDO_GEOMETRY?
    - What is the most efficient SQL update command to load the polygons from
    the poly_4pt table into the cen00_anrc table?
    Thank you for any assistance.

    I have further narrowed down the problem. It is the way the sdo_geometry and sdo_elem_info_array information is being placed in the data flow within the sqlldr control file. If I leave out the '8307' SRID value thusly:
    LOAD DATA
    INFILE *
    TRUNCATE
    CONTINUEIF NEXT(1:1) = '#'
    INTO TABLE POLY_4PT
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS (
    STATE CHAR,
    ANRC CHAR,
    GID INTEGER EXTERNAL,
    GEOMETRY COLUMN OBJECT
    SDO_GTYPE INTEGER EXTERNAL,
    SDO_ELEM_INFO VARRAY TERMINATED BY '|/'
    (elements FLOAT EXTERNAL),
    SDO_ORDINATES VARRAY TERMINATED BY '|/'
    (ordinates FLOAT EXTERNAL)
    begindata
    02|03950|1|2003|1|1003|1|/
    #-0.153395741022000E+03|0.679530269228395E+02|
    #-0.149460812000000E+03|0.680022380000000E+02|
    #-0.149506561000000E+03|0.680019960000000E+02|
    it loads the correct values into the respective fields:
    SQL> select * from poly_4pt where anrc = '00590';
    ST ANRC GID
    GEOMETRY(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    02 00590 9
    SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARR
    AY(-144.47165, 61.6139949, -148.80311, 63.649898, -148.78899, 63.649597, -148.78
    899, 63.649597, -148.66386, 63.647044, -148.42804, 63.649307, -148.42155, 63.503
    If I add the '8307' SRID to the data syntax thusly ('8307' now follows SDO_GTYPE):
    02|03950|1|2003|8307|1|1003|1|/
    #-0.153395741022000E+03|0.679530269228395E+02|
    #-0.149460812000000E+03|0.680022380000000E+02|
    #-0.149506561000000E+03|0.680019960000000E+02|
    The data doesn't get loaded into the proper fields. The '8307' SRID becomes part of SDO_ELEM_INFO instead of SDO_SRID even though it seems that it should load correctly the way I have it formatted.
    SQL> select * from poly_4pt where anrc = '00590';
    ST ANRC GID
    GEOMETRY(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    02 00590 9
    SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(8307, 1, 1003, 1), SDO_ORDINATE_ARRAY(-144.47165, 61.6139949, -148.80311, 63.649898, -148.78899, 63.649597, -
    148.78899, 63.649597, -148.66386, 63.647044, -148.42804, 63.649307, -148.42155,
    63.503574, -148.41974, 63.462892, -148.41658, 63.391985, -148.36345, 63.391998,
    So the real problem is that I don't understand what sqlldr is doing and therefore don't understand where I should position the '8307' SRID value in the data flow in order for it to be loaded into the correct field. I guess I am "object-relational data load challenged"!
    Thank you for your continued assistance.

  • Calculating distance between lat long coordinates best possible way?

    Hi,
    Am proposing to have a table A with latitude and longitude values along with some other info for that lat lon in it. The number of rows of data will be more and it will be growing day by day. i am having one application which will provide a latitude and longitude value and this i have to compare with all the lat lon of the table A and fetch the nearest (distance wise) information from other columns corresponding to that lat long in table A.
    what is the best method available to implement this so as to reduce the time required to compare lat lon supplied with all rows of data in table A.
    Thanks in advance.

    Have a look at the spatial option from oracle. Also there is a forum dedicated to this type of questions.
    http://www.oracle.com/technetwork/database/options/spatial/index.html
    especially: http://download.oracle.com/otndocs/products/spatial/pdf/locator11g_feature_overview.pdf
    Edited by: Sven W. on Nov 30, 2010 5:53 PM

  • Selecting data with cursors on an X-Y Graph

    I would like to make an interactive XY plot with two cursors. These
    cursors will allow the user to select a range of data, and send the
    selected data to an array. Sending the data to an array and referencing
    the positions to the array is no problem, but I cannot get the two
    cursors to work simultaneously.  I am monitoring the positions on
    the front panel, and both indicators display the same data. How do I
    set the property nodes to treat each cursor as separate, and collect
    separate data from each? Thanks.

    Before you can get the cursor index or cursor position, you have to first set the active cursor.
    Message Edited by Dennis Knutson on 03-24-200609:57 AM
    Attachments:
    active cursor.JPG ‏15 KB

  • Dynamically select data with 20 input parameters

    Hi Experts,
    Now i have created a subscreen with more than 20 fields on it. these fields are defined by parameters, not select options. user can input any fileds for these input parameters.
    So now i should write codes to select data from database according the user input. Is there any easy way for me to write it? I heard about dynamically SQLs, but i don't know how to use it.
    Thanks a lot!

    you forgot to mention why you needed dynamic SQL : I guess that when user lets a field blank, you must not perform selection on it.
    The easiest is ( FIELD1 = P_FIELD1 OR FIELD1 = space ) AND ( FIELD2 = P_FIELD2 OR FIELD2 = space ) AND etc. Even if it seems repetitive, I advise you to keep the SQL static instead of dynamic, because in this latter case, I think the code will be a little bit less clear.
    Of course, if you argue that there are other requirements, then maybe it's worth re-evaluating the solution.
    If you need more information, just look at ABAP examples in your system (SE38, Environment, Examples, ABAP examples -> ... -> Dynamic conditions)

  • How to select data with multiple child nodes

    We have the following data:
    me table ei table
    m1 e1
    m1 e2
    m1 e3
    m1 e4
    m2 e5
    m2 e6
    m3 e7
    m3 e8
    I would like to display them as:
    m1 e1
    e2
    e3
    e4
    m2 e5
    e6
    m3 e7
    e8
    How to best do this with sql?
    I would like to produce this list with sql and then transform it to xml.
    Thanks.

    Since you did not use tags it is not clear what results should be:
    SQL> WITH TBL AS (
      2  SELECT 'm1' me, 'e1' ei FROM DUAL UNION ALL
      3  SELECT 'm1' me, 'e2' ei FROM DUAL UNION ALL
      4  SELECT 'm1' me, 'e3' ei FROM DUAL UNION ALL
      5  SELECT 'm1' me, 'e4' ei FROM DUAL UNION ALL
      6  SELECT 'm2' me, 'e5' ei FROM DUAL UNION ALL
      7  SELECT 'm2' me, 'e6' ei FROM DUAL UNION ALL
      8  SELECT 'm3' me, 'e7' ei FROM DUAL UNION ALL
      9  SELECT 'm3' me, 'e8' ei FROM DUAL
    10  )
    11  SELECT  CASE ROW_NUMBER() OVER(PARTITION BY ME ORDER BY EI) WHEN 1 THEN ME ELSE NULL END ME,
    12          EI
    13    FROM  TBL
    14    ORDER BY TBL.ME,
    15             TBL.EI
    16  /
    ME EI
    m1 e1
       e2
       e3
       e4
    m2 e5
       e6
    m3 e7
       e8
    8 rows selected.or
    SQL> WITH TBL AS (
    2 SELECT 'm1' me, 'e1' ei FROM DUAL UNION ALL
    3 SELECT 'm1' me, 'e2' ei FROM DUAL UNION ALL
    4 SELECT 'm1' me, 'e3' ei FROM DUAL UNION ALL
    5 SELECT 'm1' me, 'e4' ei FROM DUAL UNION ALL
    6 SELECT 'm2' me, 'e5' ei FROM DUAL UNION ALL
    7 SELECT 'm2' me, 'e6' ei FROM DUAL UNION ALL
    8 SELECT 'm3' me, 'e7' ei FROM DUAL UNION ALL
    9 SELECT 'm3' me, 'e8' ei FROM DUAL
    10 )
    11 SELECT CASE ROW_NUMBER() OVER(PARTITION BY ME ORDER BY EI) WHEN 1 THEN ME ELSE EI END ME,
    12 CASE ROW_NUMBER() OVER(PARTITION BY ME ORDER BY EI) WHEN 1 THEN EI ELSE NULL END EI
    13 FROM TBL
    14 ORDER BY TBL.ME,
    15 TBL.EI
    16 /
    ME EI
    m1 e1
    e2
    e3
    e4
    m2 e5
    e6
    m3 e7
    e8
    8 rows selected.
    SQL>
    SY.

  • Designing View to select Date with Time

    Hi,
    How can we design the view to select the date along with time?
    We know that we can provide drop downs for hours, minutes and seconds.
    Is there any alternative to display UI element to select the date and time. I am in 7.0 SP17
    Thanks

    Hi Tatayya Marni,
    For selecting the Date and Time u can try a workaround. First create a simple type of type date and bind it to an Input Field so that the date can be captured and for the for the time u can use the System Date and using the same SystemDate u can get the Time in Hours, Minutes and Seconds.
    Eg  :- store the SystemDate in a Date variable and to get the hour u can use Date.getHours(), getMinutes
        Date dt = new Date(System.currentTimeMillis());
        dt.getHours(),dt.getMinutes(),dt.getSeconds());
    Hope this works dor u.
    Regards,
    Poojith M V

  • Any efficient way to select data with limit?

    HI
    I want to select some rows of my table for showing in a webpage
    number of rows is very very much and all of them cannot be showed in one page, so i used paging for my webpage
    every page has just 20 rows
    problem is here , how to select rows between 400 and 420 ( for example)
    i am using this way of query:
    select * from
    select col1,col2,col3, rownum as r_n
    from my table
    where ... and .... and ... and ...
    order by id desc
    where r_n between 400 and 420
    this query works, but it is slow. i think database first run inner query and select all rows then select those ones that are in my range
    is there any other efficient way to do this?

    What is a "realtime response"?
    Do they really want the response to be fast on the 200,000th page? Is there actually a use case where a human being looks at 20 rows, hits next, and repeats 200,000 times? Because assuming that the user takes only a second to wait for the page to render, read the results, and hit next, that means that this one user will have spent 3333 minutes/ 55.6 hours/ 2.3 days just looking at results without a break. Are they really going to care at that point if it takes a bit longer to get the next page of results?
    Part of being a developer is explaining trade-offs to the customer. If you want the database to page the results by issuing separate queries, the first page of results will be far faster than the 200,000th page. Since users are normally far more concerned about the performance of the first page than the 200,000th, this is generally a reasonable trade-off. There are alternate approaches that will likely improve the performance of fetching the 200,000th page of results. But those will generally require a more complex architecture. For example, you can return a REF CURSOR to the middle tier and let the middle tier fetch a page of results at a time. But then you have to implement the state control logic so that the right end user session sees the right cursor handle and gets the right session back (this problem is much, much easier in a client/server application)
    Justin

  • Getting crazy selecting dates on a mysql table (long)

    Hi all,
    I have a problem that is driving me crazy.
    I have a table containing 2 columns (QUOTATION and DATE).
    I want to extract only the records that have the date falling
    between
    a specific range.
    I've set 2 variables to hold the two dates:
    $start_date=date
    ("Y-m-d",mktime(0,0,0,date("m"),date("d")-90,date("Y")));
    $end_date=date
    ("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));
    But when I run this query:
    SELECT quotation, date FROM mytable WHERE date BETWEEN
    {$start_date}
    AND {$end_date} ORDER BY date DESC";
    I get ... nothing selected.
    If I use:
    SELECT quotation, date FROM mytable WHERE date >
    {$start_date} ORDER
    BY date DESC";
    I get _all_ records: the records before and after the
    $start_date.
    Here is my little script:
    =====================================
    <?php
    mysql_select_db($database_mmm_conn, $mmm_conn);
    $quotation = (isset($_GET['quotation'])) ?
    mysql_real_escape_string($_GET['quotation']) : "";
    if ($quotation)
    $quotationquery=$metallo;
    else {
    $quotationquery='default_quotation';
    $start_date = (isset($_GET['start_date'])) ?
    mysql_real_escape_string($_GET['start_date']) : "";
    if ($start_date)
    $start_date_query=$start_date;
    else {
    $start_date_query=date
    ("Y-m-d",mktime(0,0,0,date("m"),date("d")-90,date("Y")));;
    $end_date = (isset($_GET['end_date'])) ?
    mysql_real_escape_string($_GET['end_date']) : "";
    if ($end_date)
    $end_date_query=$end_date;
    else {
    $end_date_query=date
    ("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));;
    $query_dati = "SELECT {$quotationquery}, date FROM mytable
    WHERE date
    BETWEEN {$start_date_query} AND {$end_date_query} ORDER BY
    date
    DESC";
    $dati = mysql_query($query_dati, $mmm_conn) or
    die(mysql_error());
    $row_dati = mysql_fetch_assoc($dati);
    $totalRows_dati = mysql_num_rows($dati);
    ?>
    ===============================
    the command
    <? echo $query_dati; ?>
    will return:
    SELECT quotation, date FROM mytable WHERE date BETWEEN
    2007-09-19 AND
    2007-12-18 ORDER BY date DESC
    Even in PhpMyAdmin I don't get anything.
    Heeelllppppp!!
    Any suggestion will be very appreciated.
    Ciao ;).
    tony

    sweetman wrote:
    > here is the correct query string:
    >
    > $query_dati = "SELECT {$quotationquery}, date FROM
    mytable WHERE date
    > BETWEEN '{$start_date_query}' AND '{$end_date_query}'
    ORDER BY date
    > DESC";
    You don't need those complex PHP calculations to find the
    start and end
    dates. It's much more efficient to do it in your SQL like
    this:
    $query_dati = "SELECT {$quotationquery}, date FROM mytable
    WHERE date
    BETWEEN DATE_SUB(NOW(), INTERVAL 3 MONTH) AND NOW() ORDER BY
    date
    DESC";
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Auto-fill calender date and validate other fields depending upon selected date for infopath forms

    I have a calender box in infopath form which i want to autoselect when user opens the form..Ex..i am opening form on 14th march the calender should show as 19th march and also i have to perform few validation and action such as if i am selecting date with
    more than 5 days gap should open other field which is a dropdown..How can i perform this..

    Do you have Excel Services? if so, this article may be of use to you:
    http://sergioblogs.blog.co.uk/2013/01/08/infopath-2010-and-excel-services-in-sharepoint-15407321/
    You can configure an excel workbook to validate if a date is a working day and then use formulas to workout the working date for 5 days after the date you enter, then link your InfoPath form to connect to the excel workbook and return the result of your
    calculation.
    Regards
    Sergio Giusti
    http://sergioblogs.blog.co.uk/
    Whenever you see a reply and if you think is helpful, click " Vote As Helpful". And whenever you see a reply being an answer to the question of the thread, click "
    Mark As Answer".

  • Error "Overlapping selection criteria with DTP" when transporting DTP

    When transporting a DTP from Dev to QA I get the following error in the trasnport log:
    Overlapping selection criteria with DTP DTP_4APJZSGKYQLUQYBCDBWK707JO
    Message no. RSBK019
    Diagnosis
    The selection criteria for the DTP to be activated overlap with the selection criteria of DTP DTP_4APJZSGKYQLUQYBCDBWK707JO in field , for example, with regard to value . Delta transfer from a source object to a target object is only allowed to transfer each record oncce. However, this cannot be guaranteed if two DTPs have overlapping selection criteria with the 'Delta' extraction mode.
    System Response
    You cannot activate the DTP with the current selection criteria.
    Procedure
    Restrict the selection criteria so that they do not overlap with the selection criteria for DTP DTP_4APJZSGKYQLUQYBCDBWK707JO.
    The DTP is a delta process which loads data from one infocube into an DSO. I understand that the error is that it is transporting the Delta parameters (something similar to a Delta initialization of infopackages I suppose) but I don´t how to access the information of the delta (selection criteria) of a DTP.
    Any suggestions? or similar experiences?
    Thanks in advance
    nicolá

    Hello,
    You can modify a parameter to create and modify dtp in Production. Like normally is done with Infopackages. There is no reason to make the changes in Dev in the Infopackages and DTP, and transport to Production. This transports normally cause that kind of errors because the id's are different in Dev, QA and Prod, and it is difficult to change dtp in that way.
    To change the parameter do like this:
    Execute Trx. RSA1 -> Transport Connection -> Tab Object Changeability -> Change DTPA to Everything Changeable.
    Do this in Dev, QA and Prod.
    Regards,
    Jorge Diogo

  • HT4623 Why will my Iphone 4 not connect to internet on wifi nor data with the ios 6.1 update?

    Why will my iphone 4 not connect to the internet on wifi nor data with the ios 6.1 operating system?

    Settings > General > Reset > Reset Network Settings

  • How to create a circle object with center(lat/long) and radius(kilo)?

    Hi
    I want to create a circle in my table, the data I have are the coordinate of center(lat/long) and the radius of the circle. The srid of the table is lat/long.
    Did I have to use some fomula to compute the coordinate of three points on the circle? If it's true, is there any example procedure you can show me?
    Thanks
    Lannie

    When a circle is created using SDO_BUFFER in geodetic space,
    the result is a circle with stroked arcs (as in arc_densify function).
    So the result from SDO_BUFFER will be a valid polygon without arcs,
    but approximate circle with straight lines.
    For example, in the example given by Dan, this is what you get:
    SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(-120, 42.09003, -120.03128, 42.086958, -120.06042, 42.0779524, -120.08543, 42.0636292, -120.1046, 42.0449675, -120.11663, 42.0232424, -120.1207, 41.9999365,
    -120.11654, 41.9766391, -120.10445, 41.9549369, -120.08526, 41.9363067, -120.06028, 41.9220148, -120.0312, 41.9130321, -120, 41.9099686, -119.9688, 41.9130321,
    -119.93972, 41.9220148, -119.91474, 41.9363067, -119.89555, 41.9549369, -119.88346, 41.9766391, -119.8793, 41.9999365, -119.88337, 42.0232424, -119.8954, 42.0449675, -119.91457, 42.0636292, -119.93958, 42.0779524, -119.96872, 42.086958, -120, 42.09003))
    siva

  • How to get GML data in LAT/LONG format rather than LONG/LAT format

    I want to generate GML from my spatial data but sdo_util.to_Gmlgeometry extracts data in LONG/LAT format where as I need it in LAT/LONG format.
    Is there an easy way to extract data in LAT/LONG format otehr than parsing the gml and then switching the Lat and long.

    Hi,
    I think it would have to do how you store your geometries, you might need a transformation before, notice the srsName from the resulting query:
    SELECT TO_CHAR(SDO_UTIL.TO_GMLGEOMETRY(MDSYS.SDO_GEOMETRY(2001, 8307, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1), MDSYS.SDO_ORDINATE_ARRAY(170.5,-43.5))))
    from dual
    -- Result:
    <gml:Point srsName="SDO:8307" xmlns:gml="http://www.opengis.net/gml"><gml:coordinates decimal="." cs="," ts=" ">170.5,-43.5 </gml:coordinates></gml:Point>
    So without a transformation I would say it would be hard to get:
    http://trac.osgeo.org/gdal/wiki/rfc20_srs_axes
    If I come across a simple solution (without some fancy manipulation of the ordinates on a custom function/package) I will post it.
    Cheers

Maybe you are looking for

  • I can't install Mac OS X Snow Leopard on my Mac mini!

    Hi, I have a Mac mini 2007, with OS X 10.5.8 I want to install Mac OS X Snow Leopard, but i can't. I erased the hard drive with the installation disc of leopard and then i tried boot snow leopard. After a few seconds it said: "You can't install on th

  • Analog to digital question

    So while I'm going through manuals etc, I figured I'd post here in case I can't find my answer in other places. I have a Sony CCD-TRV68 Hi-8 camera and a Canon ZR70mc digital camera. I've transferred from the hi8 to the dv through an s-video cable be

  • Link between PO and PR

    Dear Experts, I have one requirment where they need report based on Purchase order and in additional to that they need PR amount(PREIS) which is there n EBAN table and another field PO Asset number(ANLN1) which is in EKKN table.I am using the datasou

  • Bluetooth printing from iPad to Macbook Pro connected to printer?

    Is it possible to print wirelessly from my iPad if i connect my iPad to my Macbook Pro via Bluetooth? What if the Macbook is connected to the printer with a  USB cable? Because the printer I am getting may not be discoverable via AirPrint because of

  • Problem with current item in forms 9i

    I call form from another form the first time the form runs correctly, but if I close it and re-open it again, when I tried to move the cursor to any item in the form using the mouse, the cursor moves correctly but when I need to get the current item