Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Martina Jindrová
  Where is Martina Jindrová?
 Trutnov
 Czech Republic
 Martina Jindrová
 To: surinder singh
  Where is surinder singh?
 Hyderabad/New Delhi/Kangra
 India
 surinder singh
 Tags
Subject: RE: function to call in oracle 10g express
Thread ID: 216440 Message ID: 216458 # Views: 26 # Ratings: 0
Version: Visual FoxPro 9 Category: ODBC, ADO and OLEDB
Date: Friday, February 13, 2009 10:47:00 AM         
   


=sqlexec(consql,"select get_maincode(?ac,?@mt) FROM DUAL","crsResult")


or using OLE-DB
#DEFINE adInteger 3
#DEFINE adChar   129
#DEFINE adParamInput 1
#DEFINE adParamOutput 2
#DEFINE adParamInputOutput 3
loADO=CREATEOBJECT("ADODB.Connection")
loADO.Open("Provider=MSDAORA.1;Data Source=orcl1; user id=test; password=test;")

loCmd=CREATEOBJECT("ADODB.Command")
loCmd.ActiveConnection=loADO
loPar = loCmd.CreateParameter("", adInteger, adParamOutput, 5)
loCmd.Parameters.Append(loPar)
loPar = loCmd.CreateParameter(, adInteger, adParamInput, 5)
loPar.Value = 1
loCmd.Parameters.Append(loPar)
loPar = loCmd.CreateParameter(, adInteger, adParamInputOutput, 5)
loPar.Value = 2
loCmd.Parameters.Append(loPar)
loCmd.CommandText="{?=call get_maincode( ?,?)}"
=loCmd.Execute()
?loCmd.Parameters.Item(0).value,loCmd.Parameters.Item(1).value,loCmd.Parameters.Item(2).value



MartinaJ

> > Dear Exprets,
> >
> > I am trying to convert my account software from vfp/sql server 2000 to
> > vfp/Oracle 10g express edition.
> >
> > I have created database on backend (oracle 10g express) and successfully
> > connected to it. I sucessfully call the procedure from front end VFP 9.
> >
> > same way I created a function on oracle 10g express but unable to successfully
> > call it from front end VFP 9. I am using the same as I use to call store Procedure.
> >
> > I have created following fuciton and connect through ODBC.
> >
> > create or replace function get_maincode(ac IN Varchar2,mt IN OUT Varchar2)
> > return Varchar2 is
> > begin
> > select main_title into mt from chart
> > where acc_code=ac;
> > return mt;
> > end;
> >
> > I call this function from vfp as below.
> > sqlexec=consql,"(call get_maincode (?ac,?@mt)}"
> >
> > if I create procedure than it run successfully but not as function.
> >
> > function created successfully on oracle end.
> >
> > any tip??
> >
> > Regards,
> > Abdul Aqeel
> does it work in this way:
>
> =sqlexec(consql,"select get_maincode(?ac,?@mt)","crsResult")
> 

> -----------------------------------------------------------------------------------------------
> Regards
> Surinder Singh
> Email: sur200@indiatimes.com
> Check my blog for details: http://weblogs.foxite.com/sur200
> ----------------------------------------------------------------------------------------
> *Everything is possible but everything is not required to be happy..



JID: gorila@dione.zcu.cz



COMPLETE THREAD
function to call in oracle 10g express Posted by Malik Aqeel @ 2/13/2009 8:40:34 AM
RE: function to call in oracle 10g express Posted by surinder singh @ 2/13/2009 9:28:09 AM
RE: function to call in oracle 10g express Posted by Martina Jindrová @ 2/13/2009 10:47:00 AM
RE: function to call in oracle 10g express Posted by Cetin Basoz @ 2/13/2009 11:34:42 AM
RE: function to call in oracle 10g express Posted by Malik Aqeel @ 2/13/2009 12:04:01 PM
RE: function to call in oracle 10g express Posted by Cetin Basoz @ 2/13/2009 12:58:59 PM