embulk-output-oracle 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 807550e963921329a90f3e59f3795d457fbca74d
4
- data.tar.gz: 196ee9e52839d9bcaa77e6d6e8a04f7df4e3211e
3
+ metadata.gz: 358c95dcbfbd104bb1ce987ed429b676bf6fd651
4
+ data.tar.gz: f6d381125a22e04c7843cc0579bceb8b5845ba93
5
5
  SHA512:
6
- metadata.gz: 75e419a9fa39ef065064e3374e883059afc55a26dc607718d6eb1c26a9152e3b69734b818897f118a291f70990751d0f76260ac3465b92a39a7e1c9d2fb4c972
7
- data.tar.gz: 173329f757b809d65deb30e5111daed0f12ad90aba6a4737ff9c3e7abed2526d7d0589a665ff836fea1b53a75ec3cdafd6a04e4d9b953e59b6684ba2ba9bfb9f
6
+ metadata.gz: ecbcc19a7e2efc3246d1885995741a2421ce2e87b8684fe7179632cfa69611656b4c79acb351b63a9ef136b2894fe83249c1401ab6f1e6128b1a6f9a485e567b
7
+ data.tar.gz: 49130a08d740618752d5979a813b1d06c1b86bd680d00d36ac315c8cb44a55ac378225a0cd58b0393e71979f810184a7e34bc511d97e7d7114eccbe73d322eaa
data/README.md CHANGED
@@ -31,6 +31,7 @@ Oracle output plugin for Embulk loads records to Oracle.
31
31
  - **value_type**: This plugin converts input column type (embulk type) into a database type to build a INSERT statement. This value_type option controls the type of the value in a INSERT statement. (string, default: depends on the sql type of the column. Available values options are: `byte`, `short`, `int`, `long`, `double`, `float`, `boolean`, `string`, `nstring`, `date`, `time`, `timestamp`, `decimal`, `json`, `null`, `pass`)
32
32
  - **timestamp_format**: If input column type (embulk type) is timestamp and value_type is `string` or `nstring`, this plugin needs to format the timestamp value into a string. This timestamp_format option is used to control the format of the timestamp. (string, default: `%Y-%m-%d %H:%M:%S.%6N`)
33
33
  - **timezone**: If input column type (embulk type) is timestamp, this plugin needs to format the timestamp value into a SQL string. In this cases, this timezone option is used to control the timezone. (string, value of default_timezone option is used by default)
34
+ - **after_load**: if set, this SQL will be executed after loading all records.
34
35
 
35
36
  ### Modes
36
37
 
@@ -10,6 +10,7 @@ import jnr.ffi.types.u_int8_t;
10
10
  public interface OCI
11
11
  {
12
12
  static short OCI_SUCCESS = 0;
13
+ static short OCI_SUCCESS_WITH_INFO = 1;
13
14
  static short OCI_ERROR = -1;
14
15
  static short OCI_INVALID_HANDLE = -2;
15
16
  static short OCI_NO_DATA = 100;
@@ -529,18 +529,30 @@ public class OCIWrapper
529
529
  case OCI.OCI_SUCCESS:
530
530
  break;
531
531
 
532
+ case OCI.OCI_SUCCESS_WITH_INFO:
533
+ if (errHandle != null) {
534
+ ArrayMemoryIO errrCode = new ArrayMemoryIO(Runtime.getSystemRuntime(), 4);
535
+ ArrayMemoryIO buffer = new ArrayMemoryIO(Runtime.getSystemRuntime(), 512);
536
+ if (oci.OCIErrorGet(errHandle, 1, null, errrCode, buffer, (int)buffer.size(), OCI.OCI_HTYPE_ERROR) == OCI.OCI_SUCCESS) {
537
+ String message = new String(buffer.array(), systemCharset);
538
+ logger.warn(message);
539
+ }
540
+ }
541
+ break;
542
+
532
543
  case OCI.OCI_ERROR:
533
544
  if (errHandle == null) {
534
545
  throwException("OCI : %s failed : %d.", operation, result);
535
- }
536
- ArrayMemoryIO errrCode = new ArrayMemoryIO(Runtime.getSystemRuntime(), 4);
537
- ArrayMemoryIO buffer = new ArrayMemoryIO(Runtime.getSystemRuntime(), 512);
538
- if (oci.OCIErrorGet(errHandle, 1, null, errrCode, buffer, (int)buffer.size(), OCI.OCI_HTYPE_ERROR) != OCI.OCI_SUCCESS) {
539
- throwException("OCI : %s failed : %d. OCIErrorGet failed.", operation, result);
540
- }
546
+ } else {
547
+ ArrayMemoryIO errrCode = new ArrayMemoryIO(Runtime.getSystemRuntime(), 4);
548
+ ArrayMemoryIO buffer = new ArrayMemoryIO(Runtime.getSystemRuntime(), 512);
549
+ if (oci.OCIErrorGet(errHandle, 1, null, errrCode, buffer, (int)buffer.size(), OCI.OCI_HTYPE_ERROR) != OCI.OCI_SUCCESS) {
550
+ throwException("OCI : %s failed : %d. OCIErrorGet failed.", operation, result);
551
+ }
541
552
 
542
- String message = new String(buffer.array(), systemCharset);
543
- throwException("OCI : %s failed : %d. %s", operation, result, message);
553
+ String message = new String(buffer.array(), systemCharset);
554
+ throwException("OCI : %s failed : %d. %s", operation, result, message);
555
+ }
544
556
 
545
557
  case OCI.OCI_INVALID_HANDLE:
546
558
  throwException("OCI : %s failed : invalid handle.", operation);
@@ -45,7 +45,7 @@ public class OracleOutputPluginTest extends AbstractJdbcOutputPluginTest
45
45
  try {
46
46
  Class.forName("oracle.jdbc.OracleDriver");
47
47
  } catch (ClassNotFoundException | NoClassDefFoundError e) {
48
- System.err.println("Warning: you should put 'ojdbc7.jar' in 'embulk-input-oracle/driver' directory in order to test.");
48
+ System.err.println("Warning: you should put 'ojdbc7.jar' in 'embulk-output-oracle/driver' directory in order to test.");
49
49
  return;
50
50
  }
51
51
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-oracle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-26 00:00:00.000000000 Z
11
+ date: 2016-11-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Inserts or updates records to a table.
14
14
  email:
@@ -19,8 +19,8 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - README.md
21
21
  - build.gradle
22
- - classpath/embulk-output-jdbc-0.7.0.jar
23
- - classpath/embulk-output-oracle-0.7.0.jar
22
+ - classpath/embulk-output-jdbc-0.7.1.jar
23
+ - classpath/embulk-output-oracle-0.7.1.jar
24
24
  - lib/embulk/native/x86_64-linux/libembulk-output-oracle-oci.so
25
25
  - lib/embulk/native/x86_64-windows/embulk-output-oracle-oci.dll
26
26
  - lib/embulk/output/oracle.rb