using a oracle function within a ADO procedure call statement



Dear Delphi experts,

I have a problem concerning using a stored procedure with Delphi.
I try to use a stored procedure which hast two input parameters ( a
integer and a timestamp).
The timestamp parameter is my problem since I would like to use the
"to_timestamp"
Oracle-function to create the timestamp parameter to be inserted into
my procedure.

If I insert the to_timestamp statement as a adodatetime I have to
perform the conversion to the oracle timestamp in my application.
If I want to use the to_timestamp statement I have to use the ftstring
datatype but in that case I get an error because I use a string as
input for my procedure were it awaits a timestamp.
So the problem seems to be that the function call "to_timestamp" is not
interpreted if it is transferred through my ADO component.
Do you know how to use a procedure with Delphi (ADO) with a function as
input parameter ?

Best regards,

Daniel Wetzler

P.S. :
This is the Delphi code to use my Procedure.

FactsTempDS:=TADODataset.Create(nil);
Sproc1 := TAdoStoredProc.Create(nil);
Sproc1.Connection :=
TDBConnection(strlistConnectionstrings.objects[iConnectionIndex]).Connection;
Sproc1.ProcedureName := 'ECSPACKAGE.PROCFINDINITIALSWITCHSTATE';
Sproc1.Parameters.CreateParameter ('SwitchID',ftInteger,pdinput,0,0);
//Sproc1.Parameters.CreateParameter
('StartTime',ftdatetime,pdinput,50,0);
Sproc1.Parameters.CreateParameter ('StartTime',ftString,pdinput,50,0);
Sproc1.Parameters.Findparam('SwitchID').value:=SwitchID;
Sproc1.Parameters.FindParam('StartTime').Value:=
'to_timestamp(''2005/12/30 19:36:21'', ''YYYY/MM/DD HH:MI:SS'')';

Sproc1.CursorType := ctKeyset;
Sproc1.ExecuteOptions:=[];
Sproc1.Open;
Sproc1.Connection := nil;
FactsTempDS.Recordset:= sproc1.Recordset;
if FactsTempDS.RecordCount=0
then raise Exception.Create('No line switch variable found for switch
'+IntToStr(SwitchID)+' before starttime. Check BDE dump filter.')

.



Relevant Pages

  • Re: Database stored procedure parameters
    ... The problem with runstoredprocedure is that it builds a string to include all input parameters rather than binding them (as it does for output parameters). ... the following now works for a stored procedure: ...
    (comp.soft-sys.matlab)
  • Re: Access ADP Form and Stored Procedure as RecordSource Options
    ... Me.RecordSource property, to a second Stored Procedure, in code when ... the Search button was clicked and include all the Input Parameters ... from the search criteria the user would input. ... What I realized is you can't change the RecordSource from one Stored ...
    (microsoft.public.access.adp.sqlserver)
  • Re: SQL transaction rollback problem
    ... I'm not a C++ programmer so can't help you with the syntax, ... close the connection so that it is returned to the pool. ... tell as to how to call the stored procedure from a C++ program. ... You can pass it input parameters and retrieve ...
    (microsoft.public.data.odbc)
  • OleDbParameter.Direction giving problem
    ... I am using visual basic.net with sql server 2000 as back end. ... my data access I am using stored procedures. ... This stored procedure has various ... One of the input parameters is '@OrgRV' - that is for Original ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: OleDbParameter.Direction giving problem
    ... of the input parameters a BLOB and NOT the last one defined? ... "tbj" wrote: ... This stored procedure has various ... I think there is some problem with the 'FORMAL PARAMETER' which it says is ...
    (microsoft.public.dotnet.framework.adonet)