[SQL] How do i return a dataset from a stored procedure

2002-07-05 Thread teknokrat
I can't figure out how to return a group of rows from a function written in plpgsql (or plsql for that matter). The only way i have seen it done is with a setof table return value in sql. But since the query was a single select anyway i don't see the point of this. Is there a way of creating a tem

Re: [SQL] How do i return a dataset from a stored procedure

2002-07-05 Thread Stephan Szabo
On 5 Jul 2002, teknokrat wrote: > I can't figure out how to return a group of rows from a function > written in plpgsql (or plsql for that matter). The only way i have > seen it done is with a setof table return value in sql. But since the > query was a single select anyway i don't see the point

Re: [SQL] How do i return a dataset from a stored procedure

2002-07-05 Thread Roberto Mello
On Fri, Jul 05, 2002 at 01:32:33AM -0700, teknokrat wrote: > I can't figure out how to return a group of rows from a function > written in plpgsql (or plsql for that matter). The only way i have > seen it done is with a setof table return value in sql. But since the > query was a single select any

[SQL] i18n in pgSQL

2002-07-05 Thread Vernon Wu
Hi, I am working on an application intended for multilingual users. I have learnt from a source that I shall define double-byte data type such as nvarchar and ntext in DB. I don't see these data type in the pgsql online document. I have tried to create a table with the data type. The nvarcha

Re: [SQL] Possible Bug regarding temp tables (sql or psql?)

2002-07-05 Thread Bruce Momjian
It works, but only in CVS, not in 7.2.X. Marking something as done in TODO only means it is done and will be in the _next_ release. Sorry. --- Mark Frazer wrote: > > > Bruce Momjian <[EMAIL PROTECTED]> [02/07/04 22:10]:

Re: [SQL] Selecting data from a table created in another database...

2002-07-05 Thread Ligia Pimentel
Thanks. "Rudi Starcevic" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi Ligia, > > When I need to do this I use a scripting language like PHP, Perl or > ColdFusion to > select from one db and insert into another. > As a matter of fact I had to do this exerci

[SQL] algoritme

2002-07-05 Thread stephane
I have a question : I don't know if in a postgres database, it is interisting to create an index for a time stamp champ, Information : data are inerted in a chronological order. thanks Stephane -- Dubreuil Stephane [EMAIL PROTECTED] ---(end of broadcast)--

Re: [SQL] how to use nextval()

2002-07-05 Thread Stephane Schildknecht
Le ven 05/07/2002 à 14:03, [EMAIL PROTECTED] a écrit : > Hello there > > I have an idea how to solve my problem on copy a record to a new one in the > same table. To do so I need the next value for the primary key. > > Using : > > select nextval('pk_auftrag') as nextkey from auftrag; > > I get

Re: [SQL] Can this be done with sql?

2002-07-05 Thread teknokrat
""Rajesh Kumar Mallah."" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi , > > you can use GROUP BY , at the expense of adding one more column of SERIAL d= > ata type, > > say, > > select * from t_a limit 10; > access_log=3D# SELECT * from t_a limit 15; >

Re: [SQL] sql statement how to do ?

2002-07-05 Thread Manfred Koizar
On Fri, 5 Jul 2002 09:03:38 + (UTC), [EMAIL PROTECTED] wrote: >INSERT INTO auftrag (SELECT * FROM auftrag where a_id = '12345'); > >The problem is, that the table auftrag has a primay key called pk_auftrag. >Do this I get an error regarding duplicate pk_auftrag. Is there a way to >spare pk_auf

Re: [SQL] Selecting data from a table created in another database...

2002-07-05 Thread Chantal Ackermann
hi Ligia, there was a posting to this list some time ago, about the same question. I just found it as I had the same question as you: http://archives.postgresql.org/pgsql-sql/1998-05/msg00091.php (in short: it is not possible in Postgres) the mail is from 1998, but I just tried to make a sele

[SQL] Is Dropping a column "CHECK" constraint possible?

2002-07-05 Thread Rajesh Kumar Mallah.
Hi Folks , can anyone please help? i have a to drop a check contstraint from a column. eg tradein_clients=# \d t_a Table "t_a" Column | Type | Modifiers +-+--- company_id | integer | exp| text| imp| text| Check constraint

[SQL] how to use nextval()

2002-07-05 Thread juerg . rietmann
Hello there I have an idea how to solve my problem on copy a record to a new one in the same table. To do so I need the next value for the primary key. Using : select nextval('pk_auftrag') as nextkey from auftrag; I get an error like : Relation pk_auftrag does not exist ! Thanks for any help

Re: [SQL] Possible Bug regarding temp tables (sql or psql?)

2002-07-05 Thread Mark Frazer
Bruce Momjian <[EMAIL PROTECTED]> [02/07/04 22:10]: > > TODO has: > > * Allow psql \d to show temporary table structure > > Looks like it works fine now with schemas: > > I will mark the TODO as done. It doesn't work with select into though: config=> select 5 into temp v_tmp ;

Re: [SQL] Boolean to int

2002-07-05 Thread Stephane Schildknecht
Le jeu 04/07/2002 à 23:32, Arjen van der Meijden a écrit : > How about this hint in the postgresql-manual: > >"Tip: Values of the boolean type cannot be cast directly to other > types (e.g., CAST (boolval AS integer) does not work). This can be > accomplished using the CASE expression: CAS

Re: [SQL] How do i return a dataset from a stored procedure

2002-07-05 Thread Bruce Momjian
Roberto Mello wrote: > On Fri, Jul 05, 2002 at 01:32:33AM -0700, teknokrat wrote: > > I can't figure out how to return a group of rows from a function > > written in plpgsql (or plsql for that matter). The only way i have > > seen it done is with a setof table return value in sql. But since the >

Re: [SQL] Is Dropping a column "CHECK" constraint possible?

2002-07-05 Thread Christopher Kings-Lynne
> can anyone please help? > i have a to drop a check contstraint from a column. eg > > tradein_clients=# \d t_a >Table "t_a" >Column | Type | Modifiers > +-+--- > company_id | integer | > exp| text| > imp| text| > Check

Re: [SQL] Is Dropping a column "CHECK" constraint possible?

2002-07-05 Thread Rajesh Kumar Mallah.
Yup it did!. Thanks a ton, it was there in the ALTER TABLE documentation i overlooked :-( regds mallah. On Saturday 06 July 2002 10:05, Christopher Kings-Lynne wrote: > > can anyone please help? > > i have a to drop a check contstraint from a column. eg > > > > tradein_clients=# \d t_a > >