Thanks a bunch for your instance responce.  Right now, I'm just testing
the stored procedure feature of MySQL 5.0.  If that works, we'll see next
if the timetable for MySQL 5.0 go production can meet our own timetable. 
'Select Into' was also what I figured.  Just wanted to see if MySQL has
already had such a kind of feature like 'if not exists' but may be
implemented in a different way so I don't have to make my own workaround. 
The application software that accesses the backend database is a comercial
software.  We don't have the source code and thus not able to get rid of
the stored procedures it uses.  This application software also sets up
some application specific parameters in the backend database.  I searched
'param' within MySQL documentation but was not able to find out how
parameters should be defined in MySQL.  I noticed MaxDB has a bunch of
param_* DBM commands.  Does MySQL support user defined parameters (or
perhaps it's called something else rather than 'parameter')?

Bing

>
> First, please be aware that MySQL 5.0 is an alpha release. It is very
> young and there may still be some unresolved issues. It is not generally
> recommended to use alpha releases in production situations. Besides,
> anything that can be done in a stored procedure can be implemented in
> client side code.
>
> That said, the If Exists is used with Create and Drop statements. I don't
> think that you can use it to determine the rows returned by a select
> statement.
>
> There may be other techniques but this is what I'd do:
>
> Take your select query any convert it to a count(*) query and use Select
> Into to store the count in a variable. Use this variable in your if
> statement.
>
> See this chapter in Select Into:
> http://www.mysql.com/doc/en/SELECT_INTO_Statement.html
>
> If it isn't possible to turn your query into a count(*) then you might try
> using FOUND_ROWS(). See this chapther for more info:
>
> http://www.mysql.com/doc/en/Miscellaneous_functions.html
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to