pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SQL-Programmer tool and field%type support
4+ messages / 4 participants
[nested] [flat]

* SQL-Programmer tool and field%type support
@ 2001-10-05 13:37  Mourad EL HADJ MIMOUNE <mimoune@ensma.fr>
  0 siblings, 1 reply; 4+ messages in thread

From: Mourad EL HADJ MIMOUNE @ 2001-10-05 13:37 UTC (permalink / raw)
  To: pgsql-sql

 Hi,
 I'm looking for PL/SQL programmer tool. I wanted to use SQL-Programmer but
it
 doesn't support Postgres data base.
 Please can sommeone suggest me an other tool wich can replace this one or
 explaine me how we can use SQLProgrammer with Postgres if it is possible.
I have an other question about the use of %type and alias in PL/SQL.  So the
excution of functions containing varibales of type maytable.field1%type
prompts parser errors.
error on the creation of the function :
create function test (int) returns maytable.field1%type as' ...

 parser: parse error at or near "."

error on the excution of the function :
create function test (int) returns int as'
declare
var1 maytable.field1%type;
var2 alias for $1;  ....

 parser: parse error at or near '%'
parser: parse error at or near "$1"

Please help me.
 Thanks.
 Mourad.





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: SQL-Programmer tool and field%type support
@ 2001-10-08 18:09  Roberto Mello <rmello@cc.usu.edu>
  parent: Mourad EL HADJ MIMOUNE <mimoune@ensma.fr>
  0 siblings, 1 reply; 4+ messages in thread

From: Roberto Mello @ 2001-10-08 18:09 UTC (permalink / raw)
  To: Mourad EL HADJ MIMOUNE <mimoune@ensma.fr>; +Cc: pgsql-sql

On Fri, Oct 05, 2001 at 03:37:14PM +0200, Mourad EL HADJ MIMOUNE wrote:
>  Hi,
>  I'm looking for PL/SQL programmer tool. I wanted to use SQL-Programmer but
> it
>  doesn't support Postgres data base.
>  Please can sommeone suggest me an other tool wich can replace this one or
>  explaine me how we can use SQLProgrammer with Postgres if it is possible.

	I don't know such tool.
	The documentation has some advices on tools/ways to program in
PL/pgSQL.

> I have an other question about the use of %type and alias in PL/SQL.  So the
> excution of functions containing varibales of type maytable.field1%type
> prompts parser errors.
> error on the creation of the function :
> create function test (int) returns maytable.field1%type as' ...

	This syntax is not supported in PG 7.1. AFAIK, it will be supported in
PG 7.2.
	You can use function overloading if you need the same function to
return different types.
	
	-Roberto
-- 
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+
  Roberto Mello - Computer Science, USU - http://www.brasileiro.net 
       http://www.sdl.usu.edu - Space Dynamics Lab, Developer    
Information is the greatest weapon of power to the modern wizard.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: SQL-Programmer tool and field%type support
@ 2001-10-08 23:08  Josh Berkus <josh@agliodbs.com>
  parent: Roberto Mello <rmello@cc.usu.edu>
  0 siblings, 1 reply; 4+ messages in thread

From: Josh Berkus @ 2001-10-08 23:08 UTC (permalink / raw)
  To: Roberto Mello <rmello@cc.usu.edu>; Mourad EL HADJ MIMOUNE <mimoune@ensma.fr>; +Cc: pgsql-sql

Mourad,

> > I have an other question about the use of %type and alias in
> PL/SQL.  So the
> > excution of functions containing varibales of type
> maytable.field1%type
> > prompts parser errors.
> > error on the creation of the function :
> > create function test (int) returns maytable.field1%type as' ...

What Roberto is saying is that the declaration:

DECLARE
v_field1 mytable.field1%type

is supported internal to a PL/pgSQL function, but

CREATE FUNCTION test1(int) RETURNS mytable.filed1%type 

is not.  This is because the %type declaration is supported in PL/pgSQL,
but not in Postgres SQL.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: SQL-Programmer tool and field%type support
@ 2001-10-09 04:34  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Josh Berkus <josh@agliodbs.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2001-10-09 04:34 UTC (permalink / raw)
  To: Josh Berkus <josh@agliodbs.com>; +Cc: Roberto Mello <rmello@cc.usu.edu>; Mourad EL HADJ MIMOUNE <mimoune@ensma.fr>; pgsql-sql

"Josh Berkus" <josh@agliodbs.com> writes:
> DECLARE
> v_field1 mytable.field1%type
> is supported internal to a PL/pgSQL function, but
> CREATE FUNCTION test1(int) RETURNS mytable.filed1%type 
> is not.  This is because the %type declaration is supported in PL/pgSQL,
> but not in Postgres SQL.

It does work in 7.2devel, however ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2001-10-09 04:34 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-10-05 13:37 SQL-Programmer tool and field%type support Mourad EL HADJ MIMOUNE <mimoune@ensma.fr>
2001-10-08 18:09 ` Roberto Mello <rmello@cc.usu.edu>
2001-10-08 23:08   ` Josh Berkus <josh@agliodbs.com>
2001-10-09 04:34     ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox