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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import into Excel from Oracle

Status
Not open for further replies.

nettacox

MIS
Oct 8, 2004
2
US
I have my ODBC setup and able to bring in selected data, but in row and table format. I am looking to bring very specific data from multiple Oracle tables into very specific cells in Excel. My user has an excel "template" that is formatted and I need to bring in data from Oracle tables and it to refresh when opened. There are two specific issue:
1) I would like to be prompted for a specific identifer to only bring in
one specific row from these tables (i.e vendor id=XXXXX)
2) I would like to only bring in specific data from this table and into
specific cells (i.e vendor name goes into cell C3 and vendor classifcation
goes into cell C10).

Is this possible and if so any recommendations on how to accomplish? I am a Cognos girl and not sure how to accomplish this within Excel. I appreciate any gudiance.
 
How are you currently retreiving data from your Oracle tables?

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
hi,

Here's an example of a user-defined function making a Oracle database call to return a data value, for a given criteria value...
Code:
Function GetPN(sTRAV As String) As String
'--------------------------------------------------
' Access: A010PROD.FPRPTSAR.READ
'--------------------------------------------------
'gets Part Number for a given Traveler
'--------------------------------------------------
    Dim sConn As String, sSQL As String, sServer As String
    Dim rst As ADODB.Recordset, cnn As ADODB.Connection
    Dim i As Integer
    
    Set cnn = New ADODB.Connection
    
    sServer = "a010PROD"
    cnn.Open "Driver={Microsoft ODBC for Oracle};" & _
               "Server=" & sServer & ";" & _
               "Uid=/;" & _
               "Pwd="
    
    Set rst = New ADODB.Recordset
    
    sSQL = "SELECT Part_ID "
    sSQL = sSQL & "FROM FPRPTSAR.MFG_ORDER_INFO "
    sSQL = sSQL & "WHERE mfg_ord='" & sTRAV & "' "
    
    rst.Open sSQL, cnn, adOpenStatic, adLockReadOnly, adCmdText
    rst.MoveFirst
    
    GetPN = rst(0)
    
    rst.Close
    cnn.Close
    
    Set rst = Nothing
    Set cnn = Nothing
End Function


Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top