=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