Page 1 of 1

Updating a record with stored procedure not working

Posted: Sun 10 Aug 2008 15:50
by glen
I am attempting to update a record using a stored procedure with a TIBCStoredProc component. The update procedure I wrote works when I execute it at the database level. I have notice I need to execute a commit after running it though. But when I execute the same stored procedure from Delphi it appears it never gets committed. Autocommit on the componet is set to true. Process runs with no errors. Thanks

Interbase 2007
Delphi CodeGearâ„¢ RAD Studio 2007 Version 11.0.2902.10471
IBDAC 2.50.0.36 for RAD Studio 2007

OS
Windows Vista 32 bit Home Premium Serveice Pack 1


***strored procedure******

create procedure SET_INVOICE_ORDERS(I_Invoice_ID INTEGER, I_Client_ID INTEGER, D_InvoiceStartDate DATE,

D_InvoiceEndtDate DATE )

AS

begin
/* Procedure Text */
UPDATE ORDERS
SET Invoice_ID = :I_Invoice_ID
WHERE
PERMANENT = True AND
ORDER_DATE >= :D_InvoiceStartDate AND
ORDER_DATE <= :D_InvoiceEndtDate AND
CLIENT_ID = :I_CLIENT_ID AND
INVOICE_ID IS NULL AND
VOID = False;
end;


*******Delphi code*******************************

//update the orders table with the invoice number
spSetInvoiceOrders.Prepare;
spSetInvoiceOrders.ParamByName('I_Invoice_ID').AsInteger:= NewInvoiceID;
spSetInvoiceOrders.ParamByName('I_Client_ID').AsInteger:= TheClientID;
spSetInvoiceOrders.ParamByName('D_InvoiceStartDate').AsDate:= dtpStartDate.Date;
spSetInvoiceOrders.ParamByName('D_InvoiceStartDate').AsDate:= dtpEndDate.Date;
spSetInvoiceOrders.ExecProc;

Posted: Wed 13 Aug 2008 07:25
by Plash
Please check that the AutoCommit property of the TIBCConnection component is also set to True.

Posted: Wed 13 Aug 2008 23:03
by glen
Auto commit was set to true on the connect component.

any other ideas? Thanks

glen

Posted: Fri 15 Aug 2008 06:52
by Plash
We could not reproduce the problem. Please send to ibdac*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.