RE: [GENERAL] Re: [SQL] oracle rownum equivalent?

2000-06-07 Thread Hiroshi Inoue
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > Behalf Of Ed Loehr > > mikeo wrote: > > > > thanks for the response. oid is equivalent to oracle rowid. IMHO,tid is equivalent to Oracle's rowid. > > rownum can be used similar to the limit option of select in

Re: [SQL] counting distinct values

2000-06-07 Thread Joseph Shraibman
Tom Lane wrote: > > Joseph Shraibman <[EMAIL PROTECTED]> writes: > Using the example from > http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I > do if I wanted to know the number of different cities where I had a > friend in each state? select count(city)

Re: [SQL] counting distinct values

2000-06-07 Thread Tom Lane
Joseph Shraibman <[EMAIL PROTECTED]> writes: Using the example from http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I do if I wanted to know the number of different cities where I had a friend in each state? select count(city) group by state; would not wor

Re: [SQL] how to know when a table is altered

2000-06-07 Thread Ed Loehr
Vincenzo Passoli wrote: > > 3.SQL does't have a TRIGGER on this 'event' (CREATE TRIGGER mytrig ON > mytable FOR ALTER AS ...). Can be Added ? I don't know. Maybe someone else does (though I think pgsql-sql is very low volume...pgsql-general would get a lot more readers). > 4.May be beautiful

Re: [SQL] counting distinct values

2000-06-07 Thread Joseph Shraibman
Bruce Momjian wrote: > > > Using the example from > > http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I > > do if I wanted to know the number of different cities where I had a > > friend in each state? select count(city) group by state; would not work > > because if you had

[SQL] References and privileges

2000-06-07 Thread Kyle Bateman
[EMAIL PROTECTED] (Jan Wieck) writes: >> If one does: >> >> [...] >> grant select on master to a_user; >> grant select, insert, update, delete on detail to a_user; >> >> then if login as "a_user" and does: >> >> insert into detail (id, master_id) values (1, 10); >> >> this will result in: "ERROR:

Re: [SQL] counting distinct values

2000-06-07 Thread Bruce Momjian
> Using the example from > http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I > do if I wanted to know the number of different cities where I had a > friend in each state? select count(city) group by state; would not work > because if you had two friends in the same city it wo

RE: [SQL] Problem with subquery in CHECK constraint.

2000-06-07 Thread Hiroshi Inoue
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf > Of Tom Lane > > Niall Smart <[EMAIL PROTECTED]> writes: > > However when trying to insert into CUST I get the following error: > > ERROR: ExecEvalExpr: unknown expression type 108 > > Is this a bu

[SQL] Fetch an element in an array

2000-06-07 Thread Bernie Huang
Hi, This is more of a PHP problem, but I wish if someone knows this can help me. How do I fetch an element in a Postgres array? I have a table like employee col1 int4 col2 text[] now I used the php api $row = pg_fetch_array($exec, 0); which gives me the following: echo $row['col2'

RE: Re: [SQL] how to know when a table is altered

2000-06-07 Thread Vincenzo Passoli
hello Ed Loehr, 1.your solution (table-based caching) is very close to my actual thinking. 2.Another problem is the 'alter table' command. 3.SQL does't have a TRIGGER on this 'event' (CREATE TRIGGER mytrig ON mytable FOR ALTER AS ...). Can be Added ? 4.May be beautiful if the db tells to the

[SQL] counting distinct values

2000-06-07 Thread Joseph Shraibman
Using the example from http://www.postgresql.org/docs/aw_pgsql_book/node59.html, what would I do if I wanted to know the number of different cities where I had a friend in each state? select count(city) group by state; would not work because if you had two friends in the same city it would be cou

[SQL]

2000-06-07 Thread Steffers
Reply-To: [EMAIL PROTECTED] Subject: Re: [SQL] how to know when a table is altered X-Mailer: NeoMail 0.95 X-IPAddress: 204.148.73.2 Ed wrote: > Vincenzo Passoli wrote: > > i'm developing a framework (mod_perl+apache) that reads the db-schema and > > explode html forms. > > my problem is to recogn

Re: [SQL] oracle rownum equivalent?

2000-06-07 Thread mikeo
thanks for the response. oid is equivalent to oracle rowid. rownum can be used similar to the limit option of select in postgres but in oracle it can also be used in a where clause, or as an assigment in an update statement for instance. eg: update ctmaster set bsc_id = mod(rownum,3) +1; th

Re: [SQL] how to know when a table is altered

2000-06-07 Thread Ed Loehr
Ed Loehr wrote: > > Vincenzo Passoli wrote: > > > > i'm developing a framework (mod_perl+apache) that reads the db-schema and > > explode html forms. > > > > now i read the schema and cache it into perl-hashes to speedup things. > > > > my problem is to recognise when a table is altered so that t

Re: [SQL] Problem with subquery in CHECK constraint.

2000-06-07 Thread Tom Lane
Niall Smart <[EMAIL PROTECTED]> writes: > However when trying to insert into CUST I get the following error: > ERROR: ExecEvalExpr: unknown expression type 108 > Is this a bug in PostGreSQL? Yup. Looks like the subquery is not getting expanded into a subplan. Could be a little messy to

Re: [SQL] oracle rownum equivalent?

2000-06-07 Thread Ed Loehr
mikeo wrote: > > thanks for the response. oid is equivalent to oracle rowid. > rownum can be used similar to the limit option of select in postgres > but in oracle it can also be used in a where clause, or as an assigment > in an update statement for instance. > > eg: update ctmaster set bsc_id

[SQL] Please ignore [PSQL and PHP]

2000-06-07 Thread Bernie Huang
Hello, Never mind the last email subjected "PSQL and PHP". I found the bug. In PHP script, instead of using insert into employee values ( 'Bernie', '{$phone, $fax, ...}' ); or insert into employee values ( 'Bernie', '{"$phone", "$fax", ...}' ); or any other possible combo, I

Re: [SQL] how to know when a table is altered

2000-06-07 Thread Ed Loehr
Vincenzo Passoli wrote: > > i'm developing a framework (mod_perl+apache) that reads the db-schema and > explode html forms. > > now i read the schema and cache it into perl-hashes to speedup things. > > my problem is to recognise when a table is altered so that the framework can > update the re

[SQL] Temp table and loop call from one session

2000-06-07 Thread Dmitriy Yusupov
Hi all! I try to do: PL function 1 loop: call PL function 2 PL function 2 create temp table ... ... drop temp table But drop can't work in one session! It's docu

[SQL] Problem with subquery in CHECK constraint.

2000-06-07 Thread Niall Smart
Hi, I'm using a general lookup table defined as following to avoid a proliferation of lookup tables: CREATE TABLE XREF ( XREF_GROUP VARCHAR(12) NOT NULL, XREF_CD VARCHAR(8) NOT NULL, XREF_VALUE VARCHAR(128), PRIMARY KEY (XREF_GROUP, XRE

Re: [SQL] sql doubts

2000-06-07 Thread Frank G Hahn
On Wed, 7 Jun 2000, Gustavo Henrique wrote: Ad 1) SQL = Structured Query Language :) TSQL is an extention of SQL that includes support for queries against temporal databases. VALID/TRANSACTION TIME and SEQUENCED/NONSEQUENCED queries. If you would like more info on temporal databases try ht

Re: [SQL] oracle rownum equivalent?

2000-06-07 Thread Ed Loehr
mikeo wrote: > > is there an equivalent to rownum in oracle? > > also, where can one find reference to "hidden columns" > such as OID or, as in oracle, rownum? oid is the equivalent. not sure documentation exists for these... Regards, Ed Loehr

[SQL] how to know when a table is altered

2000-06-07 Thread Vincenzo Passoli
i'm developing a framework (mod_perl+apache) that reads the db-schema and explode html forms. now i read the schema and cache it into perl-hashes to speedup things. my problem is to recognise when a table is altered so that the framework can update the related forms connected to the db tables.

[SQL] oracle rownum equivalent?

2000-06-07 Thread mikeo
is there an equivalent to rownum in oracle? also, where can one find reference to "hidden columns" such as OID or, as in oracle, rownum? thanks, mikeo

[SQL] sql doubts

2000-06-07 Thread Gustavo Henrique
Could you help me ? 1- Whats the diference between TSQL and SQL ? 2- What are nested queries ? 3- I've seen people using DISTINCT, but what's ALL used for ? Thanks very much for your attention, Gustavo Henrique Maultasch [EMAIL PROTECTED]