preethi
preethi

Reputation: 905

run and execute text file using sqlite 3 command line

I have a text file which contains an sqlite statment where I want to dump it into .sql format but not able to excute it. Any help would be appreciated. My file is stored on desktop as verbali.txt and when i go to command prompt and to specific sqlite folder and run it just open the text file .

.mode insert 
.header on
.out file.sql 
select select Id   ,CompanyId  ,DateTime  ,Serial  ,DeviceId  ,AgentAId  ,GpsAddress  ,Targa  ,CommonRoadDescription  ,RoadCivicNumber  ,VehicleBrandDescription  ,VehicleModelDescription  ,VerbaliVehicleTypeDescription  ,CommonColorVehicleDescription  ,VerbaliRuleOneCode  ,VerbaliRuleOneDescription  ,VerbaliRuleOnePoints  ,VerbaliClosedNoteDescription  ,Points  ,VerbaliMissedNotificationDescription  ,MissedNotificationNote  ,StatementNote  from VerbaliData

Upvotes: 0

Views: 3375

Answers (1)

laalto
laalto

Reputation: 152787

Pipe the file to sqlite3, in command prompt:

sqlite3 yourdatabase.db <path\to\verbali.txt

where sqlite3 is the sqlite3.exe command line tool.

Upvotes: 1

Related Questions