Changeset 5950 for trunk/glueforge/templates/psdb/insertobject_c.tt
- Timestamp:
- Jan 6, 2006, 6:46:10 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/glueforge/templates/psdb/insertobject_c.tt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/glueforge/templates/psdb/insertobject_c.tt
r5907 r5950 7 7 int main () 8 8 { 9 psDB *dbh; 10 [% indented(table.object_name, "*object") %]; 9 [% FOREACH table = tables -%] 10 { 11 psDB *dbh; 12 [% indented(table.object_name, "*object") %]; 11 13 12 dbh = psDBInit("localhost", "test", NULL, "test");13 if (!dbh) {14 exit(EXIT_FAILURE);15 }14 dbh = psDBInit("localhost", "test", NULL, "test"); 15 if (!dbh) { 16 exit(EXIT_FAILURE); 17 } 16 18 17 object = [% table.object_name %]Alloc(19 object = [% table.object_name %]Alloc( 18 20 [%- SET i = 0 -%] 19 21 [%- FOREACH item = table.columns -%] … … 21 23 [%- END -%] 22 24 ); 23 if (!object) { 24 exit(EXIT_FAILURE); 25 if (!object) { 26 exit(EXIT_FAILURE); 27 } 28 29 if (![% table.namespace %]InsertObject(dbh, object)) { 30 exit(EXIT_FAILURE); 31 } 32 33 psFree(object); 34 psDBCleanup(dbh); 25 35 } 26 36 27 if (![% table.namespace %]InsertObject(dbh, object)) { 28 exit(EXIT_FAILURE); 29 } 30 31 psFree(object); 32 psDBCleanup(dbh); 33 37 [% END -%] 34 38 exit(EXIT_SUCCESS); 35 39 }
Note:
See TracChangeset
for help on using the changeset viewer.
