Re: [SQL] Query Problem from FoxPro???

2007-07-03 Thread dBHS Jakarta
Dear All, It turns out that, column "is_pilih" was written with "Is_Pilih". PostgreSQL column name is case sensitive! After I change the column name to "is_pilih" everything's showed up! Another NEW Question arose: "Why the is_pilih data type become Character when it displayed in VFP?" Anybod

Re: [SQL] Informix Schema -> PostgreSQL ?

2007-07-03 Thread Nis Jørgensen
Adam Tauno Williams skrev: >> pg_dump dbname -s -t tableorindexname > > [Also an Informix DBA] Is there a way to tweak the output of pg_dump > when used in this manner to omit the verbose commentary. > > $ pg_dump OGo -s -t enterprise pg_dump OGo -s -t enterprise | grep -v '^--$' Nis --

Re: [SQL] Informix Schema -> PostgreSQL ?

2007-07-03 Thread Jaime Casanova
On 7/3/07, Adam Tauno Williams <[EMAIL PROTECTED]> wrote: > pg_dump dbname -s -t tableorindexname [Also an Informix DBA] Is there a way to tweak the output of pg_dump when used in this manner to omit the verbose commentary. no AFAIK. dbexport and dbschema doesn't have that either, or they ha

Re: [SQL] Informix Schema -> PostgreSQL ?

2007-07-03 Thread Adam Tauno Williams
> pg_dump dbname -s -t tableorindexname [Also an Informix DBA] Is there a way to tweak the output of pg_dump when used in this manner to omit the verbose commentary. $ pg_dump OGo -s -t enterprise -- -- Name: unique_enterprise_login; Type: INDEX; Schema: public; Owner: OGo; Tablespace: --

Re: [SQL] Iterate and write a previous row to a temp table?

2007-07-03 Thread Richard Huxton
Bob Singleton wrote: Revisiting a Time In Status query I received help on - I'm trying to narrow down a subset of data I return for analysis. Given a statusLog as entityId, statusId, timestamp that might look something like entityId | statusId | timestamp

Re: [SQL] Iterate and write a previous row to a temp table?

2007-07-03 Thread chester c young
--- Bob Singleton <[EMAIL PROTECTED]> wrote: > Revisiting a Time In Status query I received help on - I'm trying to > narrow down a subset of data I return for analysis. > > Given a statusLog as entityId, statusId, timestamp that might look > something like > > entityId | statusId | timestamp

[SQL] Iterate and write a previous row to a temp table?

2007-07-03 Thread Bob Singleton
Revisiting a Time In Status query I received help on - I'm trying to narrow down a subset of data I return for analysis. Given a statusLog as entityId, statusId, timestamp that might look something like entityId | statusId | timestamp 001 | HL

Re: [SQL] Using escape strings in an insert statement.

2007-07-03 Thread Michael Glaesemann
On Jul 3, 2007, at 10:49 , Erik Jones wrote: On Jul 2, 2007, at 6:11 PM, Michael Glaesemann wrote: On Jul 2, 2007, at 17:45 , Paul Lambert wrote: tester=# insert into testing (test_text) values ('abcE'\\'123'); This should be INSERT INTO testing (test_text) values (E'abc\123'); No, tha

Re: [SQL] Informix Schema -> PostgreSQL ?

2007-07-03 Thread Scott Marlowe
Mark Fenbers wrote: I am an ex-Informix convert. Informix used the term "schema" to refer to the SQL-format definition of how a table or view was created. E.g., CREATE TABLE john ( char(8) lid, ...); Some views we have are quite complex (and not created by me) and I want to create a similar

Re: [SQL] Informix Schema -> PostgreSQL ?

2007-07-03 Thread Adam Tauno Williams
On Tue, 2007-07-03 at 12:22 -0400, Mark Fenbers wrote: > I am an ex-Informix convert. Informix used the term "schema" to refer > to the SQL-format definition of how a table or view was created. E.g., > CREATE TABLE john ( char(8) lid, ...); Some views we have are quite > complex (and not crea

[SQL] Informix Schema -> PostgreSQL ?

2007-07-03 Thread Mark Fenbers
I am an ex-Informix convert. Informix used the term "schema" to refer to the SQL-format definition of how a table or view was created. E.g., CREATE TABLE john ( char(8) lid, ...); Some views we have are quite complex (and not created by me) and I want to create a similar one in Pg. If I cou

Re: [SQL] Using escape strings in an insert statement.

2007-07-03 Thread Erik Jones
On Jul 2, 2007, at 6:11 PM, Michael Glaesemann wrote: On Jul 2, 2007, at 17:45 , Paul Lambert wrote: tester=# insert into testing (test_text) values ('abcE'\\'123'); This should be INSERT INTO testing (test_text) values (E'abc\123'); No, that will leave him with the string 'abc23' beingi

Re: [SQL] dblink inside plpgsql function

2007-07-03 Thread Loredana Curugiu
I should read the documentation carrefully .. Yes, you're right, Richard. Many thanks to all. Best, Loredana

Re: [SQL] dblink inside plpgsql function

2007-07-03 Thread Richard Huxton
Loredana Curugiu wrote: CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF reminder_services AS' DECLARE r reminder_services%ROWTYPE; BEGIN PERFORM dblink_connect(''dbname=''||$1); PERFORM dblink_disconnect($1); RETURN; END; ' LANGUAGE plpgsql; Now I get the er

Re: [SQL] dblink inside plpgsql function

2007-07-03 Thread Loredana Curugiu
CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF reminder_services AS' DECLARE r reminder_services%ROWTYPE; BEGIN PERFORM dblink_connect(''dbname=''||$1); FOR r IN SELECT * FROM dblink(''SELECT * FROM reminder_services'') AS columns( uid INT,

Re: [SQL] dblink inside plpgsql function

2007-07-03 Thread Richard Huxton
Loredana Curugiu wrote: I created the following function CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF reminder_services AS' DECLARE r reminder_services%ROWTYPE; BEGIN SELECT dblink_connect(''dbname=''||$1); ^^^ and I get th

Re: [SQL] dblink inside plpgsql function

2007-07-03 Thread Loredana Curugiu
I created the following function CREATE OR REPLACE FUNCTION getReminderServices( varchar ) RETURNS SETOF reminder_services AS' DECLARE r reminder_services%ROWTYPE; BEGIN SELECT dblink_connect(''dbname=''||$1); FOR r IN SELECT * FROM dblink(''SELECT * FROM reminder_services'')

Re: [SQL] dblink inside plpgsql function

2007-07-03 Thread Bart Degryse
What Pavel mentions might indeed be an issue, but I think there's another one too. I think you have to call your function giving more information to the statement on what types will be returned. Since you use dblink I assume that the table or view reminder_services you are basically selecting fr

Re: [SQL] dblink inside plpgsql function

2007-07-03 Thread Pavel Stehule
Hello Every SELECT statement in PL/pgSQL have to be forward to variables. In plpgsql you can you use select only like select into variables columns from ... propably better version is (i haven't installed dblink and can't to test it) CREATE OR REPLACE FUNCTION GetReminderServices( varchar ) RE

[SQL] dblink inside plpgsql function

2007-07-03 Thread Loredana Curugiu
Hi everybody, I created the following function: CREATE OR REPLACE FUNCTION GetReminderServices( varchar ) RETURNS SETOF reminder_services AS' BEGIN SELECT dblink_connect(''dbname=''||$1); SELECT * FROM dblink(''SELECT * FROM reminder_services'') AS reminder_services( uid INT,