Sha256: 1fbeab1eb18fa53c5ce05cf390adae12db1c1c43da62365a9c40f9cce1ffe28e
Contents?: true
Size: 1.88 KB
Versions: 2
Compression:
Stored size: 1.88 KB
Contents
#include <stdio.h> #include <string.h> #include <dir-path-load.h> static int test(EMBULK_OUTPUT_ORACLE_OCI_CONTEXT *context, const char *db, const char *user, const char *pass, const char *csvFileName) { if (embulk_output_oracle_prepareDirPathCtx(context, db, user, pass)) { return OCI_ERROR; } EMBULK_OUTPUT_ORACLE_OCI_COL_DEF colDefs[] = { {"ID", SQLT_INT, 4}, //{"ID", SQLT_CHR, 8}, {"NUM", SQLT_INT, 4}, //{"NUM", SQLT_CHR, 12}, {"VALUE1", SQLT_CHR, 60}, {"VALUE2", SQLT_CHR, 60}, {"VALUE3", SQLT_CHR, 60}, {"VALUE4", SQLT_CHR, 60}, {"VALUE5", SQLT_CHR, 60}, {"VALUE6", SQLT_CHR, 60}, {"VALUE7", SQLT_CHR, 60}, {"VALUE8", SQLT_CHR, 60}, {"VALUE9", SQLT_CHR, 60}, {"VALUE10", SQLT_CHR, 60}, {NULL, 0, 0} }; if (embulk_output_oracle_prepareDirPathStream(context, "EXAMPLE", 832, colDefs)) { return OCI_ERROR; } if (embulk_output_oracle_loadCSV(context, colDefs, csvFileName)) { return OCI_ERROR; } if (embulk_output_oracle_commitDirPath(context)) { return OCI_ERROR; } return OCI_SUCCESS; } int main(int argc, char* argv[]) { sword major_version; sword minor_version; sword update_num; sword patch_num; sword port_update_num; OCIClientVersion(&major_version, &minor_version, &update_num, &patch_num, &port_update_num); printf("OCI client version = %d.%d.%d.%d.%d\r\n", major_version, minor_version, update_num, patch_num, port_update_num); if (argc < 5) { printf("embulk-output-oracle-test <db> <user> <password> <csv file name>\r\n"); return OCI_ERROR; } EMBULK_OUTPUT_ORACLE_OCI_CONTEXT context; memset(&context, 0, sizeof(EMBULK_OUTPUT_ORACLE_OCI_CONTEXT)); int result = test(&context, argv[1], argv[2], argv[3], argv[4]); if (result == OCI_ERROR) { printf("%s\r\n", context.message); } embulk_output_oracle_freeDirPathHandles(&context); return result; }
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
embulk-output-oracle-0.4.1 | src/test/cpp/common/embulk-output-oracle-test.cpp |
embulk-output-oracle-0.2.4 | src/test/cpp/common/embulk-output-oracle-test.cpp |