Skip site navigation (1) Skip section navigation (2)

How to successfully create a new function?

From: "Moon, James" <moonj(at)pbworld(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: How to successfully create a new function?
Date: 2012-03-29 23:31:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Good day!  A little help, please....

Postgresql 8.3
pgAdmin III  v.1.8.4

Creating a new function, or modifying an existing function to:

CREATE OR REPLACE FUNCTION "sp_SetScenario"(scen character varying) RETURNS void AS
               sqlStatement varchar(500);
               SET sqlStatement = 'ALTER USER postgres WITH DEFAULT_SCHEMA = $1';
COST 100;

Results in a pop-up message:

An error has occurred
ERROR:  syntax error at or near "varchar"
LINE3:  sqlStatement varchar(500);

Thank you for your time!


NOTICE: This communication and any attachments ("this message") may contain confidential information for the sole use of the intended recipient(s). Any unauthorized use, disclosure, viewing, copying, alteration, dissemination or distribution of, or reliance on this message is strictly prohibited. If you have received this message in error, or you are not an authorized recipient, please notify the sender immediately by replying to this message, delete this message and all copies from your e-mail system and destroy any printed copies.


pgsql-novice by date

Next:From: Andreas KretschmerDate: 2012-03-30 07:53:07
Subject: Re: How to successfully create a new function?
Previous:From: Alan HodgsonDate: 2012-03-29 17:25:53
Subject: Re: Disruptive corruption of data during an update

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group