4 messages in com.mysql.lists.mysqlmysql_query problem: insert .. select
FromSent OnAttachments
Michael Widenius25 Apr 1999 14:59 
jahan26 Apr 1999 01:48 
jahan26 Apr 1999 13:51 
jahan26 Apr 1999 13:55 
Subject:mysql_query problem: insert .. select
From:jahan (jah@pc.jaring.my)
Date:04/26/1999 01:48:29 AM
List:com.mysql.lists.mysql

PostCodes - ID- auto - City char 50 - PostCode char 20

Addresses - Name - Age - City char 50 - PostCode char 20

This is the call I make .

ConnectToMySQL(); // Display Error if not connected UseDatabase("Statistics"); // Display Error if not used if(mysql_query(&mysql,"insert into PostCodes select 0,City,PostCode from Addresses where City !='CAL'")!=0) Show_error();

And I get this error. Access denied for user: 'jahan@localhost' to database 'Statistics'

Thing that I checked.

-> Connected to MySQL - Yes -> Can insert to PostCodes , if I drop the select part -> Tried the <> operator -> Works very fine in command prompt ( copy /paste, exactly )

Q. Is it built feature not to support subquery in mysql_query ? Q. Any expert sees any problem with the query above ?

Thank you very much.