Re: Enforce value on select

2004-10-10 Thread John Mistler
Good idea. liang le's answer almost got it, but I couldn't make it work with string values quite right. Here is my situation: I am issuing a series of queries all-in-one like "SELECT nameColumn, otherColumn FROM theDatabase WHERE rowID = 1;SELECT nameColumn, otherColumn FROM theDatabase WHERE ro

Re: Website site Database (Project)

2004-10-10 Thread Benjamin Arai
What do you mean? On Sun, 10 Oct 2004 23:07:59 -0700 (PDT), John <[EMAIL PROTECTED]> wrote: > > > I wanted to know if this is a good place to post > for a project I needed done, If not can someone direct > me to a better place to post it. > > Thanks > > ___ >

Website site Database (Project)

2004-10-10 Thread John
I wanted to know if this is a good place to post for a project I needed done, If not can someone direct me to a better place to post it. Thanks ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com -- MySQL

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 with

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 = featureenab

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 very

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? SE

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 depend

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: 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'

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. Anyw

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

2004-10-10 Thread rik onckelinx
Hi Michael, Thx for your answer: About your feedback: Current situation: I moved back to my working apache 2 / mysql 4.0/ php 4.3 installation after trying to compile mysql 4.1 from source this afternoon. Which (after following the guidelines on mysql.com) returned in an error in the configure

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

RE: Date Type Probelm

2004-10-10 Thread John Bonnett, R&D 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:

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 sto

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 upgrad

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 PR

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 -

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 PROT

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 t