next line, new line

rasdj_at_frontiernet.net
Date: 01/31/05


Date: 30 Jan 2005 19:42:22 -0800

I have a lot of SQL to convert to postgres from oracle. I have most of
the problems worked out except for this last bit. Many of my tables
need the last comma replaced with a close parenthesis - they look like
this:

create table schema.table (
FLD000 NUMERIC(10,0) NOT NULL,
FLD001 CHAR(3) NOT NULL,
FLD002 DATE NOT NULL,
;

when the syntax requires:

FLD002 DATE NOT NULL)
;

I output the text in reverse thinking I could find the semicolon, go to
the next line and replace the 'comma newline' with 'closeparen newline'
and then go on to find the next semicolon.

;
FLD002 DATE NOT NULL,
FLD001 CHAR(3) NOT NULL,
FLD000 NUMERIC(10,0) NOT NULL,
create table schema.table (
;
FLD002 DATE NOT NULL,
FLD001 CHAR(3) NOT NULL,
FLD000 NUMERIC(10,0) NOT NULL,
create table schema.table2 (

I don't seem to be making any progress altho I have had some
interesting output.

Throw me a bone?

Thank you,

RasDJ



Relevant Pages

  • Re: ORA-00911 error and COMMIT
    ... Oracle 10g database. ...  Please understand admit that I'm a complete Oracle and SQL ... Quickstart Guide and from hacking queries that I've stolen from Crystal ... Don't put a semicolon after "BEGIN" ...
    (comp.databases.oracle.misc)
  • Re: ORA-00911 error and COMMIT
    ... Oracle 10g database. ... I tried your suggestion and now I'm getting an ORA-06550 error: ... Don't put a semicolon after "BEGIN" ...
    (comp.databases.oracle.misc)
  • Re: next line, new line
    ... If I could figgure out how to: ... because there are lots of "comma newline" but the only ones I want are ... the ones that follow the semicolon. ... RasDJ ...
    (comp.lang.python)