Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CognosScript - Connect To Database

Status
Not open for further replies.

jelledaems

Programmer
Nov 13, 2006
11
0
0
BE
Dear Sir/Madam,

I am writing a macro in cognosScript, but I need to connect to an oracle database to do some select statements in this script.

Can anyone help me in how to make a connection to a database in cognosScript and how to do select statement and use the selected data?

thank you in advance

Kind regards
Jelle
 
Jelle,

Can't help you on Oracle, but here's a snippet as to running SQL against a pre-existing ODBC connection ("UNISON" in this case):

Code:
dim objCmd as Object
dim objRs as Object

Set objCmd = CreateObject("ADODB.Command")
objCmd.ActiveConnection = "DSN=UNISON;UID=geno;PWD="
objCmd.CommandText = "SELECT * FROM mytable"
Set objRS = objCmd.execute
strtest = objRS.Getstring
objRS.close

Set objRS = nothing
Set objCmd = nothing

soi la, soi carré
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top