[Mapserver-users] OGR Layer with SQL

Blaine Hackett blaine_hack1 at YAHOO.COM
Wed Aug 4 23:12:58 EDT 2004


NOE

Thanks but that did not work either.  I can't even get
the date field working with a single date.  I even
changed the date field to military, short time so that
it did not have the last two numbers and no AM or PM.

Strangely enough if I write something like:
<SrcSQL> SELECT * FROM subset WHERE
tim_time=7</SrcSQL>
It does not give me an error.  I get nothing on the
map but it does not give me an error.

If I change it ever so slightly and add the colon like
this
<SrcSQL> SELECT * FROM subset WHERE
tim_time=7:</SrcSQL>

MapServer gives me the msOGRFileOpen(): OGR error I
have described.

Also, I cannot use double quotes in the SrcSQL
statement.  It gives me a parsing error every time I
try that.

So, for some reason the colon is giving it fits and it
must have something to do with the quotes.

I also tried a semi-colon in place of the colon and
that did NOT give me an error.  I am at a loss.

Thanks for your help.  I am still hoping to figure
this out soon if anyone else has ideas.

Blaine

--- NOE CELESTINO <ncelestino at yahoo.com> wrote:

> Have you tried something like this:
> <SrcSQL> SELECT * FROM subset
> WHERE time BETWEEN ('6:00:00 AM', '7:30:00 AM')
> </SrcSQL>
>
> but be careful 'cause maybe you'll need to write all
> without capital letters.
>
> --- Blaine Hackett <blaine_hack1 at yahoo.com> wrote:
>
> > All
> >
> > I am having a problem using SQL with OGR.  The
> > following SQL statement works:
> > <SrcSQL>SELECT * FROM subset (time > '6:00:00 AM'
> > </SrcSQL>
> >
> > but if I make it complex like this:
> > <SrcSQL>SELECT * FROM subset (time > '6:00:00 AM')
> > AND
> > (time < '7:30:00 AM')  </SrcSQL>
> >
> > It throws this error:
> > msOGRFileOpen(): OGR error. Open failed for OGR
> > connection ` ODBC:ODBC:user/pass at minnesotadata
> > SELECT
> > * FROM subset (time > '6:00:00 AM') AND (time <
> > '7:30:00 AM') wkbPoint WGS84 '. File not found or
> > unsupported format.
> >
> > The SQL syntax I am using is exactly like the
> syntax
> > shown on
> >
> http://www.remotesensing.org/gdal/ogr/ogr_sql.html.
> >
> > I have tried every combination of quotes and
> > parenthesis and uppercase and lowercase without
> > success. I have also tried copying and pasting
> from
> > the Access SQL window since that is the database I
> > am
> > linking to but that does not work at all.
> >
> > Anyone have any ideas what I am doing wrong?
> >
> > Blaine
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Y! Messenger - Communicate in real time. Download
> > now.
> > http://messenger.yahoo.com
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users at lists.gis.umn.edu
> >
>
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> >
>
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
> http://promotions.yahoo.com/new_mail
>




__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail



More information about the mapserver-users mailing list