106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
" title AS title,"
" cast(strftime('%%s',mtime) as int) as timestamp,"
" cols as columns,"
" sqlcode as sqlCode"
" FROM reportfmt"
" WHERE rn=%d",
nReport);
if( SQLITE_ROW != db_step(&q) ){
db_finalize(&q);
json_set_err(FSL_JSON_E_RESOURCE_NOT_FOUND,
"Report #%d not found.", nReport);
return NULL;
}
pay = cson_sqlite4_row_to_object(q.pStmt);
db_finalize(&q);
|
|
|
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
" title AS title,"
" cast(strftime('%%s',mtime) as int) as timestamp,"
" cols as columns,"
" sqlcode as sqlCode"
" FROM reportfmt"
" WHERE rn=%d",
nReport);
if( SQLITE4_ROW != db_step(&q) ){
db_finalize(&q);
json_set_err(FSL_JSON_E_RESOURCE_NOT_FOUND,
"Report #%d not found.", nReport);
return NULL;
}
pay = cson_sqlite4_row_to_object(q.pStmt);
db_finalize(&q);
|
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
if(!zFmt) zFmt = "o";
db_prepare(&q,
"SELECT sqlcode, "
" title"
" FROM reportfmt"
" WHERE rn=%d",
nReport);
if(SQLITE_ROW != db_step(&q)){
json_set_err(FSL_JSON_E_INVALID_ARGS,
"Report number %d not found.",
nReport);
db_finalize(&q);
goto error;
}
|
|
|
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
if(!zFmt) zFmt = "o";
db_prepare(&q,
"SELECT sqlcode, "
" title"
" FROM reportfmt"
" WHERE rn=%d",
nReport);
if(SQLITE4_ROW != db_step(&q)){
json_set_err(FSL_JSON_E_INVALID_ARGS,
"Report number %d not found.",
nReport);
db_finalize(&q);
goto error;
}
|
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
(unsigned int)blob_size(&sql)));
}
blob_reset(&sql);
colNames = cson_sqlite4_column_names(q.pStmt);
cson_object_set( pay, "columnNames", colNames);
for( i = 0 ; ((limit>0) ?(i < limit) : 1)
&& (SQLITE_ROW == db_step(&q));
++i){
cson_value * row = ('a'==*zFmt)
? cson_sqlite4_row_to_array(q.pStmt)
: cson_sqlite4_row_to_object2(q.pStmt,
cson_value_get_array(colNames));
;
if(row && !tktList){
|
|
|
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
(unsigned int)blob_size(&sql)));
}
blob_reset(&sql);
colNames = cson_sqlite4_column_names(q.pStmt);
cson_object_set( pay, "columnNames", colNames);
for( i = 0 ; ((limit>0) ?(i < limit) : 1)
&& (SQLITE4_ROW == db_step(&q));
++i){
cson_value * row = ('a'==*zFmt)
? cson_sqlite4_row_to_array(q.pStmt)
: cson_sqlite4_row_to_object2(q.pStmt,
cson_value_get_array(colNames));
;
if(row && !tktList){
|