Changeset 5907 for trunk/glueforge/templates/psdb/insert.tt
- Timestamp:
- Jan 5, 2006, 2:16:35 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/glueforge/templates/psdb/insert.tt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/glueforge/templates/psdb/insert.tt
r4341 r5907 1 bool [% namespace %]Insert(psDB * dbh,1 bool [% table.namespace %]Insert(psDB * dbh, 2 2 [%- SET i = 0 -%] 3 [% FOREACH item = columns -%]3 [% FOREACH item = table.columns -%] 4 4 [% IF i == 0 %][% i = 1 %] [% ELSE %], [% END -%] 5 5 [% IF item.type == "STR" -%] … … 15 15 16 16 md = psMetadataAlloc(); 17 [% FOREACH item = columns -%]17 [% FOREACH item = table.columns -%] 18 18 [% IF item.type == "S32" or item.type == "F32" or item.type == "F64" -%] 19 if (!psMetadataAdd[% item.type %](md, PS_LIST_TAIL, "[% item.name %]", NULL, [% item.name %])) {19 if (!psMetadataAdd[% item.type %](md, PS_LIST_TAIL, "[% item.name %]", 0, NULL, [% item.name %])) { 20 20 [% ELSIF item.type == "STR" -%] 21 if (!psMetadataAddStr(md, PS_LIST_TAIL, "[% item.name %]", NULL, psStringCopy([% item.name %]))) {21 if (!psMetadataAddStr(md, PS_LIST_TAIL, "[% item.name %]", 0, NULL, psStringCopy([% item.name %]))) { 22 22 [% ELSIF item.type == "BOOL" -%] 23 if (!psMetadataAdd(md, PS_LIST_TAIL, "[% item.name %]", PS_ META_BOOL, NULL, [% item.name %])) {23 if (!psMetadataAdd(md, PS_LIST_TAIL, "[% item.name %]", PS_DATA_BOOL, NULL, [% item.name %])) { 24 24 [% END -%] 25 25 psError(PS_ERR_UNKNOWN, false, "failed to add item [% item.name %]"); … … 29 29 [% END -%] 30 30 31 status = psDBInsertOneRow(dbh, [% namespace FILTER upper %]_TABLE_NAME, md);31 status = psDBInsertOneRow(dbh, [% table.namespace FILTER upper %]_TABLE_NAME, md); 32 32 psFree(md); 33 33
Note:
See TracChangeset
for help on using the changeset viewer.
