We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this is related to struct sql_var / its typedef SQLVARLIST and everything this is used for, for example OCESQLSetSQLParams, OCESQLSetResultParams,
struct sql_var
SQLVARLIST
OCESQLSetSQLParams
OCESQLSetResultParams
static SQLVARLIST * new_sql_var_list(void); static SQLVARLIST * add_sql_var_list(int, int, int, void *); static SQLVARLIST * add_sql_res_var_list(int, int, int, void *); static void clear_sql_var_list(const SQLVARLIST *); static void show_sql_var_list(const SQLVARLIST *);
Background: an enum with defined values is much more easy to debug and follow than magic numbers, which seem to be defined in ocdb.h:
// 型情報 //#define OCDB_TYPE_FORMATTED_NUMBER 0 // 数字編集 #define OCDB_TYPE_UNSIGNED_NUMBER 1 // 符号無数字 //#define OCDB_TYPE_SIGNED_NUMBER_TS 2 // 符号付数字(trailing separate) #define OCDB_TYPE_SIGNED_NUMBER_TC 3 // 符号付数字(trailing combined) #define OCDB_TYPE_SIGNED_NUMBER_LS 4 // 符号付数字(leading separete) //#define OCDB_TYPE_SIGNED_NUMBER_LC 5 // 符号付数字(leading combined) //#define OCDB_TYPE_SIGNED_CALC 6 // 符号付計算 //#define OCDB_TYPE_UNSIGNED_CALC 7 // 符号無計算 #define OCDB_TYPE_UNSIGNED_NUMBER_PD 8 // 正のパック10進数 #define OCDB_TYPE_SIGNED_NUMBER_PD 9 // 符号付パック10進数 //#define OCDB_TYPE_COMP6 10 // COMP-6 //#define OCDB_TYPE_SINGED_BINARY 11 // 符号付2進数 //#define OCDB_TYPE_UNSINGED_BINARY 12 // 符号無2進数 #define OCDB_TYPE_SINGED_BINARY_NATIVE 13 // 符号付2進数(native-order) #define OCDB_TYPE_UNSINGED_BINARY_NATIVE 14 // 符号無2進数(native-order) #define OCDB_TYPE_ALPHANUMERIC 16 // 英数字 //#define OCDB_TYPE_ALPHANUMERIC_J 17 // 英数字(桁寄せ) //#define OCDB_TYPE_ALPHABETICAL 18 // 英字 //#define OCDB_TYPE_ALPHABETICAL_J 19 // 英字(桁寄せ) //#define OCDB_TYPE_FORMATTED_ALPHANUMERIC 20 // 英数字編集 #define OCDB_TYPE_GROUP 22 // 集団 //#define OCDB_TYPE_FLOATING_NUMBER 23 // Float or Double #define OCDB_TYPE_JAPANESE 24 // 日本語 //#define OCDB_TYPE_JAPANESE_J 25 // 日本語(桁寄せ) //#define OCDB_TYPE_FORMATTED_JAPANESE 26 // 日本語編集 //#define OCDB_TYPE_WIDE 27 // wide //#define OCDB_TYPE_WIDE_J 28 // wide(桁寄せ) //#define OCDB_TYPE_FORMATTED_WIDE 29 // wide #define OCDB_TYPE_ALPHANUMERIC_VARYING 30 // VARYING(PIC X) #define OCDB_TYPE_JAPANESE_VARYING 31 // VARYING(PIC N) #define OCDB_TYPE_MIN 0 // 型下限 #define OCDB_TYPE_MAX 32 // 型上限
So instead use
// 型情報 enum sqlVarType { // OCDB_TYPE_FORMATTED_NUMBER = 0, // 数字編集 OCDB_TYPE_UNSIGNED_NUMBER = 1, // 符号無数字 // OCDB_TYPE_SIGNED_NUMBER_TS = 2, // 符号付数字(trailing separate) OCDB_TYPE_SIGNED_NUMBER_TC = 3, // 符号付数字(trailing combined) OCDB_TYPE_SIGNED_NUMBER_LS = 4, // 符号付数字(leading separete) // OCDB_TYPE_SIGNED_NUMBER_LC = 5, // 符号付数字(leading combined) // OCDB_TYPE_SIGNED_CALC = 6, // 符号付計算 // OCDB_TYPE_UNSIGNED_CALC = 7, // 符号無計算 OCDB_TYPE_UNSIGNED_NUMBER_PD = 8, // 正のパック10進数 OCDB_TYPE_SIGNED_NUMBER_PD = 9, // 符号付パック10進数 // OCDB_TYPE_COMP6 = 10, // COMP-6 // OCDB_TYPE_SINGED_BINARY = 11, // 符号付2進数 // OCDB_TYPE_UNSINGED_BINARY = 12, // 符号無2進数 OCDB_TYPE_SINGED_BINARY_NATIVE = 13, // 符号付2進数(native-order) OCDB_TYPE_UNSINGED_BINARY_NATIVE = 14, // 符号無2進数(native-order) OCDB_TYPE_ALPHANUMERIC = 16, // 英数字 // OCDB_TYPE_ALPHANUMERIC_J = 17, // 英数字(桁寄せ) // OCDB_TYPE_ALPHABETICAL = 18, // 英字 // OCDB_TYPE_ALPHABETICAL_J = 19, // 英字(桁寄せ) // OCDB_TYPE_FORMATTED_ALPHANUMERIC = 20, // 英数字編集 OCDB_TYPE_GROUP = 22, // 集団 // OCDB_TYPE_FLOATING_NUMBER = 23, // Float or Double OCDB_TYPE_JAPANESE = 24, // 日本語 // OCDB_TYPE_JAPANESE_J = 25, // 日本語(桁寄せ) // OCDB_TYPE_FORMATTED_JAPANESE = 26, // 日本語編集 // OCDB_TYPE_WIDE = 27, // wide // OCDB_TYPE_WIDE_J = 28, // wide(桁寄せ) // OCDB_TYPE_FORMATTED_WIDE = 29, // wide OCDB_TYPE_ALPHANUMERIC_VARYING = 30, // VARYING(PIC X) OCDB_TYPE_JAPANESE_VARYING = 31, // VARYING(PIC N) OCDB_TYPE_MIN = 0, // 型下限 OCDB_TYPE_MAX = 32 // 型上限 };
and then instead of int type use enum sqlVarType type.
int type
enum sqlVarType type
The text was updated successfully, but these errors were encountered:
No branches or pull requests
this is related to
struct sql_var
/ its typedefSQLVARLIST
and everything this is used for, for exampleOCESQLSetSQLParams
,OCESQLSetResultParams
,Background: an enum with defined values is much more easy to debug and follow than magic numbers, which seem to be defined in ocdb.h:
So instead use
and then instead of
int type
useenum sqlVarType type
.The text was updated successfully, but these errors were encountered: