Solved

dbisql

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now