Question

It is my first time working with TextWrangler. I am using it to open a .sql file. But when I try to run the file I get the following error:

 This file doesn’t appear to contain a valid ‘shebang’ line (application error code: 13304)

I tried to look at some other posts on StackOverflow, and I think I understood that the problem is the insertion of a line that contains the # symbol, but I cannot figure out how to fix it.

The file starts like this:

 BEGIN TRANSACTION;
 INSERT INTO ......
Was it helpful?

Solution

Textwrangler is not a Database frontend nor can it execute SQL. You must specify a program to be executed when you select run from the menu. And this is done with the shebang line, which, for example, could be "#!/usr/bin/psql" (as first line of the file and w/o the quotes) if you want Postgresql's psql command to execute the SQL statements on a unixoid system.

OTHER TIPS

if you want to run the file by terminal , you should save the file like file.py and not .txt...go to #! and choose run in terminal or you go in terminal and recall : python file.py

i don't know if i helped somebody but i hope it :D

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top