[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 939
  • Last Modified:

dbisql

Hi,
I have a sql query that works in Interactive SQL, I would like to automate the query so I can the results in a file at the same time each day using dbisql.

I have the batch file (export.bat)
REM Generate File

d:
cd \Export\

dbisql -q SalesExport1.sql

REM End of Script

When I run this I get the error
Unable to open database connection.
[Sybase][ODBC Driver][SQL Anywhere]Database server not found[Sybase][ODBC Driver
][SQL Anywhere]Database server not found

SalesExport1.sql
//Import Routine

connect custom identified by custom;

SELECT item…………………….


I have tried these two connection also:

dbisql.exe "UID=custom;PWD=custom";
CONNECT
USING 'UID=custom;PWD=custom;DBN=micros';

I am running Interactive SQL Version 11.0.1, build 2596

What should the connection string be?
0
hellblazeruk
Asked:
hellblazeruk
  • 2
  • 2
2 Solutions
 
Dany BalianCTOCommented:
try this: 'DSN=micros;UID=custom;PWD=custom'
0
 
wilcoxonCommented:
Per the docs I've found, it should be:
dbisql.exe -c "Server=server-name;DBN=micros;UID=custom;PWD=custom" -q SalesExport1.sql

Open in new window

You seem to be missing the Server= portion of the connection string.
0
 
Dany BalianCTOCommented:
and also a side note, if you're using odbc, you have to make sure that you have an odbc data source named micros that has your server name in it
0
 
hellblazerukAuthor Commented:
dbisql.exe -datasource NAME -c Server=SERVER-NAME;UID=custom;PWD=custom -q SalesExport1.sql
0
 
hellblazerukAuthor Commented:
Thanks Wilcoxon, just need to adjust your solution.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now