MySQL and validation rule

2004-10-10 Thread Jonathan Jesse
As mentioned previously I am a MySQL newbie. I have read most of the Paul DuBois book and portions I have found relevant of the manual to help me out, however I have not found an answer to this question, maybe it is not even needed. I have used MS Access a lot and one of the ways I use it is to

RE: Finding records not in a set

2004-10-10 Thread Bartis, Robert M (Bob)
Thanks for the tip. I'm still facing an issue where I think I have the right syntax and I'm receiving an ODBC failure. Do you have any suggestions on how to go about understanding why the failure and hence how to correct it? Bob -Original Message- From: Martin Gainty [mailto:[EMAIL

Enforce value on select

2004-10-10 Thread John Mistler
Is there a way to force SOME value to be returned from a SELECT query when the result is empty set? For instance: SELECT nameColumn from theDatabase WHERE rowID = 5; (when no row has ID 5) result -- empty set I would like for it to return some value, such as '' or 0 . . . Thanks, John --

auth and ssh tunnel

2004-10-10 Thread Carl Karsten
I am trying to connect to MySql with an SSH tunnel that terminates on the same box MySqld is running on. I would expect that I do L3306:localhost:3306 and grant access to [EMAIL PROTECTED] This doesn't seem to work. I got this to work on a test box: L3306:my.sql.IP:3306 grant access to [EMAIL

Re: Stuck in an upgrade to mysql 4.1 and other pains ...

2004-10-10 Thread Michael Stassen
rik wrote: Hello all Sitting stuck in an upgrade to mysql 4.1, I thought this mailing list would be a good idea to get help. I've a php4/mysql application developed on a windows xp machine. Right now I want to migrate this app to my linux machine. Since the app uses subqueries, I need to

Strange join results

2004-10-10 Thread Ville Mattila
Hi there! I have three tables: 1. Products - id - name 2. OutOrders (orders from customers to us) - id - productid - quantity 3. InOrders (our ourders to the traders) - id - productid - quantity When I try to find out the current amount of products in our

RE: Date Type Probelm

2004-10-10 Thread John Bonnett, RD Australia
In your query you have converted the Date column into a string by using DATE_FORMAT so it is a string of bytes. If you want it to still be a date then don't format it. John Bonnett -Original Message- From: Thomas Trutt [mailto:[EMAIL PROTECTED] Sent: Thursday, 7 October 2004 2:29 AM To:

Re: Enforce value on select

2004-10-10 Thread Martin Gainty
John You will have to soemthing similar to Oracle Decode Martin- - Original Message - From: John Mistler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, October 10, 2004 9:23 PM Subject: Enforce value on select Is there a way to force SOME value to be returned from a SELECT query

Read-Only DB User

2004-10-10 Thread Lee Zelyck
Hi All, I'm sorry to access such a basic question, but I couldn't find a specific answer to it in the mysql manual pages. The question is, how would someone create a basic read-only user for a single db? I just intend for it to be used by a script to validate data in the db itself.

Re: Read-Only DB User

2004-10-10 Thread James Weisensee
Lee, On the MySQL side: GRANT SELECT ON db.* TO user@'host' IDENTIFIED BY PASSWORD 'password'; This will give 'user' from 'host' SELECT privileges to all tables on 'db' (db.*). http://dev.mysql.com/doc/mysql/en/GRANT.html HTH, James --- Lee Zelyck [EMAIL PROTECTED] wrote: Hi All, I'm

SOLVED: Read-Only DB User

2004-10-10 Thread Lee Zelyck
Thanks James! The actual command that worked for me was as follows: mysql GRANT SELECT ON db.* TO [EMAIL PROTECTED] IDENTIFIED BY '2user3'; Query OK, 0 rows affected (0.09 sec) I receieved errors while trying to include the 'PASSWORD' option, as that seemed to be wanting a the password in hex

Re: Will series of limited selects return entire table?

2004-10-10 Thread Jim Kraai
Jeff, Yes, unless the contents of the table have changed during the 'paging' sequence. 1. The SQL language specification explicitly doesn't guarantee a particular or reproducible order on rows returned for a select unless an ORDER BY clause is specified. How/whether order remains the same

Re: Enforce value on select

2004-10-10 Thread John Mistler
Thanks for the reply. There is a slight difference in what I need from the IFNULL function. It will only return the specified value if the column is null on a row that actually exists. I am needing a function that will return the specified value if the row does NOT exist. Any other ideas?

ODBC Call failed - Query appears to be corrupt?

2004-10-10 Thread Bartis, Robert M (Bob)
I have a query that I have put together. The query is an attempt to retrieve records from one table, main_db, whose keys are not present in another, featureenable. I am using the NOT EXISTS keywords and continue to receive an ODBC---Call Fail error. I traced the ODBC calls and see something

Re: ODBC Call failed - Query appears to be corrupt?

2004-10-10 Thread Michael Stassen
Subqueries are not supported until mysql 4.1.x. You have 4.0.20. You need to either upgrade mysql or rewrite your query as a join. (Joins are often more efficient anyway.) Try replacing WHERE NOT EXISTS (SELECT* FROM featureenable WHERE main_db.FeatureKey =

Re: Enforce value on select

2004-10-10 Thread Michael Stassen
Then how will you know the difference between a row with nameColumn = 0 (or '') and one that doesn't exist? What you are asking for seems very strange. You want the db to pretend there's a value for nonexistent rows. If rowID 5 should have the value 0, then I wonder why there isn't a row