I am trying to execute a select statement from a datastage server routine.
It was ok and was working on datastage 7.5 but now, on 8.1 version it doesn't work.
The parameters that I pass to the SqlConnect function are correct, they work on 7.5 version.
Thanks a lot for help...
This is the code:
$INCLUDE UNIVERSE.INCLUDE ODBC.H
* Extract Argnuments from InputArg
RoutineName = 'ExecControl'
henv = SQL.NULL.HENV
hdbc = SQL.NULL.HDBC
hstmt = SQL.NULL.HSTMT
Ans = 0
Connected = @FALSE
* THIS IS OK
Res = SQLAllocEnv(henv)
if Res <> SQL.SUCCESS then
Message = "Error in henv":status
Call DSLogWarn(Message,RoutineName)
Ans = 90
End Else
* THIS IS OK
Res = SQLAllocConnect(henv,hdbc)
if Res <> SQL.SUCCESS then
Message = "Error in henv":status
Call DSLogWarn(Message,RoutineName)
Ans = 91
End Else
* THIS DOESN'T WORK, status <> SQL.SUCCESS
status = SQLConnect(hdbc,DNS_NAME,ODS_USER,ODS_PWD)
if status <> SQL.SUCCESS then
Message = "Error in henv":status
Call DSLogWarn(Message,RoutineName)
Ans = 92
End Else ....
Problem with SQLConnect
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 16
- Joined: Fri Mar 28, 2003 4:36 am
- Location: Italy - Roma
-
- Participant
- Posts: 16
- Joined: Fri Mar 28, 2003 4:36 am
- Location: Italy - Roma
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 16
- Joined: Fri Mar 28, 2003 4:36 am
- Location: Italy - Roma
-
- Participant
- Posts: 16
- Joined: Fri Mar 28, 2003 4:36 am
- Location: Italy - Roma
I did like this:ray.wurlod wrote:That's just SQL.ERROR. You have to call SQLError() repeatedly to strip the error information off the handle, to learn precisely what went wrong. ...
* THIS DOESN'T WORK, status <> SQL.SUCCESS
status = SQLConnect(hdbc,DNS_NAME,ODS_USER,ODS_PWD)
if status <> SQL.SUCCESS then
Ans = SQLError(hEnv,hConn,"SQLConnect(hConn,DNS_NAME,ODS_USER,ODS_PWD)",SQLstate,DBMSCode,ErrText) End Else ....
and the result of the SQLError function was -2, but I don't know wath does it mean.
Angelo
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: