Re: [SQL] An order by question

2004-02-01 Thread Michael Fuhr
> I need a little help on a sorting problem. Imagine a table, call it > records, that has fields: > > lastName > firstName > term > > I want to sort the records by last name, then first name, and finally by > term. This almost does what I want: > > select * from records order by lastName, firstN

Re: [SQL] An order by question

2004-02-01 Thread Tomasz Myrta
Dnia 2004-02-01 14:34, Użytkownik Michael Fuhr napisał: Consider storing the session in a separate field and assigning each session a value that collates in the order you want. Here's a way to order the sessions using their current format: SELECT * FROM records ORDER BY lastName, firstNam

[SQL] REPLACE

2004-02-01 Thread LawyerKill
LK I'm using Foxpro 8 and I'm trying to merge selective data from 4 different tables into a new table.The problem is that the tables are not alike, Table one may have 4 records with the name John in them, table 2 had only one John with one account # in that record, so I want to have a new table wi

[SQL] postgreSQL and Hibernate

2004-02-01 Thread beyaNet Consultancy
hi, just wanted to know whether anyone on this group uses Hibernate in conjunction with postgreSQL 7.4.1? ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] Executing dynamic queries (EXECUTE)

2004-02-01 Thread Carla Mello
Hello!   I need to execute a dynamic query and capture your result in a integer variable.   I´m using the statement "EXECUTE string", but I don´t obtain to capture the result of dynamic query.   See the example:   ==

[SQL] Postgres "dblink" Help

2004-02-01 Thread JinNet Picker
Hi, I have Two databases names 'MyDb1' and 'MyDb2' in My System. I have installed Postgres 7.4 with dblink What i need is, when ever a NEW record is inserted in 'MyDb1' , i want fire a Trigger or Rule to insert the Same Record to MyDb2 database. I am Using MAC OS 10.2 Anybody Got Idea how to d

Re: [SQL] An order by question

2004-02-01 Thread Michael Fuhr
On Sun, Feb 01, 2004 at 06:22:30PM +0100, Tomasz Myrta wrote: > Dnia 2004-02-01 14:34, U¿ytkownik Michael Fuhr napisa³: > > SELECT * > > FROM records > > ORDER BY lastName, > > firstName, > > SUBSTRING(term FROM 1 FOR 4), > > CASE SUBSTRING(term FROM 5) > >WHE

Re: [SQL] Executing dynamic queries (EXECUTE)

2004-02-01 Thread Tomasz Myrta
Dnia 2004-01-27 16:25, Użytkownik Carla Mello napisał: Hello! I need to execute a dynamic query and capture your result in a integer variable. I´m using the statement "EXECUTE string", but I don´t obtain to capture the result of dynamic query. v_count:= EXE

[SQL] update more than 1 table (mysql to postgres)

2004-02-01 Thread treeml
I am migrating from MySQL to Postagres. I have problem with postgres updating 2 tables with one statement. In MySQL I can update 2 tables (parent, child) with a statement like this UPDATE parent LEFT JOIN child ON parent.pid = child.foreign_key SET parent.field1 = 'company', child.field2 = 'john'

[SQL] Help! Error with postgresql!

2004-02-01 Thread raingsey
Hello, I have problem when i execute the .sql file in my psql command prompt. The error code is below: pylori=# \i log-clinique.sql CREATE psql:log-clinique.sql:100: ERROR:  parser: parse error at or near ".3" psql:log-clinique.sql:107: ERROR:  parser: parse error at or near ".3" psql:log-cliniqu

Re: [SQL] Help! Error with postgresql!

2004-02-01 Thread Paul Hart
Would you mind telling us what's in your SQL file? it seems that there's a problem in it. On 28 Jan 2004, at 05:12, [EMAIL PROTECTED] wrote: Hello, I have problem when i execute the .sql file in my psql command prompt. The error code is below: pylori=# \i log-clinique.sql CREATE psql:log-cliniqu

Re: [SQL] [PERFORM] Set-Returning Functions WAS: On the performance of

2004-02-01 Thread Bill Moran
Josh Berkus wrote: Bill, First off: discussion moved to the SQL list, where it really belongs. True, it started out as [PERFORM], but is no longer. Well, I would have agreed with the uselessness, until this project. The "source of endless debugging" frightens me! Well, the last time I tried to

[SQL]

2004-02-01 Thread MUKTA
Hi! I want to insert values into a table using the C syscalls provided by the libpq library, but i find that i cant insert into the table when i use variables instead of values...like so: int a,b,c,d; using the C function   res=PQexecute(Conn,"INSERT into table values(a,b,c,d));   Is the

Re: [SQL] [PERFORM] Set-Returning Functions WAS: On the performance of

2004-02-01 Thread Bill Moran
Josh Berkus wrote: Bill, I don't understand at all. If I do "SELECT * FROM set_returning_function()" and all I'm going to do is iterate through the columns and rows, adding them to a two dimensional array that will be marshalled as a SOAP message, what about not knowing the nature of the return s

Re: [SQL] update more than 1 table (mysql to postgres)

2004-02-01 Thread postgres
On Fri, 30 Jan 2004, treeml wrote: > I am migrating from MySQL to Postagres. I have problem with postgres > updating 2 tables with one statement. > > In MySQL I can update 2 tables (parent, child) with a statement like this > > UPDATE parent LEFT JOIN child ON parent.pid = child.foreign_key SET

Re: [SQL] update more than 1 table (mysql to postgres)

2004-02-01 Thread Christopher Browne
Oops! [EMAIL PROTECTED] ("treeml") was seen spray-painting on a wall: > I am migrating from MySQL to Postagres. I have problem with postgres > updating 2 tables with one statement. > > In MySQL I can update 2 tables (parent, child) with a statement like this > > UPDATE parent LEFT JOIN child ON par

Re: [SQL] update more than 1 table (mysql to postgres)

2004-02-01 Thread Tom Lane
>> In MySQL I can update 2 tables (parent, child) with a statement like this >> >> UPDATE parent LEFT JOIN child ON parent.pid = child.foreign_key SET >> parent.field1 = 'company', >> child.field2 = 'john' >> WHERE child.pid = 7 One has to wonder what the above construction is even intended to me