Mailing List Archive



Back to the month index Back to the list index

Bob Basques (bob.basques@stpaul.gov)
Thu, 09 Jan 1997 10:32:32 -0600


Message-Id: <32D51DA0.2390@stpaul.gov>
Date: Thu, 09 Jan 1997 10:32:32 -0600
From: Bob Basques <bob.basques@stpaul.gov>
Subject: Re: [mSQL] perl/msql

Paul Bristow wrote:
>
> Bob,
>
> > I'm using MSQL to access some databases, some exist, some don't (yet), some
> > may never exist, in most instances I'm not going to know which tables are
> > going to be queried until I get some input from a script built in perl that
> > is hooked to a graphical interface (GIS oriented), in other words each
> > table name corrosponds to a geographic area, so i don't know which area,
> > table name, is going to be queried until it is time to make the query. I
> > subsequently need some way of telling wether a table exists or not, or be
> > able to read an error returned from MSQL when a query is made on a table
> > that does not yet exist to tell the user "no data available" or some such.
>
> I had a need for this too - my msql daemon crashed sometimes when a query
> was made on a non-existent table or database.
>
> My solution was a library file you require in your scripts. You call
> &chkdbtable($table, $database) before runing the query. For
> your purposes you could just use chktable. With hindsight you should
> pass a database handle in to the subs to save the additional connections:
>
> #----------------------------------------------------------------

I think that we are thinking along similar lines, I'm leaning toward
this kind
of solution. Its been suggested to just make the tables (complete area
coverage)
 with no data and just query them like any other table, count the rows,
if less than 1
wahla, no data to return, no error either, I can generate the tables
automatically no
problem. Do you happen to know if this tack will be detrimental in the
long run?

bobb

-- 
Bob Basques
bob.basques@stpaul.gov - WORK
 blammo@win.bright.net - HOME
        www.stpaul.gov - 3rd of a bunch of (Volunteer) Webmasters 
    bridges.stpaul.gov - Webmaster
25 W. 4th St.            PHONE (612)266-6188
900 C.H.A. Bridge Div.     FAX (612)292-6315
St. Paul, Mn. 55102
--------------------------------------------------------------------------
To remove yourself from the Mini SQL mailing list send a message containing
"unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com.  Send a message containing
"info msql-list" to majordomo@bunyip.com for info on monthly archives of
the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!