Page 1 of 1

HOW TO CAPTURE DATABASE CONNECTION ERROR

Posted: Fri Apr 21, 2006 7:45 am
by ketanshah123
HI ALL
m CREATING A JOB WHICH WILL ACCESS A STORED PROCEDURE
BUT BEFORE ACCESSING STORED PROCEDURE HAVE TO CHECK WHETHER CONEECTION WITH DATBASE IS SUCCESSFUL OR NOT ?

CURRENTLY I HAD IMPLEMENTED THE JOB AS
STORED PROCEDURE STAGE -------->SEQUETIAL FILE STAGE

THE SEQUENTIAL FILE STAGE IS TO CAPTURE THE ERROR CODE RETURN BY STORED PROCEDURE AND M USING DB2 UDB ON AIX (OS)

SO PLZ SUGGEST HOW TO CHECK DATABASE CONECTION SUCCES ?
OR ANY OTHER WAY TO THIS JOB.......

Posted: Fri Apr 21, 2006 7:53 am
by DSguru2B
You can have a seperate job prior to the job using the stored procedure.
Have a DB stage ( whichever one you are using ) point to a transformer and then to a flat file.
In the DB stage enter a custom sql - select 1 from dual. Give the condition in the transformer and according to your requirements write into the flat file the result.
On top of that you can have another job to read the result and progress accordingly or have a job control script read the result from the file.
IHTH.

Posted: Fri Apr 21, 2006 8:02 am
by chulett
FYI - Typing in all caps is fine for a COBOL program, but on the web it is considered SHOUTING. Please use your 'inside voice' here. :wink:

Posted: Mon Apr 24, 2006 1:26 am
by sb_akarmarkar
Hi,

When a server job is validated,

Connections are made to the data sources or data warehouse
without actually extracting, converting, or writing data

i think you can use validate to solve you problem.


Thanks,
Anupam

Posted: Mon Apr 24, 2006 1:37 am
by ray.wurlod
You marked your job type as "parallel" but posted your question in the server forum. Which is the correct job type?

Posted: Mon Apr 24, 2006 3:04 am
by ketanshah123
hi
the job is of parallel type..........

Posted: Mon Apr 24, 2006 4:39 pm
by ray.wurlod
Your original approach is the most sound. Create a small job that runs a simple query, and detect the error information in that. You can use a Routine that inspects its log, or you can use link variables in the job itself.

This is run in a job sequence that decides whether to run the main job depending on whether the first connection was successful.

Posted: Thu Apr 27, 2006 12:41 am
by ketanshah123
hi ray ,
as m new to this tool can you tell me how to caputre the error return by querry or use link var, or routine that inspects the log.......

Is anyway it is possible to include / import log generated by DS Director to a text file so that I can attach that in mail.Though I am including job status in mail but its not much explainatory to detect exact reason for failure compared to one generated by DS Director.

Posted: Thu Apr 27, 2006 12:59 am
by ray.wurlod
ketanshah123 wrote:as m new to this tool can you tell me how to caputre the error return by querry or use link var, or routine that inspects the log.......
Is anyway it is possible to include / import log generated by DS Director to a text file so that I can attach that in mail.Though I am including job status in mail but its not much explainatory to detect exact reason for failure compared to one generated by DS Director.
You can write a routine that uses the DSGetLog... functions to interrogate the log. While interrogating, your routine can also write whatever you like into a text file (search for OpenSeq and WriteSeq commands), and this can be attached to any email.