I'm trying to open an ODBC connection to an oracle database from a macro that automates Transformer Cube builds....In the Macro I also need to update a table on the database side with cube success/failure information. I have already coded the select statement that returns rows after opening an odbc connection, but not sure how the update would work.
thanks in advance!
The following select statement works:
'--------Open ODBC Connection----------
'Test database ogdw connection
connection = SQLOpen("DSN=ogdw; UID=xxxx; PWD=xxxx", outputStr, intPrompt)
'
'
If connection < 0 Then 'Connection stopped
MsgBox "Error: " & connection
Exit Sub
End If
'
MsgBox "Connected !"
'------------Enter Select Statement--------------
strQuery = "select ogdw_source_system_code, ogdw_subject_area, ogdw_mrt_process_started_date, ogdw_mrt_process_started_flag, ogdw_mrt_process_complete_date, ogdw_mrt_process_complete_flag from ogdwstg.ogdw_batch_proc_cntl where ogdw_source_system_code in ('O', 'P') and ogdw_subject_area='MV' and ogdw_mrt_process_complete_flag='Y'"
'
'-----------EXECUTE QUERY-------------------------------
'
lngNbColumn = SQLExecQuery(connection , strQuery)
If lngNbColumn < 0 Then 'Query Error
msgbox "Error " & lngNbColumn & " occurred during query execution"
'
Else
lngNbLine = SQLRetrieve(connection ,varLine, lngNbColumn , , 0, ,0)
End If
thanks in advance!
The following select statement works:
'--------Open ODBC Connection----------
'Test database ogdw connection
connection = SQLOpen("DSN=ogdw; UID=xxxx; PWD=xxxx", outputStr, intPrompt)
'
'
If connection < 0 Then 'Connection stopped
MsgBox "Error: " & connection
Exit Sub
End If
'
MsgBox "Connected !"
'------------Enter Select Statement--------------
strQuery = "select ogdw_source_system_code, ogdw_subject_area, ogdw_mrt_process_started_date, ogdw_mrt_process_started_flag, ogdw_mrt_process_complete_date, ogdw_mrt_process_complete_flag from ogdwstg.ogdw_batch_proc_cntl where ogdw_source_system_code in ('O', 'P') and ogdw_subject_area='MV' and ogdw_mrt_process_complete_flag='Y'"
'
'-----------EXECUTE QUERY-------------------------------
'
lngNbColumn = SQLExecQuery(connection , strQuery)
If lngNbColumn < 0 Then 'Query Error
msgbox "Error " & lngNbColumn & " occurred during query execution"
'
Else
lngNbLine = SQLRetrieve(connection ,varLine, lngNbColumn , , 0, ,0)
End If