0

masters~ Oracle SQL を DB2 に変換するのに問題があります。

これらの Oracle SQL を DB2 に変更する必要があります。

私を助けてください

CREATE TABLE ABC (
   AA VARCHAR(10 BYTE) WITH DEFAULT TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS')
);


CREATE TABLE CBA (
BB  INTEGER(22) NOT NULL
) PCTFREE 10 TABLESPACE CC STORAGE (INITIAL 32K NEXT 32K) NOLOGGING;
4

1 に答える 1

0

What with all the concerns @Bob Jarvis mentioned in the comment to the original post, here is some rough equivalents that might get you by. You should probably consult the Information Center documentation a bit for further reference.

CREATE TABLE ABC (
   AA TIMESTAMP WITH DEFAULT CURRENT TIMESTAMP GENERATED BY DEFAULT
);


CREATE TABLE CBA (
    BB  BIGINT NOT NULL
);

If you're generating timestamps, you should store them as such, not as character strings.

Also, there is a NOT LOGGED option on DB2 tables, but it is only valid for LOB data types. (Or, there is NOT LOGGED INITIALLY, which will not log any changes that are applied in the same unit of work as the table creation, which is useful, for example, when importing data from another source [file or other table, perhaps])

于 2012-04-05T15:10:52.923 に答える