Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

dbisql

Posted on 2014-11-04
5
Medium Priority
?
872 Views
Last Modified: 2014-11-10
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
Comment
Question by:hellblazeruk
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40422071
try this: 'DSN=micros;UID=custom;PWD=custom'
0
 
LVL 27

Assisted Solution

by:wilcoxon
wilcoxon earned 2000 total points
ID: 40422073
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
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40422087
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
 

Accepted Solution

by:
hellblazeruk earned 0 total points
ID: 40423981
dbisql.exe -datasource NAME -c Server=SERVER-NAME;UID=custom;PWD=custom -q SalesExport1.sql
0
 

Author Closing Comment

by:hellblazeruk
ID: 40432298
Thanks Wilcoxon, just need to adjust your solution.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know there are services out there that can turn an Instagram feed into an RSS feed? I found some interesting exclusive Instagram content which I wanted to follow without signing up for yet another social media account. RSS to the rescue!
Transferring FSMO roles is done when an admin wants to split roles between certain Domain Controllers or the Domain Controller holding the Roles has been forcefully demoted using dcpromo / forceremoval
Integration Management Part 2
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question