diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/shell.c b/src/shell.c index cfaa2a4cf..b263de926 100644 --- a/src/shell.c +++ b/src/shell.c @@ -989,7 +989,16 @@ static int shell_callback( case MODE_Insert: { p->cnt++; if( azArg==0 ) break; - fprintf(p->out,"INSERT INTO %s VALUES(",p->zDestTable); + fprintf(p->out,"INSERT INTO %s",p->zDestTable); + if( p->showHeader ){ + fprintf(p->out,"("); + for(i=0; i<nArg; i++){ + char *zSep = i>0 ? ",": ""; + fprintf(p->out, "%s%s", zSep, azCol[i]); + } + fprintf(p->out,")"); + } + fprintf(p->out," VALUES("); for(i=0; i<nArg; i++){ char *zSep = i>0 ? ",": ""; if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){ |