?
Solved

Sybase Windows Command Line BCP - Driver Call To Connect Two End Points Failed

Posted on 2013-11-11
13
Medium Priority
?
1,005 Views
Last Modified: 2013-11-13
I've been doing some Sybase stuff on Linux and have bcp in's and out's working great. Here's my working bcp out on linux:

bcp drd02.dbo.APPL_ENVIRONMENT out APPL_ENVIRONMENT.bcp -U sa -P SyAdmin  -n

When trying the same in Windows, I get the following error:

ct_connect(): network packet layer: internal net library error: Net-Lib protocol
 driver call to connect two endpoints failed

Here's a few pertinent details:

I can connect to my server via iSQL GUI. Its shown as Sybase157 0.0.0.0  5000 and my Drd02 database is online and available.

Contents of the c:\sybase\ini\sql.ini  are (I added the drd02 lines):

[Sybase157_XP]
master=NLWNSCK,0.0.0.0,5001
query=NLWNSCK,0.0.0.0,5001
drd02=NLWNSCK,0.0.0.0,5001

[Sybase157]
master=NLWNSCK,0.0.0.0,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000

[Sybase157_JSAGENT]
master=NLWNSCK,0.0.0.0,4900
query=NLWNSCK,0.0.0.0,4900



The environment variables are:

%DSQUERY%=Sybase157
%SYBASE%=c:\Sybase


No matter what I try, it's just not connecting. I'd be happy for any help that could be provided.
0
Comment
Question by:Jay Redd
[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
  • 8
  • 4
13 Comments
 
LVL 24

Expert Comment

by:Joe Woodhouse
ID: 39641403
Are you using exactly the same command line? If not can you show us your Windows command line?

You might need to try explicitly adding the ASE server name to the bcp command line... I don't put my faith in DSQUERY working correctly...
0
 

Author Comment

by:Jay Redd
ID: 39641789
I tried that:

bcp drd02.dbo.APPL_ENVIRONMENT out APPL_ENVIRONMENT.bcp -U sa -P SyAdmin -S Sybase157 -n

but I get the same result.
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 39641900
Command line environment might be different than GUI environment. Have you tried isql on command line, whether it connects to Sybase157 or not?
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 

Author Comment

by:Jay Redd
ID: 39641956
yes, I can for example run:
    dbisql -host 123.123.123.123 -port 5000 -c "uid=sa;pwd=thepw"  \delivery\create.sql

(where 123.123.123.123 is the box's ip)
0
 
LVL 13

Accepted Solution

by:
alpmoon earned 2000 total points
ID: 39642061
What about command line isql:

isql -U sa -P SyAdmin -S Sybase157

Also can you try the same with IP address like below?

isql -U sa -P SyAdmin -S 123.123.123.123:5000
0
 

Author Comment

by:Jay Redd
ID: 39642084
i have never been able to get -S 123.123.12.3:5000 to work with bcp in linux or windows, I think -S is for referring over to interface (linux) and sql.ini (windows).
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 39642130
It depends on your Open Client version. I think OCS 15.5 and later works with IP address (maybe 15.0 as well).

What about command line isql, does it work?
0
 

Author Comment

by:Jay Redd
ID: 39642133
I figured it out. The fact that i could get into isql with the IP address made me think that maybe 0.0.0.0 is somehow not available to Bcp.

I modified c:\sybase\ini\sql.ini with the following:

from:
[Sybase157]
master=NLWNSCK,0.0.0.0,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000


to:
[Sybase157]
master=NLWNSCK,123.123.123.123,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000

after putting my public IP address of my vm in the sql.ini, bcp was able to speak to it correctly.
0
 

Author Comment

by:Jay Redd
ID: 39642178
I've requested that this question be closed as follows:

Accepted answer: 0 points for Beatscribe's comment #a39642133

for the following reason:

solved it myself
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 39642175
Do you think that my comments didn't help you to find the soultion?
0
 

Author Closing Comment

by:Jay Redd
ID: 39642179
this helped get me there
0
 

Author Comment

by:Jay Redd
ID: 39642184
it did aplmoon, got my brain going, thanks!
0
 

Author Comment

by:Jay Redd
ID: 39645561
I should mention this is just a temporary fix, this will close off sybase_157 from outside traffic i think. you'd need a loopback adaptor or something to do it as a permanent fix.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The Summer 2017 Scholarship Winners have been announced!
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

752 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