Minor systax error but not able to resolve it...

From: dipti shah <shahdipti1980(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Minor systax error but not able to resolve it...
Date: 2010-02-23 11:25:52
Message-ID: d5b05a951002230325u73a483c9j677d6d0a701ffae2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

Hi, could anyone please help me to sort out below error. I have spent lot of
time but couldn't resolved it.

mydb=> CREATE OR REPLACE FUNCTION test_create()
RETURNS void AS
$BODY$
$cmd = "CREATE TABLE test-table(col varchar not null);";
spi_exec_query("CREATE OR REPLACE FUNCTION my_tmp_func() RETURNS void AS
$cmd LANGUAGE sql;");
$BODY$
LANGUAGE 'plperl';
CREATE FUNCTION
mydb=> SELECT test_create();
ERROR: error from Perl function "test_create": syntax error at or near
"CREATE" at line 3.
mydb=>

I want to create function from my stored procedure in any language.

Thanks,
Dipti

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stefan Schwarzer 2010-02-23 11:44:06 Subqueries or Joins? Problems with multiple table query
Previous Message Iñigo Martinez Lasala 2010-02-23 11:03:01 Re: how do I do dump and restore without bugging with constraint?

Browse pgsql-novice by date

  From Date Subject
Next Message Richard Huxton 2010-02-23 11:55:15 Re: Minor systax error but not able to resolve it...
Previous Message dipti shah 2010-02-23 09:58:16 Re: SET Role doesn't work from Security Definer Function...