[libRETS-users] SQL-Like Querying Rets db

Keith T. Garner kgarner at crt.realtors.org
Tue Jul 3 14:10:33 CDT 2007


Because this keeps coming up, and given that StanardNames is almost always
useless, I'm thinking of switching the default in the next release of
libRETS.  What say ye libRETS users?

Keith

On 7/3/07 2:08 PM, Matt Lavallee wrote:
> Disable StandardNames if you want to use the short name (which you
> should).  The long name “ResidentialProperty”  is what it expects with
> StandardNames enabled (as shown in your metadata below).
> 
>  
> 
> request.SetStandardNames(false);
> 
>  
> 
> -Matt
> 
>  
> 
> *From:* librets-users-bounces at crt.realtors.org
> [mailto:librets-users-bounces at crt.realtors.org] *On Behalf Of *Agustin
> Garzon
> *Sent:* Tuesday, July 03, 2007 1:57 PM
> *To:* For discussion and help for and by the users of the libRETS C++
> library
> *Subject:* Re: [libRETS-users] SQL-Like Querying Rets db
> 
>  
> 
> Good afternoon subscribers!
> 
> I'm facing a situation when running a search.
> With a custom C# tool (using librets), I'm able to explore the metadata.
> I'm interested in the contents of Resource *Properties*, Class *RESI
> *(Residential Properties).
> 
> Whenever I run the query in the tool, I get an error stating
> *"Miscelaneous Search Error: The Class name is incorrect"*.
> The query is simple:
> SearchRequest request= new SearchRequest("*Property*", "*RESI*",
> "*(MLNumber=0+)*");
> SearchResultSet results = session.Search(request);
> 
> RESI is an actual class name or Property, see its metadata dump:
>     ClassName    RESI
>     Description    Contains data for Single Family searches.
>     StandardName    ResidentialProperty
>     TableDate    Mon, 02 Jul 2007 13:30:36 GMT
>     TableVersion    01.50.11642
>     UpdateDate   
>     UpdateVersion    01.50.10219
>     VisibleName    Single Family
> 
>  If I make the query through ezRETS, I get to run it with no problem.
> 
> Am I missing anything?
> 
> Look forward to getting your comments on this.
> 
> Cordially,
> *Agustin Garzon*
> 
> ----- Original Message ----
> From: Keith T. Garner <kgarner at crt.realtors.org>
> To: For discussion and help for and by the users of the libRETS C++
> library <librets-users at crt.realtors.org>
> Sent: Saturday, June 30, 2007 3:19:11 PM
> Subject: Re: [libRETS-users] SQL-Like Querying Rets db
> 
> Based on the metadata you're talking about, it looks like you're hitting the
> demo server.  There's a few things to note here.
> 
> 1) .ANY. was added in RETS 1.7.  The demo server only conforms to RETS 1.5.
> However, a super majority of the RETS servers out there are RETS 1.5, so
> that's not a bad thing.
> 
> 2) The demo's server's metadata is a mess.  Except for ResidentialProperty,
> the rest of the metadata is to be considered experimental and not good for
> testing.  As you saw with CommercialProperty, there are '.' in the Table
> names.  Per RETS 1.5, the Names/SystemNames are defined as 32 ALPHANUM
> characters.  That's a-z,A-Z,0-9 only.  Dots aren't part of it.
> 
> 3) A metadata cleanup on that server is on the todo list, but is of super
> low priority.
> 
> 4) The demo server's metadata is not indicative of real life MLS metadata.
> Actually, the actual data is not anything like real MLS data either.
> 
> Keith
> 
> On 6/30/07 8:38 AM, Agustin Garzon wrote:
>> Dear Members,
>>
>> Looking for a way to obtain a full recordset (not filtered) out of an
>> "always-true" query, I observed the following:
>>
>> I tried the Keith's approach (thanks Keith!), it seems to be the one
>> that gets me closer to what I'm looking for.
>> Over the Class I  want to obtain the full recordset, I look for the
>> Table that is marked as Unique
>> I used that Table to build my query this way:
>>
>> DB: http://demo.crt.realtors.org:6103/rets/login
>> RES: Property
>> CLASS: ResidentialProperty
>> Unique TABLE: ListingID
>>
>> When performing the search, the query (ListingID=.ANY.) popped the error
>> Invalid Query Syntax: line 1:12: unexpected char: '.'
>> Anyway, I tried this alternative query (ListingID=0+) and it worked! I
>> got the full recordset for the Class ResidentialProperty
>>
>> So far so good, when I try the same approach to the Class
>> CommercialProperty, I get an error.
>> It seems that the Unique table for CommercialProperty is named
>> usercac.PropertyIdentification
>> As soon as I send that table to the query
>> (usercac.PropertyIdentification=0+) the same error above Invalid Query
>> Syntax: line 1:9: unexpected char: '.'
>>
>> If I try using (PropertyIdentification=0+) instead, it doesn't work
>> either. It brings the error Invalid Query Syntax: line 1:1: unexpected
>> token: PropertyIdentification
>>
>> It seems that the only problem here is the DOT (.) in the query.
>>
>> I wanted to post these observations in case you face some similar task.
>> On the other hand, it would be good to know why those errors are arising
>> and what's the possible workaround.
>>
>> Have a nice weekend!
>>
>> Agustin Garzon
>>
>> ----- Original Message ----
>> From: Mark Klein <mklein at dis.com>
>> To: For discussion and help for and by the users of the libRETS C++
>> library <librets-users at crt.realtors.org>
>> Sent: Friday, June 29, 2007 6:51:55 PM
>> Subject: Re: [libRETS-users] SQL-Like Querying Rets db
>>
>>
>> On Jun 29, 2007, at 6:04 AM, Matt Lavallee wrote:
>>
>>> (recmodificationdate=1975-01-01+)
>>>
>>
>> Or alternately, (recmodificationdate=.ANY.)
>>
>> Regards,
>>
>>
>> M.
>>
>>> *From:* librets-users-bounces at crt.realtors.org
>>> [mailto:librets-users-bounces at crt.realtors.org] *On Behalf Of *Agustin
>>> Garzon
>>> *Sent:* Friday, June 29, 2007 6:02 AM
>>> *To:* librets-users at crt.realtors.org
>>> <mailto:librets-users at crt.realtors.org>
>>> *Subject:* [libRETS-users] SQL-Like Querying Rets db
>>>
>>>  
>>>
>>> *Dear members,*
>>>
>>> I've read several posts in this list of people using libRETS to
>>> perform a sort of local mirroring or a Rets db, that is later kept in
>>> synch with the actual remote db.
>>>
>>> What I want to do is exactly that. I managed to walk all the db
>>> structure through its metadata, and store it in my desired controls. I
>>> can explore Resources, Classes and Tables.
>>>
>>> My problem is getting the contents of a class, I mean the 'rows' as
>>> they are usually called in the db jargon.
>>>
>>>  
>>>
>>> It seems that the only way to read an entire class is using a
>>> SearchRequest with Resource, Class and Query as parameters.
>>>
>>> Well, I would like to get the entire Class' rows, not a narrowed,
>>> filtered recordset.
>>>
>>> A blank query param would help, but query can't be blank or the
>>> Session object will complain.
>>>
>>>  
>>>
>>> I think of the query parameter as the "WHERE" clause in sql. I would
>>> like it to be blank so I can get all the records for my pleasure.
>>>
>>> But I've hear that there is no such thing as a blank query in the rets
>>> standard, so it will not help (I think).
>>>
>>>  
>>>
>>> Perhaps using an 'always true' query parameter, like 'price list is a
>>> number'. Then again, the application don't know how an 'always true'
>>> query would look like. There should  be not human intervention in this.
>>>
>>>  
>>>
>>> I appreciate any help you can provide for getting entire Class' rows
>>> dumped out.
>>>
>>>  
>>>
>>> Thanks! Cordially,
>>>
>>> *Agustin Garzon*
>>>
>>>  
>>>
>>> ------------------------------------------------------------------------
>>>
>>> Boardwalk for $500? In 2007? Ha!
>>> Play Monopoly Here and Now
>>>
> <http://us.rd.yahoo.com/evt=48223/*http:/get.games.yahoo.com/proddesc?gamekey=monopolyherenow>
>>> (it's updated for today's economy) at Yahoo! Games.
>>>
>>> _______________________________________________
>>> libRETS-users mailing list
>>> libRETS-users at crt.realtors.org <mailto:libRETS-users at crt.realtors.org>
>>> http://mail.crt.realtors.org/mailman/listinfo/librets-users
>>
>> --
>> Mark Klein
>> PGP Key Available
>> www.dis.com <http://www.dis.com> <http://www.dis.com>
>>
>>
>> _______________________________________________
>> libRETS-users mailing list
>> libRETS-users at crt.realtors.org
>> http://mail.crt.realtors.org/mailman/listinfo/librets-users
>>
>>
>> ------------------------------------------------------------------------
>> Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge
>>
> <http://us.rd.yahoo.com/evt=47093/*http://tv.yahoo.com/collections/222>to
> <http://us.rd.yahoo.com/evt=47093/*http:/tv.yahoo.com/collections/222%3Eto>
>> see what's on, when.
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> libRETS-users mailing list
>> libRETS-users at crt.realtors.org
>> http://mail.crt.realtors.org/mailman/listinfo/librets-users
> 
> 
> -- 
>   Keith T. Garner - Managing Director - Center for REALTOR® Technology
>    kgarner at realtors.org - 312-329-3294 - http://blog.realtors.org/crt
> 
> _______________________________________________
> libRETS-users mailing list
> libRETS-users at crt.realtors.org
> http://mail.crt.realtors.org/mailman/listinfo/librets-users
> 
>  
> 
>  
> 
> ------------------------------------------------------------------------
> 
> Ready for the edge of your seat? Check out tonight's top picks
> <http://us.rd.yahoo.com/evt=48220/*http:/tv.yahoo.com/> on Yahoo! TV.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> libRETS-users mailing list
> libRETS-users at crt.realtors.org
> http://mail.crt.realtors.org/mailman/listinfo/librets-users


-- 
  Keith T. Garner - Managing Director - Center for REALTOR® Technology
   kgarner at realtors.org - 312-329-3294 - http://blog.realtors.org/crt




More information about the libRETS-users mailing list