Can someone tell me how I can access the return value of a function
called from Oracle as opposed to a store proc from oracle? my oracle
function is get_num_dates_varposfile. I am only used to using this
method with store procs that dont return a value back to Access. Hope
this makes sense.
Set Cmd = New Command
With Cmd
Set .ActiveConnection = get_XE_Conn 'makes a connection
Oracle XE
.CommandType = adCmdStoredProc
.CommandText = "pkg_EQRISK.get_num_dates_varposfile"
'returns the number of
distinct dates in tmp_varposition table using Oracle proc
.Execute , , adExecuteNoRecords
End With
Set Cmd = Nothing
Private m_conn As ADODB.Connection
Public Function get_XE_Conn() As ADODB.Connection
If m_conn Is Nothing Then
Set m_conn = New ADODB.Connection
End If
If m_conn.State <adStateOpen Then
m_conn.Open "PROVIDER=MSDAORA.1;USER
ID=EQRISK;PASSWORD=eq;DATA SOURCE=XE;"
'//m_conn.Open "Driver={Oracle in
XE};Server=XE;Uid=EQRISK;Pwd=eq;"
'//m_conn.Open "ODBC;DSN=EQRISK;DBQ=XE;UID=EQRISK;PWD=eq"
End If
Set get_XE_Conn = m_conn
End Function 8 11226
colmkav wrote:
Can someone tell me how I can access the return value of a function
called from Oracle as opposed to a store proc from oracle? my oracle
function is get_num_dates_varposfile. I am only used to using this
method with store procs that dont return a value back to Access. Hope
this makes sense.
I didn't look closely at your code as I stick exclusively to DAO when
writing mdbs against Oracle back ends (which is what all my work
comprises), but have you tried running:
Select get_num_dates_varposfile from dual
Or whatever SQL statement is required to get the function to run in SQL
Plus via a pass through query with returns records set to true?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
On Jul 12, 10:10 am, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
colmkav wrote:
Can someone tell me how I can access the return value of a function
called from Oracle as opposed to a store proc from oracle? my oracle
function is get_num_dates_varposfile. I am only used to using this
method with store procs that dont return a value back to Access. Hope
this makes sense.
I didn't look closely at your code as I stick exclusively to DAO when
writing mdbs against Oracle back ends (which is what all my work
comprises), but have you tried running:
Select get_num_dates_varposfile from dual
Or whatever SQL statement is required to get the function to run in SQL
Plus via a pass through query with returns records set to true?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
FWIW, this works for me (VBScript example):
Option Explicit
Dim con, rst
Set con = CreateObject("ADODB.Connection")
con.CursorLocation = 3 ' adUseClient
con.Properties("Prompt") = 2 ' adPromptComplete
con.Open "DSN=Oracle ODBC local GDT;"
Set rst = CreateObject("ADODB.Recordset")
rst.Open _
"SELECT MYTESTFUNC FROM DUAL", _
con, 3, 1
Wscript.Echo rst(0).Value
rst.Close
Set rst = Nothing
con.Close
Set con = Nothing
On 12 Jul, 19:47, Gord <g...@kingston.netwrote:
On Jul 12, 10:10 am, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
colmkav wrote:
Can someone tell me how I can access the return value of a function
called from Oracle as opposed to a store proc from oracle? my oracle
function is get_num_dates_varposfile. I am only used to using this
method with store procs that dont return a value back to Access. Hope
this makes sense.
I didn't look closely at your code as I stick exclusively to DAO when
writing mdbs against Oracle back ends (which is what all my work
comprises), but have you tried running:
Select get_num_dates_varposfile from dual
Or whatever SQL statement is required to get the function to run in SQL
Plus via a pass through query with returns records set to true?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
FWIW, this works for me (VBScript example):
Option Explicit
Dim con, rst
Set con = CreateObject("ADODB.Connection")
con.CursorLocation = 3 ' adUseClient
con.Properties("Prompt") = 2 ' adPromptComplete
con.Open "DSN=Oracle ODBC local GDT;"
Set rst = CreateObject("ADODB.Recordset")
rst.Open _
"SELECT MYTESTFUNC FROM DUAL", _
con, 3, 1
Wscript.Echo rst(0).Value
rst.Close
Set rst = Nothing
con.Close
Set con = Nothing- Hide quoted text -
- Show quoted text -
thanks. I guess this would work.
Do you know if its possible to return the return value of an Oracle
function in cases where a recordset? I know how to do this via a
stored proc but not a function.
On Jul 16, 5:21 am, colmkav <colmj...@yahoo.co.ukwrote:
On 12 Jul, 19:47, Gord <g...@kingston.netwrote:
On Jul 12, 10:10 am, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
colmkav wrote:
Can someone tell me how I can access the return value of a function
called from Oracle as opposed to a store proc from oracle? my oracle
function is get_num_dates_varposfile. I am only used to using this
method with store procs that dont return a value back to Access. Hope
this makes sense.
I didn't look closely at your code as I stick exclusively to DAO when
writing mdbs against Oracle back ends (which is what all my work
comprises), but have you tried running:
Select get_num_dates_varposfile from dual
Or whatever SQL statement is required to get the function to run in SQL
Plus via a pass through query with returns records set to true?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
FWIW, this works for me (VBScript example):
Option Explicit
Dim con, rst
Set con = CreateObject("ADODB.Connection")
con.CursorLocation = 3 ' adUseClient
con.Properties("Prompt") = 2 ' adPromptComplete
con.Open "DSN=Oracle ODBC local GDT;"
Set rst = CreateObject("ADODB.Recordset")
rst.Open _
"SELECT MYTESTFUNC FROM DUAL", _
con, 3, 1
Wscript.Echo rst(0).Value
rst.Close
Set rst = Nothing
con.Close
Set con = Nothing- Hide quoted text -
- Show quoted text -
thanks. I guess this would work.
Do you know if its possible to return the return value of an Oracle
function in cases where a recordset? I know how to do this via a
stored proc but not a function.
Sorry, I don't understand your question.
On 16 Jul, 17:53, Gord <g...@kingston.netwrote:
On Jul 16, 5:21 am, colmkav <colmj...@yahoo.co.ukwrote:
On 12 Jul, 19:47, Gord <g...@kingston.netwrote:
On Jul 12, 10:10 am, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
colmkav wrote:
Can someone tell me how I can access the return value of a function
called from Oracle as opposed to a store proc from oracle? my oracle
function is get_num_dates_varposfile. I am only used to using this
method with store procs that dont return a value back to Access. Hope
this makes sense.
I didn't look closely at your code as I stick exclusively to DAO when
writing mdbs against Oracle back ends (which is what all my work
comprises), but have you tried running:
Select get_num_dates_varposfile from dual
Or whatever SQL statement is required to get the function to run in SQL
Plus via a pass through query with returns records set to true?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
FWIW, this works for me (VBScript example):
Option Explicit
Dim con, rst
Set con = CreateObject("ADODB.Connection")
con.CursorLocation = 3 ' adUseClient
con.Properties("Prompt") = 2 ' adPromptComplete
con.Open "DSN=Oracle ODBC local GDT;"
Set rst = CreateObject("ADODB.Recordset")
rst.Open _
"SELECT MYTESTFUNC FROM DUAL", _
con, 3, 1
Wscript.Echo rst(0).Value
rst.Close
Set rst = Nothing
con.Close
Set con = Nothing- Hide quoted text -
- Show quoted text -
thanks. I guess this would work.
Do you know if its possible to return the return value of an Oracle
function in cases where a recordset? I know how to do this via a
stored proc but not a function.
Sorry, I don't understand your question.- Hide quoted text -
- Show quoted text -
What I mean is if I run a stored procedure I know how to return a
value through one of the parameters
eg
Dim UpdateCmd As ADODB.Command
Set Cmd = New Command
With Cmd
Set .ActiveConnection = get_XE_Conn 'makes a connection
Oracle XE
.CommandType = adCmdStoredProc
.CommandText = "pkg_EQRISK.get_num_dates_Varposfile"
'returns the no. of distinct dates
in tmp_varposition using Oracle proc
.Execute , , adExecuteNoRecords
End With
debug.print Cmd(1)
however, if I want to write it as a function I am not sure how to do
this. (Cmd(1) returns the value in the 2nd parameter)
On Jul 17, 3:33 am, colmkav <colmj...@yahoo.co.ukwrote:
On 16 Jul, 17:53, Gord <g...@kingston.netwrote:
On Jul 16, 5:21 am, colmkav <colmj...@yahoo.co.ukwrote:
On 12 Jul, 19:47, Gord <g...@kingston.netwrote:
On Jul 12, 10:10 am, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
colmkav wrote:
Can someone tell me how I can access the return value of a function
called from Oracle as opposed to a store proc from oracle? my oracle
function is get_num_dates_varposfile. I am only used to using this
method with store procs that dont return a value back to Access. Hope
this makes sense.
I didn't look closely at your code as I stick exclusively to DAO when
writing mdbs against Oracle back ends (which is what all my work
comprises), but have you tried running:
Select get_num_dates_varposfile from dual
Or whatever SQL statement is required to get the function to run in SQL
Plus via a pass through query with returns records set to true?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
FWIW, this works for me (VBScript example):
Option Explicit
Dim con, rst
Set con = CreateObject("ADODB.Connection")
con.CursorLocation = 3 ' adUseClient
con.Properties("Prompt") = 2 ' adPromptComplete
con.Open "DSN=Oracle ODBC local GDT;"
Set rst = CreateObject("ADODB.Recordset")
rst.Open _
"SELECT MYTESTFUNC FROM DUAL", _
con, 3, 1
Wscript.Echo rst(0).Value
rst.Close
Set rst = Nothing
con.Close
Set con = Nothing- Hide quoted text -
- Show quoted text -
thanks. I guess this would work.
Do you know if its possible to return the return value of an Oracle
function in cases where a recordset? I know how to do this via a
stored proc but not a function.
Sorry, I don't understand your question.- Hide quoted text -
- Show quoted text -
What I mean is if I run a stored procedure I know how to return a
value through one of the parameters
eg
Dim UpdateCmd As ADODB.Command
Set Cmd = New Command
With Cmd
Set .ActiveConnection = get_XE_Conn 'makes a connection
Oracle XE
.CommandType = adCmdStoredProc
.CommandText = "pkg_EQRISK.get_num_dates_Varposfile"
'returns the no. of distinct dates
in tmp_varposition using Oracle proc
.Execute , , adExecuteNoRecords
End With
debug.print Cmd(1)
however, if I want to write it as a function I am not sure how to do
this. (Cmd(1) returns the value in the 2nd parameter)
Have your function return a value, then call it using an
ADODB.Recordset object as I illustrated previously.
In that example my test function was simply
create or replace function "MYTESTFUNC"
return VARCHAR2
is
begin
RETURN 'Gord was here.';
end;
On 17 Jul, 12:46, Gord <g...@kingston.netwrote:
On Jul 17, 3:33 am, colmkav <colmj...@yahoo.co.ukwrote:
On 16 Jul, 17:53, Gord <g...@kingston.netwrote:
On Jul 16, 5:21 am, colmkav <colmj...@yahoo.co.ukwrote:
On 12 Jul, 19:47, Gord <g...@kingston.netwrote:
On Jul 12, 10:10 am, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
colmkav wrote:
Can someone tell me how I can access the return value of a function
called from Oracle as opposed to a store proc from oracle? my oracle
function is get_num_dates_varposfile. I am only used to using this
method with store procs that dont return a value back to Access. Hope
this makes sense.
I didn't look closely at your code as I stick exclusively to DAO when
writing mdbs against Oracle back ends (which is what all my work
comprises), but have you tried running:
Select get_num_dates_varposfile from dual
Or whatever SQL statement is required to get the function to run in SQL
Plus via a pass through query with returns records set to true?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
FWIW, this works for me (VBScript example):
Option Explicit
Dim con, rst
Set con = CreateObject("ADODB.Connection")
con.CursorLocation = 3 ' adUseClient
con.Properties("Prompt") = 2 ' adPromptComplete
con.Open "DSN=Oracle ODBC local GDT;"
Set rst = CreateObject("ADODB.Recordset")
rst.Open _
"SELECT MYTESTFUNC FROM DUAL", _
con, 3, 1
Wscript.Echo rst(0).Value
rst.Close
Set rst = Nothing
con.Close
Set con = Nothing- Hide quoted text -
- Show quoted text -
thanks. I guess this would work.
Do you know if its possible to return the return value of an Oracle
function in cases where a recordset? I know how to do this via a
stored proc but not a function.
Sorry, I don't understand your question.- Hide quoted text -
- Show quoted text -
What I mean is if I run a stored procedure I know how to return a
value through one of the parameters
eg
Dim UpdateCmd As ADODB.Command
Set Cmd = New Command
With Cmd
Set .ActiveConnection = get_XE_Conn 'makes a connection
Oracle XE
.CommandType = adCmdStoredProc
.CommandText = "pkg_EQRISK.get_num_dates_Varposfile"
'returns the no. of distinct dates
in tmp_varposition using Oracle proc
.Execute , , adExecuteNoRecords
End With
debug.print Cmd(1)
however, if I want to write it as a function I am not sure how to do
this. (Cmd(1) returns the value in the 2nd parameter)
Have your function return a value, then call it using an
ADODB.Recordset object as I illustrated previously.
In that example my test function was simply
create or replace function "MYTESTFUNC"
return VARCHAR2
is
begin
RETURN 'Gord was here.';
end;- Hide quoted text -
- Show quoted text -
ok, thanks. I see what you mean now. Is this the only way to return
the value of a function? Seems slightly convoluted.
On Jul 17, 6:59 am, colmkav <colmj...@yahoo.co.ukwrote:
On 17 Jul, 12:46, Gord <g...@kingston.netwrote:
On Jul 17, 3:33 am, colmkav <colmj...@yahoo.co.ukwrote:
On 16 Jul, 17:53, Gord <g...@kingston.netwrote:
On Jul 16, 5:21 am, colmkav <colmj...@yahoo.co.ukwrote:
On 12 Jul, 19:47, Gord <g...@kingston.netwrote:
On Jul 12, 10:10 am, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
colmkav wrote:
Can someone tell me how I can access the return value of a function
called from Oracle as opposed to a store proc from oracle? my oracle
function is get_num_dates_varposfile. I am only used to using this
method with store procs that dont return a value back to Access. Hope
this makes sense.
I didn't look closely at your code as I stick exclusively to DAO when
writing mdbs against Oracle back ends (which is what all my work
comprises), but have you tried running:
Select get_num_dates_varposfile from dual
Or whatever SQL statement is required to get the function to run in SQL
Plus via a pass through query with returns records set to true?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
FWIW, this works for me (VBScript example):
Option Explicit
Dim con, rst
Set con = CreateObject("ADODB.Connection")
con.CursorLocation = 3 ' adUseClient
con.Properties("Prompt") = 2 ' adPromptComplete
con.Open "DSN=Oracle ODBC local GDT;"
Set rst = CreateObject("ADODB.Recordset")
rst.Open _
"SELECT MYTESTFUNC FROM DUAL", _
con, 3, 1
Wscript.Echo rst(0).Value
rst.Close
Set rst = Nothing
con.Close
Set con = Nothing- Hide quoted text -
- Show quoted text -
thanks. I guess this would work.
Do you know if its possible to return the return value of an Oracle
function in cases where a recordset? I know how to do this via a
stored proc but not a function.
Sorry, I don't understand your question.- Hide quoted text -
- Show quoted text -
What I mean is if I run a stored procedure I know how to return a
value through one of the parameters
eg
Dim UpdateCmd As ADODB.Command
Set Cmd = New Command
With Cmd
Set .ActiveConnection = get_XE_Conn 'makes a connection
Oracle XE
.CommandType = adCmdStoredProc
.CommandText = "pkg_EQRISK.get_num_dates_Varposfile"
'returns the no. of distinct dates
in tmp_varposition using Oracle proc
.Execute , , adExecuteNoRecords
End With
debug.print Cmd(1)
however, if I want to write it as a function I am not sure how to do
this. (Cmd(1) returns the value in the 2nd parameter)
Have your function return a value, then call it using an
ADODB.Recordset object as I illustrated previously.
In that example my test function was simply
create or replace function "MYTESTFUNC"
return VARCHAR2
is
begin
RETURN 'Gord was here.';
end;- Hide quoted text -
- Show quoted text -
ok, thanks. I see what you mean now. Is this the only way to return
the value of a function? Seems slightly convoluted.
The only way? Perhaps not, but IMO it is no more convoluted than using
an ADODB.Command object to return values from Procedures. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Sachin Narasimhan via .NET 247 |
last post by:
(Type your message here)
Hi,
I am at my wits end. It would be great if someone can help. Wehave a Stored Function(Oracle) that returns a boolean that wecannot change to return something else and we...
|
by: robin via SQLMonster.com |
last post by:
I've tried several different way to execute a oracle stored
procedure from a DTS package but to no avail.
I have a Linked Server setup which does bring back Oracle tables from the
server when I...
|
by: Sameer Deshpande |
last post by:
How do I create and return user defined data types in DB2.
F.ex
In Oracle I can create a user define datatype and return this data
type from stored function. How can I do the same in DB2?
...
|
by: Raj |
last post by:
Hi,
Does anybody know how to call an oracle stored procedure ( with
parameters ofcourse) from MS Access 2002.
I want to invoke an oracle stored procedure which takes 2 parameters.
Thanks,...
|
by: george |
last post by:
Hi world!
Anyone experienced building gridview in Oracle environment using stored
procedures, please help!
Right now, I have issues using Oracle SP, I spent a whole day on this
and still...
|
by: =?Utf-8?B?Vmlua2k=?= |
last post by:
Hello Everyone,
I can successfully insert and update the oracle database by calling a
oracles stored proc from my .net code. This oracle stored proc is returning
some value. I cannot see that...
|
by: =?Utf-8?B?Vmlua2k=?= |
last post by:
Hello Everyone,
I can successfully insert and update the oracle database by calling a
oracles stored proc from my .net code. This oracle stored proc is returning
some value. I cannot see that...
|
by: E11esar |
last post by:
Hi there.
I have written a C# web service that calls an Oracle stored procedure. The SP is a simple select-max query and the table it is getting the value from has about 2.8 million rows in it. ...
|
by: rajkumarbathula |
last post by:
Hi
I was struck up with big problem of executing a oracle stored procedure in C#.
Inputs 1:I am having 1 oracle stored procedure eg. myProc() and this procedure takes 1 INOUT parameter. of type...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |