PostgreSQL and select nextval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm getting an error message when i run the following SQL request :
$sql = "INSERT INTO tmp_importedxls (rec_id, publisher) VALUES (SELECT
nextval('tmp_importedxls_rec_id_seq'),'$pb')";

Error in SQL query: ERROR: syntax error at or near "SELECT" LINE 2: VALUES
(SELECT nextval('tmp_importedxls_rec_id_seq'),' ^

I have the feeling that we can not use the select nextval(...) SQL request
in an INSERT INTO one under PHP.
Is it true?

thanks
-- 
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.3
Apache 2.2.4
PHP 5.2.3

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux