简体   繁体   English

如何将 Oracle SQL 转换为 DB2?

[英]How can I convert from Oracle SQL to DB2?

masters~ I'm having trouble converting Oracle SQL to DB2.各位大神们~ Oracle SQL 转DB2 遇到问题了

I need to change these Oracle SQLs to DB2.我需要将这些 Oracle SQL 更改为 DB2。

Please help me请帮我

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;

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.考虑到@Bob Jarvis 在对原始帖子的评论中提到的所有担忧,这里有一些粗略的等价物可能会让你明白。 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.此外,DB2 表上有一个NOT LOGGED选项,但它仅对LOB数据类型有效。 (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]) (或者,有NOT LOGGED INITIALLY ,它不会记录在与表创建相同的工作单元中应用的任何更改,这很有用,例如,当从另一个源导入数据时 [文件或其他表,也许] )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM