Solved

dbisql

Posted on 2014-11-04
5
660 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 26

Assisted Solution

by:wilcoxon
wilcoxon earned 500 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 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