ij> -- -- Licensed to the Apache Software Foundation (ASF) under one or more -- contributor license agreements. See the NOTICE file distributed with -- this work for additional information regarding copyright ownership. -- The ASF licenses this file to You under the Apache License, Version 2.0 -- (the "License"); you may not use this file except in compliance with -- the License. You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- run resource '/org/apache/derbyTesting/functionTests/util/testRoutines.sql'; ij> -- -- Licensed to the Apache Software Foundation (ASF) under one or more -- contributor license agreements. See the NOTICE file distributed with -- this work for additional information regarding copyright ownership. -- The ASF licenses this file to You under the Apache License, Version 2.0 -- (the "License"); you may not use this file except in compliance with -- the License. You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- Changed to create individual procedures so that this will work with JSR169. -- Direct call to 'installRoutines' uses nested connection CREATE PROCEDURE TESTROUTINE.SET_SYSTEM_PROPERTY(IN PROPERTY_KEY VARCHAR(32000), IN PROPERTY_VALUE VARCHAR(32000)) NO SQL EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestRoutines.setSystemProperty' language java parameter style java; 0 rows inserted/updated/deleted ij> CREATE PROCEDURE TESTROUTINE.SLEEP(IN SLEEP_TIME_MS BIGINT) NO SQL EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestRoutines.sleep' language java parameter style java; 0 rows inserted/updated/deleted ij> CREATE FUNCTION TESTROUTINE.HAS_SECURITY_MANAGER() RETURNS INT NO SQL EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestRoutines.hasSecurityManager' language java parameter style java; 0 rows inserted/updated/deleted ij> CREATE FUNCTION TESTROUTINE.READ_FILE(FILE_NAME VARCHAR(60), ENCODING VARCHAR(60)) RETURNS VARCHAR(32000) NO SQL EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestRoutines.readFile' language java parameter style java; 0 rows inserted/updated/deleted ij> drop table T1_EUC_JP; ERROR 42Y55: 'DROP TABLE' cannot be performed on 'T1_EUC_JP' because it does not exist. ij> -- table for data in EUC_JP encoding create table T1_EUC_JP ( EnC:>9< jnum int, EnC:>9< EnC:>9< EnC:>9< EnC:>9< jtime time, EnC:>9< EnC:>9< EnC:>9< EnC:>9< jstring char(200) ); 0 rows inserted/updated/deleted ij> -- import data in EUC_JP encoding call SYSCS_UTIL.SYSCS_IMPORT_TABLE(null, 'T1_EUC_JP' , EnC:>9< EnC:>9< EnC:>9< 'extin/jap_EUC_JP.dat' , EnC:>9< EnC:>9< EnC:>9< EnC:>9< null, null, 'EUC_JP', 0) ; 0 rows inserted/updated/deleted ij> SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP; JNUM |JTIME |JLEN -------------------------------- 1 |15:32:06|14 2 |15:32:10|20 3 |15:32:28|38 4 |15:32:29|27 5 |15:32:29|29 6 |15:32:30|10 7 |15:32:31|24 8 |15:33:22|14 9 |15:33:23|117 10 |15:33:40|14 11 |15:33:41|117 12 |15:33:43|27 13 |15:34:29|14 14 |15:34:30|117 15 |15:35:35|26 16 |15:39:10|27 ij> -- export to file with EUC_JP encoding call SYSCS_UTIL.SYSCS_EXPORT_TABLE('APP', 'T1_EUC_JP' , EnC:>9< EnC:>9< EnC:>9< 'extinout/jap_EUC_JP.dump' , EnC:>9< EnC:>9< EnC:>9< EnC:>9< null, null, 'EUC_JP') ; 0 rows inserted/updated/deleted ij> -- export to file with SJIS encoding EnC:>9< call SYSCS_UTIL.SYSCS_EXPORT_TABLE('APP', 'T1_EUC_JP' , EnC:>9< EnC:>9< EnC:>9< 'extinout/jap_SJIS.dump' , EnC:>9< EnC:>9< EnC:>9< EnC:>9< null, null, 'SJIS') ; 0 rows inserted/updated/deleted ij> -- import as EUC_JP and compare to original create table T1_EUC_JP_IMPORT_AS_EUC_JP(jnum int, jtime time, jstring char(200)); 0 rows inserted/updated/deleted ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1_EUC_JP_IMPORT_AS_EUC_JP', 'extinout/jap_EUC_JP.dump', NULL, NULL, 'EUC_JP', 0); 0 rows inserted/updated/deleted ij> SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP_IMPORT_AS_EUC_JP; JNUM |JTIME |JLEN -------------------------------- 1 |15:32:06|14 2 |15:32:10|20 3 |15:32:28|38 4 |15:32:29|27 5 |15:32:29|29 6 |15:32:30|10 7 |15:32:31|24 8 |15:33:22|14 9 |15:33:23|117 10 |15:33:40|14 11 |15:33:41|117 12 |15:33:43|27 13 |15:34:29|14 14 |15:34:30|117 15 |15:35:35|26 16 |15:39:10|27 ij> SELECT count(*) FROM T1_EUC_JP OG, T1_EUC_JP_IMPORT_AS_EUC_JP IM WHERE OG.jnum = IM.jnum AND OG.jtime = IM.jtime AND OG.jstring = IM.jstring; 1 ----------- 16 ij> -- import as SJIS and compare to original create table T1_EUC_JP_IMPORT_AS_SJIS(jnum int, jtime time, jstring char(200)); 0 rows inserted/updated/deleted ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1_EUC_JP_IMPORT_AS_SJIS', 'extinout/jap_SJIS.dump', NULL, NULL, 'SJIS', 0); 0 rows inserted/updated/deleted ij> SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP_IMPORT_AS_SJIS; JNUM |JTIME |JLEN -------------------------------- 1 |15:32:06|14 2 |15:32:10|20 3 |15:32:28|38 4 |15:32:29|27 5 |15:32:29|29 6 |15:32:30|10 7 |15:32:31|24 8 |15:33:22|14 9 |15:33:23|117 10 |15:33:40|14 11 |15:33:41|117 12 |15:33:43|27 13 |15:34:29|14 14 |15:34:30|117 15 |15:35:35|26 16 |15:39:10|27 ij> SELECT count(*) FROM T1_EUC_JP OG, T1_EUC_JP_IMPORT_AS_SJIS IM WHERE OG.jnum = IM.jnum AND OG.jtime = IM.jtime AND OG.jstring = IM.jstring; 1 ----------- 16 ij> delete from T1_EUC_JP_IMPORT_AS_EUC_JP; 16 rows inserted/updated/deleted ij> delete from T1_EUC_JP_IMPORT_AS_SJIS; 16 rows inserted/updated/deleted ij> maximumdisplaywidth 40000; ij> -- convert from EUC_JP to unicode with native2ascii VALUES TESTROUTINE.READ_FILE('extinout/jap_EUC_JP.dump', 'EUC_JP'); 1 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1,"15:32:06","\u30a4\u30d9\u30f3\u30c8\u30a2\u30e9\u30fc\u30e0\u304c\u6709\u52b9\u3067\u3059\u3002 " 2,"15:32:10","DR:DRAUTO\u306f0 (Off)\u3067\u3059\u3002 " 3,"15:32:28","INFORMIX-OnLine\u304c\u521d\u671f\u5316\u3055\u308c\u3001\u30c7\u30a3\u30b9\u30af\u306e\u521d\u671f\u5316\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 " 4,"15:32:29","\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f:\u7d99\u7d9a\u6642\u9593\u306f 0\u79d2\u3067\u3057\u305f " 5,"15:32:29","\u3059\u3079\u3066\u306eDB\u9818\u57df\u306e\u30c7\u30fc\u30bf\u30b9\u30ad\u30c3\u30d7\u306f\u73fe\u5728\u30aa\u30d5\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 " 6,"15:32:30","On-Line\u30e2\u30fc\u30c9 " 7,"15:32:31","sysmaster\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u4e2d\u3067\u3059... " 8,"15:33:22","\u8ad6\u7406\u30ed\u30b0 1\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 " 9,"15:33:23","\u30ea\u30bf\u30fc\u30f3\u30b3\u30fc\u30c9 1\u3092\u623b\u3057\u3066\u30d7\u30ed\u30bb\u30b9\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f:/bin/sh /bin/sh -c /work1/MOSES_7.22.UC1A5_27/sqldist/etc/log_full.sh 2 23 \u8ad6\u7406\u30ed\u30b0 1\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 \u8ad6\u7406 " 10,"15:33:40","\u8ad6\u7406\u30ed\u30b0 2\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 " 11,"15:33:41","\u30ea\u30bf\u30fc\u30f3\u30b3\u30fc\u30c9 1\u3092\u623b\u3057\u3066\u30d7\u30ed\u30bb\u30b9\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f:/bin/sh /bin/sh -c /work1/MOSES_7.22.UC1A5_27/sqldist/etc/log_full.sh 2 23 \u8ad6\u7406\u30ed\u30b0 2\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 \u8ad6\u7406 " 12,"15:33:43","\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f:\u7d99\u7d9a\u6642\u9593\u306f 2\u79d2\u3067\u3057\u305f " 13,"15:34:29","\u8ad6\u7406\u30ed\u30b0 3\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 " 14,"15:34:30","\u30ea\u30bf\u30fc\u30f3\u30b3\u30fc\u30c9 1\u3092\u623b\u3057\u3066\u30d7\u30ed\u30bb\u30b9\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f:/bin/sh /bin/sh -c /work1/MOSES_7.22.UC1A5_27/sqldist/etc/log_full.sh 2 23 \u8ad6\u7406\u30ed\u30b0 3\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 \u8ad6\u7406 " 15,"15:35:35","sysmaster\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4f5c\u6210\u306f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 " 16,"15:39:10","\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f:\u7d99\u7d9a\u6642\u9593\u306f 8\u79d2\u3067\u3057\u305f " ij> -- convert from SJIS to unicode with native2ascii VALUES TESTROUTINE.READ_FILE('extinout/jap_SJIS.dump', 'SJIS'); 1 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1,"15:32:06","\u30a4\u30d9\u30f3\u30c8\u30a2\u30e9\u30fc\u30e0\u304c\u6709\u52b9\u3067\u3059\u3002 " 2,"15:32:10","DR:DRAUTO\u306f0 (Off)\u3067\u3059\u3002 " 3,"15:32:28","INFORMIX-OnLine\u304c\u521d\u671f\u5316\u3055\u308c\u3001\u30c7\u30a3\u30b9\u30af\u306e\u521d\u671f\u5316\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 " 4,"15:32:29","\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f:\u7d99\u7d9a\u6642\u9593\u306f 0\u79d2\u3067\u3057\u305f " 5,"15:32:29","\u3059\u3079\u3066\u306eDB\u9818\u57df\u306e\u30c7\u30fc\u30bf\u30b9\u30ad\u30c3\u30d7\u306f\u73fe\u5728\u30aa\u30d5\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 " 6,"15:32:30","On-Line\u30e2\u30fc\u30c9 " 7,"15:32:31","sysmaster\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u4e2d\u3067\u3059... " 8,"15:33:22","\u8ad6\u7406\u30ed\u30b0 1\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 " 9,"15:33:23","\u30ea\u30bf\u30fc\u30f3\u30b3\u30fc\u30c9 1\u3092\u623b\u3057\u3066\u30d7\u30ed\u30bb\u30b9\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f:/bin/sh /bin/sh -c /work1/MOSES_7.22.UC1A5_27/sqldist/etc/log_full.sh 2 23 \u8ad6\u7406\u30ed\u30b0 1\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 \u8ad6\u7406 " 10,"15:33:40","\u8ad6\u7406\u30ed\u30b0 2\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 " 11,"15:33:41","\u30ea\u30bf\u30fc\u30f3\u30b3\u30fc\u30c9 1\u3092\u623b\u3057\u3066\u30d7\u30ed\u30bb\u30b9\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f:/bin/sh /bin/sh -c /work1/MOSES_7.22.UC1A5_27/sqldist/etc/log_full.sh 2 23 \u8ad6\u7406\u30ed\u30b0 2\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 \u8ad6\u7406 " 12,"15:33:43","\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f:\u7d99\u7d9a\u6642\u9593\u306f 2\u79d2\u3067\u3057\u305f " 13,"15:34:29","\u8ad6\u7406\u30ed\u30b0 3\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 " 14,"15:34:30","\u30ea\u30bf\u30fc\u30f3\u30b3\u30fc\u30c9 1\u3092\u623b\u3057\u3066\u30d7\u30ed\u30bb\u30b9\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f:/bin/sh /bin/sh -c /work1/MOSES_7.22.UC1A5_27/sqldist/etc/log_full.sh 2 23 \u8ad6\u7406\u30ed\u30b0 3\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 \u8ad6\u7406 " 15,"15:35:35","sysmaster\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4f5c\u6210\u306f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 " 16,"15:39:10","\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f:\u7d99\u7d9a\u6642\u9593\u306f 8\u79d2\u3067\u3057\u305f " ij>