Re: Syntax error in spi_prepare usage
От | dipti shah |
---|---|
Тема | Re: Syntax error in spi_prepare usage |
Дата | |
Msg-id | q2zd5b05a951004280307w2ac6d12fva71a82419f184c75@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Syntax error in spi_prepare usage (Alban Hertroys <dalroi@solfertje.student.utwente.nl>) |
Список | pgsql-general |
Thanks a lot Alban. That was simple!
On Sat, Apr 24, 2010 at 10:15 PM, Alban Hertroys <dalroi@solfertje.student.utwente.nl> wrote:
> If I remove the braces from (\$1, \$2, \$3) then it gives below error.Yes of course, your select lists are different. Try:
>
> my $query = (<<ENDQUERY);
> INSERT INTO changelogtest(id, txid, txtime)
> SELECT \$1, \$2, \$3
> EXCEPT
> SELECT (id, txid, txtime)
> FROM changelogtest
> WHERE id = \$1
> AND txid = \$2
> AND txtime = \$3;
> ENDQUERY
>
> techdb=# SELECT insert_history_info();
> ERROR: error from Perl function "insert_history_info": each EXCEPT query must have the same number of columns at line 15.> my $query = (<<ENDQUERY);Alban Hertroys
> INSERT INTO changelogtest(id, txid, txtime)
> SELECT \$1, \$2, \$3
> EXCEPT
> SELECT id, txid, txtime
> FROM changelogtest
> WHERE id = \$1
> AND txid = \$2
> AND txtime = \$3;
> ENDQUERY
--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.
!DSPAM:1050,4bd3201010417204612880!
В списке pgsql-general по дате отправления: