Unix Script to Connect to SQL Server

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Naren12345babu
Premium Member
Premium Member
Posts: 76
Joined: Wed Jan 06, 2016 9:40 am
Location: Bangalore

Unix Script to Connect to SQL Server

Post by Naren12345babu »

Hi All,

Any idea how to write a script to connect to SQL server from unix?

thanks
Naren
Thanks
Naren Babu Ch
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

So you have this big expensive tool that prides itself on connecting to various database platforms... why not use it?
Naren12345babu
Premium Member
Premium Member
Posts: 76
Joined: Wed Jan 06, 2016 9:40 am
Location: Bangalore

Post by Naren12345babu »

Hi

I have to insert XML content present in a file into an XML column in SQL server table. through datastage, I am not able to insert complete XML into single column.
SO , I want to use a Bulk insert command in Unix SQL script and insert this data.

Any help is much appreciated.

thanks
Naren
Thanks
Naren Babu Ch
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

-craig

"You can never have too many knives" -- Logan Nine Fingers
Naren12345babu
Premium Member
Premium Member
Posts: 76
Joined: Wed Jan 06, 2016 9:40 am
Location: Bangalore

Post by Naren12345babu »

Hi Chulette, the post was posted by me only, I am trying to find a way to load xml data into a single column., I am exploring a way thorugh datastage and another way through unix.

do you know how to write a unix script I have to write to connect to SQL Seerver table
Thanks
Naren Babu Ch
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I know that, was just linking the two posts in case anyone cared.

And while I've written many a UNIX script, they've never involved loading anything to SQL Server.
-craig

"You can never have too many knives" -- Logan Nine Fingers
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

My experience with SQL Server is limited, so you'll need to research or find someone better at this to help.

The first design choice is usually a stored procedure. Every DBMS has an API for command lines -- it should be noted that DataStage connectors build those command lines for us -- and building a script around those command lines is easy to look at if difficult to get right.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply