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

BUG #2456: How to write user defined functions in Postgress sql

From: "Vivekananda" <r(dot)vivekanandaswamy(at)yahoo(dot)co(dot)in>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2456: How to write user defined functions in Postgress sql
Date: 2006-05-26 12:42:33
Message-ID: 200605261242.k4QCgXnQ095668@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2456
Logged by:          Vivekananda
Email address:      r(dot)vivekanandaswamy(at)yahoo(dot)co(dot)in
PostgreSQL version: 8.1
Operating system:   Windows-2000
Description:        How to write user defined functions in Postgress sql
Details: 

Hai,
I have good knowledge in Oracle-Pl/sql.But,now my client wants to use
PGSQL.Now i am sending function as below.

create or replace function fun_emp(eno integer) returns varchar
as 
v_name varchar;
begin
select ename into v_name from emp where empno=eno;
return v_name;
end;
/
SQL>Select fun_emp(7788) from dual;

SQL>Fun_emp(7788)
-----------------
SMITH

It's work on Oracle-Pl/sql.
Now how can i implemnt this function in PGSQL?

Responses

pgsql-bugs by date

Next:From: William GrayDate: 2006-05-26 16:49:27
Subject: BUG #2457: Make fails at copydir.c / copydir.o
Previous:From: Jeff RossDate: 2006-05-25 21:09:45
Subject: BUG #2455: psql failing to restore a table because of a constaint violation.

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