IBM Cloud上Db2的SQL格式是什么? [英] What's the SQL format for Db2 on IBM Cloud?
问题描述
我正在IBM Cloud上使用免费版本的Db2.我想在带有JDBC驱动程序的Spring Boot应用程序中使用它.但是我不知道IBM Cloud上Db2的SQL格式是什么.正式文件有些混乱.我已经用Google搜索,但是找不到教程.
I'm using the free version of Db2 on IBM Cloud. I want to use it in Spring Boot application with JDBC driver. But I don't know what's the SQL format for the Db2 on IBM Cloud. The official documents are somewhat clutter. I have googled but can't find a tutorial.
我有以下适用于H2数据库的SQL.我想转换为IBM Cloud SQL格式的Db2.我搜索了一些像这样的SQL方言翻译器: https://www.jooq.org/translate/但这似乎不适用于IBM Cloud格式.
I have the following SQL that works with H2 database. I want to translate to Db2 on IBM Cloud's SQL format. I have searched some SQL dialect translators like this one: https://www.jooq.org/translate/ But it seems not work for the IBM Cloud format.
DROP TABLE IF EXISTS id_0065_00000004;
CREATE TABLE IF NOT Exists id_0065_00000004 (
gmeid VARCHAR(16) NOT NULL,
businessid VARCHAR(25) NOT NULL,
businesssubid VARCHAR(25) NOT NULL,
kind VARCHAR(25) ,
name VARCHAR(255) ,
kindvalue VARCHAR(255) ,
kindtype VARCHAR(20) ,
securitycode VARCHAR(25) ,
flowcode VARCHAR(12) ,
flowsubcode VARCHAR(12) ,
startdate DATE NOT NULL,
enddate DATE NOT NULL,
withdrawaldate DATE NOT NULL,
orientationkey VARCHAR(500) ,
parentid VARCHAR(16) ,
createdate DATE,
createuser VARCHAR(25) ,
updatedate DATE,
updateuser VARCHAR(25) ,
lockflg BIT,
lockuser VARCHAR(25) ,
lockdate DATE,
updatemachine VARCHAR(25) ,
PRIMARY KEY (businessid, gmeid, businesssubid)
);
CREATE INDEX kind ON id_0065_00000004(kind);
那么如何将上述SQL转换为DB2格式?
So how do I convert the above SQL to DB2 format?
推荐答案
不确定您的确切意思. Cloud上的Db2具有下载页面,用于正确的JDBC驱动程序以及有关如何连接到Db2的说明.Db2 on Cloud是基于IBM Db2(适用于Linux,Windows和UNIX)的托管服务.
Not sure what you exactly mean. Db2 on Cloud has a download page for the correct JDBC driver and instructions on how to connect to Db2. Db2 on Cloud is a managed service based on IBM Db2 (for Linux, Windows and UNIX).
这是常规Db2和Spring的教程.大多数包装器都支持开箱即用的Db2.
Here is a tutorial for regular Db2 and Spring. Most wrappers support Db2 out of the box.
如果您对实际的SQL语法感兴趣,则有一个链接 SQL参考 /docs/services/Db2onCloud?topic = Db2onCloud-getting-started"rel =" nofollow noreferrer>云上Db2的文档门户.
In the case that you are interested in the actual SQL syntax, there is a link SQL Reference on the actual doc portal for Db2 on Cloud.
这篇关于IBM Cloud上Db2的SQL格式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!