qwazer / db2-scheme2ddl Goto Github PK
View Code? Open in Web Editor NEWCommand line util for export IBM DB2 schema to set of ddl scripts
Command line util for export IBM DB2 schema to set of ddl scripts
public List<Db2LookInfo> findTablePkeys(UserObject userObject) {
List<Db2LookInfo> list = getJdbcTemplate().query(
"SELECT * " +
" FROM SYSTOOLS.DB2LOOK_INFO t " +
" WHERE OBJ_TYPE = 'PKEY' AND OP_TOKEN = ? AND t.OBJ_SCHEMA = ? AND OBJ_NAME = ?" +
" AND exists( " +
" SELECT 1 " +
" FROM SYSCAT.REFERENCES R " +
" WHERE R.TABSCHEMA = t.OBJ_SCHEMA " +
" AND R.TABNAME = t.OBJ_NAME)",
new Object[]{userObject.getOpToken(), schemaName, userObject.getName()},
new Db2LookInfoRowMapper());
return list;
}
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 28 Jan 2015 at 1:49
<bean id="dataSource" class="com.ibm.db2.jcc.DB2DataSource">
<property name="serverName" value=""/>
<property name="databaseName" value=""/>
<property name="portNumber" value=""/>
<property name="user" value=""/>
<property name="password" value=""/>
<property name="driverType" value=""/>
</bean>
CREATE TABLE "MY "."STUDENT" (
"SID" INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (
START WITH +1
INCREMENT BY +1
MINVALUE +1
MAXVALUE +2147483647
NO CYCLE
CACHE 20
NO ORDER ) ,
"SNAME" VARCHAR(30) )
IN "IBMDB2SAMPLEREL" ;
ALTER TABLE "MY "."STUDENT" ALTER COLUMN "SID" RESTART WITH 100 ;
Index: src/main/java/com/googlecode/scheme2ddl/db2/UserObjectWriter.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/main/java/com/googlecode/scheme2ddl/db2/UserObjectWriter.java (date 1427695566000)
+++ src/main/java/com/googlecode/scheme2ddl/db2/UserObjectWriter.java (revision )
@@ -29,6 +29,7 @@
public void writeUserObject(UserObject userObject) throws Exception {
String absoluteFileName = outputPath + "/" + userObject.getFileName();
+ absoluteFileName = absoluteFileName.replaceAll("\"", "_"); //todo
absoluteFileName = FilenameUtils.separatorsToSystem(absoluteFileName);
File file = new File(absoluteFileName);
FileUtils.writeStringToFile(file, userObject.getDdl());
http://www.ibm.com/developerworks/data/library/techarticle/dm-0605ahuja2/
http://www.dbatodba.com/db2/db2-udb-v9/how-to-know-the-number-of-partitons-and-r
anges-from-partitioned-tables/
Original issue reported on code.google.com by [email protected]
on 28 Jan 2015 at 1:51
Must be depended objects:
COMMENT ON COLUMN "Table"."ACCOUNT"."ACCOUNT_ID" IS 'Id of account'
;
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 28 Jan 2015 at 1:50
CREATE ALIAS "DB2INST1"."DEPT" FOR TABLE "DB2INST1"."DEPARTMENT";
---------------------------------------
-- Authorization statement on sequence
---------------------------------------
GRANT USAGE ON SEQUENCE "DB2INST1"."SAMPSEQUENCE" TO USER "DB2INST1" WITH GRANT OPTION;
GRANT ALTER ON SEQUENCE "DB2INST1"."SAMPSEQUENCE" TO USER "DB2INST1" WITH GRANT OPTION;
GRANT USAGE ON SEQUENCE "SYSTOOLS"."DB2LOOK_TOKEN" TO USER "DB2INST1" WITH GRANT OPTION;
GRANT ALTER ON SEQUENCE "SYSTOOLS"."DB2LOOK_TOKEN" TO USER "DB2INST1" WITH GRANT OPTION;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.