Retrieving error description for SQL Server

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
prabaharan
Participant
Posts: 2
Joined: Wed Oct 27, 2004 6:43 am
Location: india

Retrieving error description for SQL Server

Post by prabaharan »

In our Job i need error message to capture error message for future reference. i can acquire error code from link variables but not the error message.

Is there any provision in DS to get SQL error message.

Note: I couldn't find any such info in DSGetLinkInfo.

Thanx in advance.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The link variable LASTERR returns the error text.

Beware that, with all Microsoft databases, it tends to be verbose so, if you're wanting to capture it into a table, make sure the column's a wide one!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ailuro
Participant
Posts: 21
Joined: Wed Sep 10, 2003 11:09 pm
Location: GMT+8

Post by ailuro »

DSr7.5 Developer's Help says:
The output link variable, Linkname.LASTERR, contains the last error code on Linkname.

DSGetLinkInfo where InfoType=DSJ.LINKLASTERR
returns the last error message (if any) reported from the link in question.
HTH
prabaharan
Participant
Posts: 2
Joined: Wed Oct 27, 2004 6:43 am
Location: india

Post by prabaharan »

Thanx for ur suggestion.
I tried with LASTERR , but i am getting full logfile message.
My requirement is only capture the error message (ex. constraint violation or datatype mismatch etc...)
garkus
Participant
Posts: 3
Joined: Mon Mar 17, 2003 5:26 pm
Location: USA

reported issue to be fixed mid november

Post by garkus »

I encountered the same issue with both the odbc and drs stages, reported it and am told that this will be addressed in the mid november release of datastage.

prabaharan wrote:Thanx for ur suggestion.
I tried with LASTERR , but i am getting full logfile message.
My requirement is only capture the error message (ex. constraint violation or datatype mismatch etc...)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

LASTERR is "the error text returned by the driver or database server".
Blame Bill Gates.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chaitanyap
Participant
Posts: 8
Joined: Sun Apr 05, 2009 6:00 am
Location: Bangalore

Post by chaitanyap »

We can catch the last error message by using this

DSGetStageInfo (DSJ.ME, DSJ.ME, DSJ.STAGELASTERR)
Post Reply