How do you call your function? You should call it like this:
SELECT * FROM seach_password('Flavio');
Replace Flavio with the login of someone in table_user.
Also watch out for the function name: if you copied my suggestion it is
seach_... and not search_...
I would also suggest you replace the
Could it be that the insert statement itself is the problem? What does the
table look like?
Edward W. Rouse
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bart Degryse
Sent: Tuesday, February 26, 2008 11:35 AM
To: pgsql-sql@postgresql.org; Shavonn
Hi
After I did it I received it
ERROR: set-valued function called in context that cannot accept a set
SQL state: 0A000
Context: PL/pgSQL function "seach_password(" line 14 at return next
Error at WHERE login= USER_FOO ??
Thanks for your help
Flávio
2008/2/26, Bart Degryse <[EMAIL PROTECTED]>:
On Tue, Feb 26, 2008 at 11:36 AM, Shavonne Marietta Wijesinghe
<[EMAIL PROTECTED]> wrote:
> BEGIN
> SAVEPOINT s1;
> ... code here ...
> EXCEPTION
> WHEN ... THEN
> ROLLBACK TO s1;
> ... code here ...
> WHEN ... THEN
> ROLLB
Shavonne Marietta Wijesinghe wrote:
> I wrote the query in the SQL windows provided by the pgadmin.
That SQL window only executes SQL, so you can't use PL/pgSQL commands on
it. PL/pgSQL can only be used in the context of a PL/pgSQL function, so
you need to do CREATE FUNCTION to do that.
If you w
I think you have a quoting problem
You want something like
WHERE login= 'Flavo'
But you're making something like
WHERE login = Flavo
Something like this should work...
CREATE OR REPLACE FUNCTION seach_password(USER_FOO IN
table_user.login%TYPE)
RETURNS SETOF vw_change_password AS
$BODY$
DECL
Hi Colin
When I translated from Portuguese to English I forgot a letter, but using
the corrected name I received an error.
2008/2/26, Colin Wetherbee <[EMAIL PROTECTED]>:
>
> Professor Flávio Brito wrote:
> > When I Test my view I receive
> >
> > SELECT seach_password('user_login_foo')
>
> [
I wrote the query in the SQL windows provided by the pgadmin.
According to the examples in "Chapter 35. PL/pgSQL - SQL Procedural
Language" i don't see what i did different.
BEGIN
SAVEPOINT s1;
... code here ...
EXCEPTION
WHEN ... THEN
ROLLBACK TO s1;
Professor Flávio Brito wrote:
When I Test my view I receive
SELECT seach_password('user_login_foo')
[...]
ERROR: column "user_login_foo" does not exist
SQL state: 42703
Context: PL/pgSQL function "search_password" line 14 at for over execute
statement
seach_password and
search_password are
Shavonne,
You will probably always find someone on the list who will answer your
questions, but you really should read the manual too!
In this case you could have found the answer by reading
http://www.postgresql.org/docs/8.2/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
>>> "Shav
Hi
Don't know why I can't receive a return like my view fields (I'm newbie in
plpgsql). Postgresql returns me a erro . How can I received a answer like my
view structure?
When I Test my view I receive
SELECT seach_password('user_login_foo')
My view returns me
25746;"MARCELO ";"bio1";"bio1";"2
On Tuesday 26 February 2008, Andrew Sullivan wrote:
> Well, except that there's no "EXCEPTION" statement in SQL? I think
> your correspondent was intending for this to be programmatic.
I was thinking pl/pgsql.
Teemu
---(end of broadcast)---
TIP
On Tue, Feb 26, 2008 at 05:05:01PM +0100, Shavonne Marietta Wijesinghe wrote:
> Thank you. I tried as you said. But i get a ERROR: syntax error at or near
> "INSERT" at character 9
> I don't see anything wrong with the code..
Well, except that there's no "EXCEPTION" statement in SQL? I think
Thank you. I tried as you said. But i get a ERROR: syntax error at or near
"INSERT" at character 9
BEGIN
INSERT INTO my_shevi values ('a', 4, 2, 2);
EXCEPTION
WHEN unique_violation THEN
INSERT INTO my_shevi values ('a', 5, 2, 2);
END;
I don't see anything wrong with the code..
Shavonne
-
On Tuesday 26 February 2008, Shavonne Marietta Wijesinghe wrote:
> During an "INSERT INTO" I get an "Error - duplicate key violates
> unique constraint"
>
> Is there any way, that i can test the error. Something like this??
>
> IF error = "duplicate key violates unique constraint" then
> do
Hello
During an "INSERT INTO" I get an "Error - duplicate key violates unique
constraint"
Is there any way, that i can test the error. Something like this??
IF error = "duplicate key violates unique constraint" then
do something
else
insert into
end if
Thanks
Shavonne
I've been running PostgreSQL on a virtual server for
several years now. I'm using VMWare with a Windows
host and Linux guest. I've configured it to let Linux
use a raw partition as a disk. Before I used a
separate partition, the virtual disk had been a
Windows file. Using the disk partition in
17 matches
Mail list logo