[GENERAL] ask: select right(column) ???

2009-02-16 Thread hendra kusuma
Dear all, I have simple question I tried following code select right(column, number_of_character) from table but it didn't work, saying that pg doesn't have the function is there any way to achieve such output? honestly I have no idea that such simple feature doesn't exist in postgresql or am

[GENERAL] display array field as row

2009-02-02 Thread hendra kusuma
Dear all, Does anyone know how to display an array data into row? for exampla, I have data like this conname contype conkey kelas_pkey p {1,2} kelas_tahun f {2} And I want to to display those data above like below kelas_pkey p 1 kelas_pkey p 2 kelas_tahun f 2 Do

[GENERAL] sql syntax to replace desc

2009-01-30 Thread hendra kusuma
Dear all, I need to see my table structure complete with it's constraint (at least primary key, foreign key, not null, unique) In oracle or mysql, I usually use desc table_name to achieve such result But I find from pgsql-doc that desc isn't implemented. Does anyone know some sql syntax to do tha

Re: [GENERAL] select return case sensitive record

2008-12-05 Thread hendra kusuma
Sorry, forgot to add subject On 12/5/08, hendra kusuma <[EMAIL PROTECTED]> wrote: > Dear all, > > I create a stored function to select some row and return it as cursor. > the function receive some parameter that later I put it in where clause > But I found that selec

[GENERAL]

2008-12-05 Thread hendra kusuma
Dear all, I create a stored function to select some row and return it as cursor. the function receive some parameter that later I put it in where clause But I found that select statement runs Case Sensitive so if I have a record, for example - id -nama_pelanggan - 1 - Wira I wil get the r

[GENERAL] Serial - last value

2008-11-20 Thread hendra kusuma
Hi there a little basic question here I usually use something like this in stored function to get the last value of a serial type column select last_value into ret from id_sequence > return ret > What i'm asking is, if many people run the same stored function at the same time will they get the

[GENERAL] exception

2008-11-12 Thread hendra kusuma
Dear all, I'll have a little question here I try to catch an exception as follows CREATE OR REPLACE FUNCTION gruptambah(pnama character varying) RETURNS integer AS $BODY$ declare ret integer; begin insert into grup (nama_grup, mulai_dibuat) values (pNama, now()); select last_value into r

[GENERAL] Stored function - send array as parameter to stored function

2008-11-12 Thread hendra kusuma
Hi, I'm new here I've been doing a little self-learning about postgresql and find it very interesting I've been trying to create a stored procedure that receive array as parameter and find a good and working example on the web the code looks like this create or replace function iterate(a int[])