Re: [SQL] in PlPgSQL function, how to use variable in a "select ...

2006-03-17 Thread Robert Treat
On Friday 17 March 2006 15:33, Emi Lu wrote: > >>Does not work either, the whole function is: > >> > >>create table t1(col1 varchar(3), col2 varchar(100)); > >>insert into t1 values('001', 'Result 1'); > >>insert into t1 values('002', 'Result 2'); > >>insert into t1 values('003', 'Result 3'); > >>

Re: [SQL] in PlPgSQL function, how to use variable in a "select ...

2006-03-17 Thread Emi Lu
Does not work either, the whole function is: create table t1(col1 varchar(3), col2 varchar(100)); insert into t1 values('001', 'Result 1'); insert into t1 values('002', 'Result 2'); insert into t1 values('003', 'Result 3'); CREATE OR REPLACE FUNCTION test(VARCHAR) RETURNS VARCHAR AS $$ DECLARE

Re: [SQL] in PlPgSQL function, how to use variable in a "select ...

2006-03-17 Thread A. Kretschmer
am 17.03.2006, um 14:23:57 -0500 mailte Emi Lu folgendes: > Does not work either, the whole function is: > > create table t1(col1 varchar(3), col2 varchar(100)); > insert into t1 values('001', 'Result 1'); > insert into t1 values('002', 'Result 2'); > insert into t1 values('003', 'Result 3'); >

Re: [SQL] in PlPgSQL function, how to use variable in a "select ...

2006-03-17 Thread Emi Lu
Does not work either, the whole function is: create table t1(col1 varchar(3), col2 varchar(100)); insert into t1 values('001', 'Result 1'); insert into t1 values('002', 'Result 2'); insert into t1 values('003', 'Result 3'); CREATE OR REPLACE FUNCTION test(VARCHAR) RETURNS VARCHAR AS $$ DECLARE

[SQL] in PlPgSQL function, how to use variable in a "select ... into .. where " query

2006-03-17 Thread Emi Lu
Hello, In pl/pgsql (postgresql 8.01), how to use variables in select .. into .. command CREATE OR REPLACE FUNCTION test(VARCHAR) RETURNS VARCHAR AS $$ DECLARE var1 ALIAS FOR $1; cm_tableName tableA.col1%TYPE; T1