Forum Stats

  • 3,874,176 Users
  • 2,266,677 Discussions
  • 7,911,754 Comments

Discussions

Using a SQL-file from a batch file

Peter2_1
Peter2_1 Member Posts: 275 Red Ribbon

Prolog:

Here is a similar discussion for a single statement:


On a windows machine I want to

  • create a SQL-file with a statement for "spool ... select ..", stored in "my_statement.sql"
  • call it from Windows with a batch-file which contains the commands ..
    1. connect to database
    2. call and run the SQL file
    3. disconnect from database

If possible / better I can also connect and disconnect manually, but when it is connected I should call an SQL-file next to the other. Here I would call a software like Autohotkey which fires the batch(es) immediately when they are created.

Is it possible? How?

Thanks for help!