Documentation Source Text

Check-in [4a03d52003]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change exit(1) to return(1) in the quick-start demo programs to avoid having to #include stdlib.h.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4a03d5200328b14c977836aff54238503857b2cf
User & Date: drh 2011-10-13 15:55:57
Context
2011-10-19
17:14
Add tentative release notes for 3.7.9. Update the documentation on the length() and upper() SQL functions. check-in: bb404327e3 user: drh tags: trunk
2011-10-13
15:55
Change exit(1) to return(1) in the quick-start demo programs to avoid having to #include stdlib.h. check-in: 4a03d52003 user: drh tags: trunk
2011-10-11
12:36
Fix requirements marks on ANALYZE documentation. check-in: 5eb8cc7380 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/quickstart.in.

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
13  int main(int argc, char **argv){
14    <b>sqlite3</b> *db;
15    char *zErrMsg = 0;
16    int rc;
17  
18    if( argc!=3 ){
19      fprintf(stderr, "Usage: %s DATABASE SQL-STATEMENT\n", argv&#91;0]);
20      exit(1);
21    }
22    rc = <b>sqlite3_open</b>(argv&#91;1], &db);
23    if( rc ){
24      fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
25      <b>sqlite3_close</b>(db);
26      exit(1);
27    }
28    rc = <b>sqlite3_exec</b>(db, argv&#91;2], callback, 0, &zErrMsg);
29    if( rc!=SQLITE_OK ){
30      fprintf(stderr, "SQL error: %s\n", zErrMsg);
31      <b>sqlite3_free</b>(zErrMsg);
32    }
33    <b>sqlite3_close</b>(db);
34    return 0;
35  }
</pre></blockquote>
</li>
</ul>







|





|












84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
13  int main(int argc, char **argv){
14    <b>sqlite3</b> *db;
15    char *zErrMsg = 0;
16    int rc;
17  
18    if( argc!=3 ){
19      fprintf(stderr, "Usage: %s DATABASE SQL-STATEMENT\n", argv&#91;0]);
20      return(1);
21    }
22    rc = <b>sqlite3_open</b>(argv&#91;1], &db);
23    if( rc ){
24      fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
25      <b>sqlite3_close</b>(db);
26      return(1);
27    }
28    rc = <b>sqlite3_exec</b>(db, argv&#91;2], callback, 0, &zErrMsg);
29    if( rc!=SQLITE_OK ){
30      fprintf(stderr, "SQL error: %s\n", zErrMsg);
31      <b>sqlite3_free</b>(zErrMsg);
32    }
33    <b>sqlite3_close</b>(db);
34    return 0;
35  }
</pre></blockquote>
</li>
</ul>