[SQL] count array in postgresql

2005-03-06 Thread bandeng
hello guys,

I need some help, I have created function with argument in array.
I already try to find array function in manual but failed.
so is there any solution to counting array value and looping array value? 

some language usually use count($array)


Thank in a bunch
Ricky

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[SQL] count array in plpgsql

2005-03-06 Thread bandeng
hello guys,

I need some help, I have created function with argument in array.
I already try to find array function in manual but I cant.
so is there any solution to counting array value and looping array
value? any some language usually use
count($array)

Thank in a bunch
Ricky Wibowo

-- 
Gutten Aben Sugeng Sonten, Jangane Kurang Santen
bandeng

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [SQL] count array in postgresql

2005-03-06 Thread bandeng
my Postgresql version is 7.4

I still cannot find count function in that reference. but I try to use
like this just checking the array value is null or not, it's work but
dunno it is the good way or not.

for example, 
 vararray := {ab,cd,ef,gh}

i := 1;
while vararray[i] is not null loop
i := i + 1; 
end loop;

raise info i;



On Sun, 6 Mar 2005 12:10:55 -0700, Michael Fuhr <[EMAIL PROTECTED]> wrote:
> On Sun, Mar 06, 2005 at 11:54:15PM +0700, bandeng wrote:
> 
> > I need some help, I have created function with argument in array.
> > I already try to find array function in manual but failed.
> 
> Maybe you're looking for "Array Functions and Operators" in the
> "Functions and Operators" chapter.  You don't say what version of
> PostgreSQL you're using; here's a link to the 8.0 documentation:
> 
> http://www.postgresql.org/docs/8.0/interactive/functions-array.html
> 
> --
> Michael Fuhr
> http://www.fuhr.org/~mfuhr/
> 


-- 
Gutten Aben Sugeng Sonten, Jangane Kurang Santen
bandeng

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[SQL] view function on pg_toast

2005-03-22 Thread bandeng
hello guys,

I need help.  I have functions but it is saved to pg_toast, when I
dump the database, the function from pg_toast is not copied. so is
there any sql or syntax to view function data ?

Thanks

Ricky

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [SQL] view function on pg_toast

2005-03-23 Thread bandeng
to Michael,

We use pg manager from EMS and misstype. it should be created on
public but on pg_toast


On Wed, 23 Mar 2005 10:09:19 +0500, Mihail Nasedkin
<[EMAIL PROTECTED]> wrote:
> MN> March, 23 2005, 8:39:31:
> 
> b>> hello guys,
> 
> b>> I need help.  I have functions but it is saved to pg_toast, when I
> b>> dump the database, the function from pg_toast is not copied. so is
> b>> there any sql or syntax to view function data ?
> 
> MN> xxx:=\d pg-catalog.pg_proc
> xxx:=\d pg_catalog.pg_proc
> 
> MN> xxx:=select procsrc from pg-catalog.pg_proc where proname=... and
> MN> pronamespace=...;
> xxx:=select procsrc from pg_catalog.pg_proc where proname=... and
> pronamespace=...;
> 
> --
> Regards,
> Mihail Nasedkin     mailto:[EMAIL PROTECTED]
> 
> 


-- 
Gutten Aben Sugeng Sonten, Jangane Kurang Santen
bandeng

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[SQL] Crosstab function

2005-04-05 Thread bandeng
hello guys,

I want to use crosstab function but that function it doesnt exist. my
version is 7.3 so how do i get the tablefunc.sql from postgre contrib?
i saw in ver 8 win32 is checkable.

Thanks
Ricky

-- 
Gutten Aben Sugeng Sonten, Jangane Kurang Santen
bandeng

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [despammed] [SQL] Crosstab function

2005-04-07 Thread bandeng
I have install postgresql-contrib finally... i'm newbie in server.
I use freebsd 4.8, I saw in documentation it is said use tablefunc.sql
but in freebsd i found file tablefunc.so , it is already compiled. is
there suggestion to install tablefunc.so ?

Thank you
Ricky

On Apr 6, 2005 3:32 PM, Andreas Kretschmer <[EMAIL PROTECTED]> wrote:
> am  06.04.2005, um 13:55:35 +0700 mailte bandeng folgendes:
> > hello guys,
> >
> > I want to use crosstab function but that function it doesnt exist. my
> > version is 7.3 so how do i get the tablefunc.sql from postgre contrib?
> 
> apt-get install postgresql-contrib
> 
> Regards, Andreas
> --
> Andreas Kretschmer(Kontakt: siehe Header)
> Heynitz:  035242/47212,  D1: 0160/7141639
> GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
> ===Schollglas Unternehmensgruppe===
> 
> ---(end of broadcast)---
> TIP 7: don't forget to increase your free space map settings
> 


-- 
Gutten Aben Sugeng Sonten, Jangane Kurang Santen
bandeng

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


[SQL] postgre variable

2005-05-18 Thread bandeng
hello all,

i want to make dynamic sql query like this

select * from tb_cust where name='erick' and age='20'

to

select * from tb_cust $1

i have tried but error comeup

any suggestion?

thanks
Ricky
-- 
Gutten Aben Sugeng Sonten, Jangane Kurang Santen
bandeng

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match