Re: [GENERAL] Minor systax error but not able to resolve it...
| От | dipti shah | 
|---|---|
| Тема | Re: [GENERAL] Minor systax error but not able to resolve it... | 
| Дата | |
| Msg-id | d5b05a951002232138l689ff213wb53401b9df5030a8@mail.gmail.com обсуждение исходный текст | 
| Ответ на | Minor systax error but not able to resolve it... (dipti shah <shahdipti1980@gmail.com>) | 
| Список | pgsql-novice | 
		
			Wonderful! Thanks.
		
	
	
On Wed, Feb 24, 2010 at 2:03 AM, Richard Huxton <dev@archonet.com> wrote:
On 23/02/10 17:15, dipti shah wrote:The function "myfunc" you are trying to create as plperl isn't perl. Either give it some perl or try "LANGUAGE SQL".Thanks. Putting $cmd in single quote resolve the error but it generated
other error. :(
mydb=> CREATE OR REPLACE FUNCTION test_create()
RETURNS void AS
$BODY$
$cmd = "CREATE TABLE testtable(col varchar not null);";
spi_exec_query("CREATE OR REPLACE FUNCTION myfunc() RETURNS void AS
'$cmd'LANGUAGE plperl;");
spi_exec_query("SELECT myfunc();");
$BODY$
LANGUAGE 'plperl';
CREATE FUNCTION
mydb=> SELECT test_create();
ERROR: error from Perl function "test_create": error from Perl function
"myfunc": Can't locate object method "col" via package "varchar" (perhaps
you forgot to load "varchar"?) at line 1. at line 3.
--
Richard Huxton
Archonet Ltd
В списке pgsql-novice по дате отправления: