portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sean Taylor <da...@bluesunrise.com>
Subject Re: [j2] database platform support
Date Wed, 05 May 2004 21:53:31 GMT

On May 5, 2004, at 2:43 PM, Tim Reilly wrote:

>> Im having a problem with MySQL in that I cannot get this syntax to
>> execute (when populating the entities):
>> INSERT INTO TABLE (ID, SOME_FK, DESCRIPTION) VALUES (1, SELECT ID FROM
>> OTHERTABLE WHERE NAME = 'SOMETHING'), 'test');
>
> Does this work out for you?...
>
> INSERT INTO TABLE (ID, SOME_FK, DESCRIPTION)
> SELECT 1, OTHERTABLE.ID, 'test' FROM OTHERTABLE WHERE NAME = 
> 'SOMETHING';
>
I tried that but it wouldn't work for me

> I see insert...select is supported
> http://dev.mysql.com/doc/mysql/en/INSERT_SELECT.html
>
> MySQL 4.1 has added subquery/subselect support,
> is that the version its not working on?
>
No Im on 4.0.18, that must be the problem

I got it working by putting quotes around the SELECT statement, which 
is not compatible with the other databases

insert into sometable (id, fk, description) values (1, "select id from 
othertable where name = \'something\'", '1');





---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message