Solved

dbisql

Posted on 2014-11-04
5
690 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: 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

Suggested Solutions

Title # Comments Views Activity
To form a query 10 413
installing Sybase IQ express edition 15.4 16 922
How to join 2 tables in a SELECT clause using Sybase? 4 1,962
Crystal Reports 8.5 hangs 11 120
After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
Suggested Courses

734 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