95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
|
count: argsCount];
@try {
size_t i = 0;
do {
if ([parameter isKindOfClass: [OFNull class]])
values[i++] = NULL;
else if ([parameter isKindOfClass: [OFNumber class]]) {
switch ([parameter type]) {
case OF_NUMBER_BOOL:
if ([parameter boolValue])
values[i++] = "t";
else
else
values[i++] = "f";
break;
default:
values[i++] = [[parameter description]
UTF8String];
break;
}
} else
values[i++] = [parameter UTF8String];
} while ((parameter = va_arg(args, id)) != nil);
result = PQexecParams(conn, [command UTF8String],
argsCount, NULL, values, NULL, NULL, 0);
} @finally {
[self freeMemory: values];
|