Re: [SQL] Help With complex join

2005-07-14 Thread Gnanavel S
On 14 Jul 2005 14:34:02 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:Hi all, got a question as how to approach a somewhat complicated join query.  The deal is I have three tables called attorney, lawOffice, andlaw_office_employment.  The attorney and lawOffice tables hold attorneyand lawOffi

Re: [SQL] Possible to use a table to tell what table to select from?

2005-07-14 Thread Frank Hagstrom
On 7/14/05, Richard Huxton wrote: > Frank Hagstrom wrote: > > Hello > > > > I've been thinking on a potential problem I might get in a distant > > future, but once I started thinking on it I just as well had to > > check... > > > > Is it possible to have say ~ 6 tables, where the first one is a >

[SQL] Error on dynamic code.

2005-07-14 Thread Mark J Camilleri
I am trying to write a dynamic trigger function on insert operations so that the same function can be used across all my tables.  In this case my tables are ‘test’ and ‘test_a’ (my convention is that all audit table names are the name of the original table concatenated with ‘_a’).  Below is

[SQL] Help With complex join

2005-07-14 Thread spinto
Hi all, got a question as how to approach a somewhat complicated join query. The deal is I have three tables called attorney, lawOffice, and law_office_employment. The attorney and lawOffice tables hold attorney and lawOffice information respectively (obviously). The law_office_employment table

[SQL] [postgres] Betrifft: Datumsfeld leer lassen

2005-07-14 Thread marco_0160
--- In [EMAIL PROTECTED], Stefan Miefert <[EMAIL PROTECTED]> schrieb: > Hallo, > > was muss ich angeben wenn ich ein undefiniertes Datumsfeld schreiben möchte > > Wenn ic datum ='' angebe meckert er:) Bin zwar selber noch DAU, aber Tipp eins: - mit ALTER TABLE tabelle COLUMN date SET NULL;

[SQL] difference between all RDBMSs

2005-07-14 Thread Dhanashree
hello sir,     i m an engineering student and i m looking out for differrences between oracle v/s sybase v/s sql v/s plsql v/s mysql with respect to the following points 1. rdbms 2. data independence 3. support of plsql 4. integrity 5. security 6. use and application  7. support to thirdparty pro

[SQL] Yearly Archival System Using PostgreSQL

2005-07-14 Thread Vivek
I am developing a database system using PostgreSQL in which I should be able to delete redundant records once a year (Time specified by the user). THe redundant records should be inserted into the archive table which is part of the same database. Is this possible in pgsql? Can I program a functio

[SQL] How to obtain the list of data table name only

2005-07-14 Thread sunny076
Hi, I am wondering if anyone can tell me how I can obtain only the list of data table in postgresql without function and other ancillary tables. I hope that I can add a tag that can filter only data table. I am using the following SQL Statement: "SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SC

[SQL] problem (bug?) with "in (subquery)"

2005-07-14 Thread Luca Pireddu
I have the following query that isn't behaving like I would expect: select * from strains s where s.id in (select strain_id from pathway_strains); I would expect each strain record to appear only once. Instead I get output like this, where the same strain id appears many times: id | na

Re: [SQL] getting back autonumber just inserted

2005-07-14 Thread Bruno Wolff III
On Thu, Jul 07, 2005 at 14:47:23 -0600, Larry Meadors <[EMAIL PROTECTED]> wrote: > If you have a trigger on your table that inserts a record in a table > and shares the same sequence, what value do you get back, the > triggered curval, or the currently inserted one? Whichever one was done second

Re: [SQL] Possible to use a table to tell what table to select from?

2005-07-14 Thread Richard Huxton
Frank Hagstrom wrote: Hello I've been thinking on a potential problem I might get in a distant future, but once I started thinking on it I just as well had to check... Is it possible to have say ~ 6 tables, where the first one is a 'reference' to all the others (they all are with the same struc

Re: [SQL] function parameters : bug?

2005-07-14 Thread Richard Huxton
Richard Hayward wrote: pg 8.0.3 This behaviour seems odd to me: CREATE TABLE mytable ( inta INTEGER ); CREATE OR REPLACE FUNCTION myfunction (inta integer) RETURNS integer AS $body$ begin insert into mytable(inta) values (inta); ERROR: syntax error at or near "$1" at character 22 QU