Changeset 903 for branches/prototype-v0/thirds
- Timestamp:
- Apr 19, 2019, 4:08:59 PM (6 years ago)
- Location:
- branches/prototype-v0/thirds/zcfg2sql
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/thirds/zcfg2sql/Makefile
r839 r903 4 4 CC=gcc 5 5 6 ifeq (${CALLBACK_FILE},service_callback.o) 7 CALLBACK_FILES=${ZRPATH}/zoo-kernel/${CALLBACK_FILE} ${ZRPATH}/zoo-kernel/ulinet.o ${ZRPATH}/zoo-kernel/caching.o 8 else 9 CALLBACK_FILES= 10 endif 6 11 zcfg2sql: zcfg2sql.c 7 12 g++ -g -O2 ${JSCFLAGS} ${RUBYCFLAGS} ${XML2CFLAGS} ${LCFLAGS} -c zcfg2sql.c -fno-common -DPIC -o zcfg2sql.o 8 g++ ${XML2CFLAGS} ${LCFLAGS} zcfg2sql.o ${ ZRPATH}/zoo-kernel/server_internal.o ${ZRPATH}/zoo-kernel/service_internal.o ${ZRPATH}/zoo-kernel/${MS_FILE} ${ZRPATH}/zoo-kernel/response_print.o ${ZRPATH}/zoo-kernel/lex.cr.o ${ZRPATH}/zoo-kernel/lex.sr.o ${ZRPATH}/zoo-kernel/service_conf.tab.o ${ZRPATH}/zoo-kernel/main_conf_read.tab.o ${ZRPATH}/zoo-kernel/${YAML_FILE} -o zcfg2sql -L${ZRPATH}/zoo-kernel/ ${LDFLAGS}13 g++ ${XML2CFLAGS} ${LCFLAGS} zcfg2sql.o ${CALLBACK_FILES} ${ZRPATH}/zoo-kernel/server_internal.o ${ZRPATH}/zoo-kernel/service_internal.o ${ZRPATH}/zoo-kernel/${MS_FILE} ${ZRPATH}/zoo-kernel/response_print.o ${ZRPATH}/zoo-kernel/lex.cr.o ${ZRPATH}/zoo-kernel/lex.sr.o ${ZRPATH}/zoo-kernel/service_conf.tab.o ${ZRPATH}/zoo-kernel/main_conf_read.tab.o ${ZRPATH}/zoo-kernel/${YAML_FILE} -o zcfg2sql -L${ZRPATH}/zoo-kernel/ ${LDFLAGS} 9 14 10 15 clean: -
branches/prototype-v0/thirds/zcfg2sql/zcfg2sql.c
r839 r903 2 2 * Author : Gérald FENOY 3 3 * 4 * Copyright (c) 2017 GeoLabs SARL. All rights reserved.4 * Copyright (c) 2017-2019 GeoLabs SARL. All rights reserved. 5 5 * 6 6 * Permission is hereby granted, free of charge, to any person obtaining a copy … … 96 96 if(values[2]!=NULL) 97 97 fprintf(f,"UPDATE CollectionDB.LiteralDataDomain \n" 98 "set uom = (SELECT id from CollectionDB.Primitive Datatypes WHERE name=$q$%s$q$\n WHERE id = \n"98 "set uom = (SELECT id from CollectionDB.PrimitiveUOM WHERE uom=$q$%s$q$) \n WHERE id = \n" 99 99 " (SELECT last_value FROM CollectionDB.ows_DataDescription_id_seq);\n ", 100 100 values[2]->value); … … 299 299 getMap(tmpio->content,"AllowedValues") 300 300 }; 301 map* values0[4]={ 302 getMap(tmp->defaults->content,"dataType"), 303 getMap(tmp->defaults->content,"value"), 304 getMap(tmp->defaults->content,"uom"), 305 getMap(tmp->defaults->content,"AllowedValues") 306 }; 301 307 char *fields[20]={ 302 308 "default_value", … … 305 311 fprintf(f,"INSERT INTO CollectionDB.LiteralDataDomain" 306 312 " (def,data_type_id) VALUES \n(false,"); 307 fprintf(f,"(SELECT id from CollectionDB.PrimitiveDatatypes" 308 " where name = '%s'));\n",values[0]->value); 313 if(values[0]!=NULL) 314 fprintf(f,"(SELECT id from CollectionDB.PrimitiveDatatypes" 315 " where name = '%s'));\n",values[0]->value); 316 else 317 fprintf(f,"(SELECT id from CollectionDB.PrimitiveDatatypes" 318 " where name = '%s'));\n",values0[0]->value); 309 319 if(values[1]!=NULL) 310 320 fprintf(f,"UPDATE CollectionDB.LiteralDataDomain \n" … … 312 322 " ((SELECT last_value FROM CollectionDB.ows_DataDescription_id_seq));\n ", 313 323 fields[0],values[1]->value); 324 if(values[2]!=NULL) 325 fprintf(f,"UPDATE CollectionDB.LiteralDataDomain \n" 326 "set uom = (SELECT id from CollectionDB.PrimitiveUOM WHERE uom=$q$%s$q$) \n WHERE id = \n" 327 " (SELECT last_value FROM CollectionDB.ows_DataDescription_id_seq);\n ", 328 values[2]->value); 329 if(type!=NULL) 314 330 fprintf(f,"INSERT INTO CollectionDB.%sDataDescriptionAssignment" 315 331 " (%s_id,data_description_id) VALUES "
Note: See TracChangeset
for help on using the changeset viewer.