I would like to thank everyone who has help me with some of the problems I presented. Thanks!
Now, I have another problem. This one is a bit more tricky, to me anyways. Hopefully, someone will have a good, simple solution to this problem.

I have this in an SQL file, which was taken from a Sybase DB table structure.
CREATE TABLE "ARSAMSUSER"."LINK_TYPE_CODE" ( LINK_TYPE VARCHAR2(20) NOT NULL, DCD_NO VARCHAR2(1) NULL, IS_ONE_TO_ONE VARCHAR2(1) NULL CHECK(IS_ONE_TO_ONE IS NULL + OR(IS_ONE_TO_ONE IN(Y,N,NULL))), IS_DRAWN VARCHAR2(1) NULL CHECK(IS_DRAWN IS NULL OR(I +S_DRAWN IN(Y,N,NULL))), DESCRIPTION VARCHAR2(60) NULL, LENGTH_OPERATION VARCHAR2(4) NULL, WIDTH_OPERATION VARCHAR2(4) NULL, HEIGHT_OPERATION VARCHAR2(4) NULL, WEIGHT_OPERATION VARCHAR2(4) NULL, AREA_OPERATION VARCHAR2(4) NULL, PRIMARY KEY (LINK_TYPE) ) TABLESPACE ARSAMS /
What I need to do to this block of code is this. Starting from the word CHECK and ending at the comma (,). I either need to place this in the row directly above the PRIMARY KEY line or simply on the next line under IS_ONE_TO_ONE. I need to make the break between the NULL and the CHECK. Only problem is that I'm not sure on how to do this one. If I do
s/\CHECK\b//i;
All I do is delete CHECK. Could someone please guide me in the right direction.

Example of what I need it to look like.
CREATE TABLE "ARSAMSUSER"."LINK_TYPE_CODE" ( LINK_TYPE VARCHAR2(20) NOT NULL, DCD_NO VARCHAR2(1) NULL, IS_ONE_TO_ONE VARCHAR2(1) NULL, CHECK(IS_ONE_TO_ONE IS NULL OR(IS_ONE_TO_ONE IN(Y,N,NULL))), IS_DRAWN VARCHAR2(1) NULL, DESCRIPTION VARCHAR2(60) NULL, LENGTH_OPERATION VARCHAR2(4) NULL, WIDTH_OPERATION VARCHAR2(4) NULL, HEIGHT_OPERATION VARCHAR2(4) NULL, WEIGHT_OPERATION VARCHAR2(4) NULL, AREA_OPERATION VARCHAR2(4) NULL, CHECK(IS_DRAWN IS NULL OR(IS_DRAWN IN(Y,N,NULL))), PRIMARY KEY (LINK_TYPE) ) TABLESPACE ARSAMS /
Thanks again for all the help. Hope to hear from all of you soon.

Bobby

edited: Sat Sep 28 03:10:07 2002 by jeffa - title change (was: Yet another problem)


In reply to Rewritting SQL table definition by curtisb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.