I have been trying to learn SQL by doing the exercises on the Learn SQL the Hard Way site. I have made a file in folder on my desktop called ex1.sql, and I have put all of the sqlite3 stuff in PATH. However, I am using Windows Powershell and I cannot perform the command:
sqlite3 ex1.db < ex1.sql
I am getting this error in the Powershell terminal:
At line:1 char:16
+ sqlite3 ex1.db < ex1.sql
+ ~
The '<' operator is reserved for future use.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RedirectionNotSupport
So, I guess '<' can only be used to redirect on Unix OS. I have tried to find an equivalent command in powershell, but I have not found one yet. If anyone has had this problem or knows how to redirect .sql files to .db, then that would be great.
You could try:
get-content ext1.sql | sqllite3 ext1.db
The article has a nice discussion of legacy redirection issues in Powershell and various workarounds:
http://blogs.technet.com/b/heyscriptingguy/archive/2011/07/16/working-around-legacy-redirection-issues-with-powershell.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With