|
@@ -1024,9 +1024,9 @@ int main(int argc, char *argv[])
|
|
if (Ogr_ftype == OFTInteger || Ogr_ftype == OFTReal) {
|
|
if (Ogr_ftype == OFTInteger || Ogr_ftype == OFTReal) {
|
|
sprintf(buf, ", %s",
|
|
sprintf(buf, ", %s",
|
|
OGR_F_GetFieldAsString(Ogr_feature, i));
|
|
OGR_F_GetFieldAsString(Ogr_feature, i));
|
|
|
|
+ }
|
|
#if GDAL_VERSION_NUM >= 1320
|
|
#if GDAL_VERSION_NUM >= 1320
|
|
/* should we use OGR_F_GetFieldAsDateTime() here ? */
|
|
/* should we use OGR_F_GetFieldAsDateTime() here ? */
|
|
- }
|
|
|
|
else if (Ogr_ftype == OFTDate || Ogr_ftype == OFTTime
|
|
else if (Ogr_ftype == OFTDate || Ogr_ftype == OFTTime
|
|
|| Ogr_ftype == OFTDateTime) {
|
|
|| Ogr_ftype == OFTDateTime) {
|
|
char *newbuf;
|
|
char *newbuf;
|
|
@@ -1038,8 +1038,8 @@ int main(int argc, char *argv[])
|
|
sprintf(buf, ", '%s'", db_get_string(&strval));
|
|
sprintf(buf, ", '%s'", db_get_string(&strval));
|
|
newbuf = G_str_replace(buf, "/", "-"); /* fix 2001/10/21 to 2001-10-21 */
|
|
newbuf = G_str_replace(buf, "/", "-"); /* fix 2001/10/21 to 2001-10-21 */
|
|
sprintf(buf, "%s", newbuf);
|
|
sprintf(buf, "%s", newbuf);
|
|
-#endif
|
|
|
|
}
|
|
}
|
|
|
|
+#endif
|
|
else if (Ogr_ftype == OFTString ||
|
|
else if (Ogr_ftype == OFTString ||
|
|
Ogr_ftype == OFTIntegerList) {
|
|
Ogr_ftype == OFTIntegerList) {
|
|
db_set_string(&strval, (char *)
|
|
db_set_string(&strval, (char *)
|
|
@@ -1048,24 +1048,31 @@ int main(int argc, char *argv[])
|
|
db_double_quote_string(&strval);
|
|
db_double_quote_string(&strval);
|
|
sprintf(buf, ", '%s'", db_get_string(&strval));
|
|
sprintf(buf, ", '%s'", db_get_string(&strval));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ else {
|
|
|
|
+ /* column type not supported */
|
|
|
|
+ buf[0] = 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
/* G_warning (_("Column value not set" )); */
|
|
/* G_warning (_("Column value not set" )); */
|
|
if (Ogr_ftype == OFTInteger || Ogr_ftype == OFTReal) {
|
|
if (Ogr_ftype == OFTInteger || Ogr_ftype == OFTReal) {
|
|
sprintf(buf, ", NULL");
|
|
sprintf(buf, ", NULL");
|
|
-#if GDAL_VERSION_NUM >= 1320
|
|
|
|
}
|
|
}
|
|
- else if (Ogr_ftype == OFTString ||
|
|
|
|
- Ogr_ftype == OFTIntegerList ||
|
|
|
|
- Ogr_ftype == OFTDate) {
|
|
|
|
-#else
|
|
|
|
|
|
+#if GDAL_VERSION_NUM >= 1320
|
|
|
|
+ else if (Ogr_ftype == OFTDate ||
|
|
|
|
+ Ogr_ftype == OFTTime ||
|
|
|
|
+ Ogr_ftype == OFTDateTime) {
|
|
|
|
+ sprintf(buf, ", ''");
|
|
}
|
|
}
|
|
|
|
+#endif
|
|
else if (Ogr_ftype == OFTString ||
|
|
else if (Ogr_ftype == OFTString ||
|
|
Ogr_ftype == OFTIntegerList) {
|
|
Ogr_ftype == OFTIntegerList) {
|
|
-#endif
|
|
|
|
sprintf(buf, ", ''");
|
|
sprintf(buf, ", ''");
|
|
}
|
|
}
|
|
|
|
+ else {
|
|
|
|
+ /* column type not supported */
|
|
|
|
+ buf[0] = 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
db_append_string(&sql, buf);
|
|
db_append_string(&sql, buf);
|
|
}
|
|
}
|