Subject | Re: [firebird-support] Delphi 2010, IBX and Stored procedure |
---|---|
Author | Thomas Steinmaurer |
Post date | 2009-10-09T09:45:49Z |
Hi,
* Which component
* Post some source here
--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com
My blog:
http://blog.upscene.com/thomas/
> Im not sure I should ask this question here, but I'll try.How do you execute the stored procedure in your Delphi application?
>
> Recently we upgraded from Delphi 5 to Delphi 2010.
> One of our 3 major applications has been fully converted.
> The next one has been compiled and we are testing it.
>
> One problem I have run into.
> The program connects to a Firebird 2.1 SS DB running on a Windows 2008 server.
> I connect using Delphi 2010 Interbase Connection components (TIBDatabase, TIBQuery etc).
> We are suposed to switch to FIPPlus, but time has not been to do that yet.
>
> As of now I can connect, select, update, delete and all without problems.
> But I have problems executing stored procedures. Not all, but a lot of them. The one that fails reports "Unsuported feature".
>
> One that works is this:
>
> SET TERM ^^ ;
> CREATE PROCEDURE GETGETNEXTKVITNR (
> STEP Integer)
> returns (
> BONNR Integer)
> AS
> BEGIN
> BonNr = Gen_ID(GetNextKvitNr,Step);
> END ^^
> SET TERM ; ^^
>
>
> Simpel procedure to retrieve a number.
>
>
> One that doesn't work is defined as:
>
> SET TERM ^^ ;
> CREATE PROCEDURE OPDAT_VAREROMSETKOEB (
> VNR VarChar(30),
> AFD VarChar(15),
> MDR Integer,
> AAR Integer,
> KOMSSTK Numeric(18,2),
> KSALGSPRIS Numeric(18,2),
> KKOSTPRIS Numeric(18,2),
> KMOMS Numeric(18,2))
> AS
> DECLARE VARIABLE LMOMS FLOAT;
> DECLARE VARIABLE LANTAL FLOAT;
> DECLARE VARIABLE LSALG FLOAT;
> DECLARE VARIABLE LKOST FLOAT;
> BEGIN
> if (not exists (select vareplu_id from Varer_Omsetning where Vareplu_ID=:VNr and Afdeling_ID=:Afd and Aar=:Aar and Mdr=:Mdr)) then
> begin
> /* Henter lagerbeholdning til aktuelle varer
> Og opretter efterfølgende en omsætningspost med disse tal */
> select AntalStk, Beh_Salgspris, Beh_Kostpris, Beh_SalgsprisMoms from varer_detail
> where VarePlu_ID=:VNr and afdeling_ID=:Afd
> into :LAntal, :LSalg, :LKost, :LMoms;
> if (not (:LAntal is null)) then
> insert into Varer_Omsetning (VarePlu_ID, Aar, Mdr, Afdeling_ID,LAntal, LSalgspris, LKostpris, LMoms)
> Values (:VNr,:AAr,:Mdr,:Afd,:LAntal,:LSalg, :LKost, :LMoms);
> end
> Update Varer_Omsetning Set KAntal = KAntal + :KOmsStk,
> KSalgspris = KSalgspris + :KSalgspris,
> KKostpris = KKostpris + :KKostpris,
> KMoms = KMoms + :KMoms
> Where
> Vareplu_ID=:VNr and Aar=:AAr and Mdr=:Mdr and Afdeling_ID=:Afd;
> END ^^
> SET TERM ; ^^
>
>
> A procedure which has input fields, selects a field from a table and if not exists insert into that table.
> Afterwards an update of that table.
>
> Executin the above procedure fails with "Unsupported feature".
>
>
>
> Anyone with any ideas as what to do?
* Which component
* Post some source here
--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com
My blog:
http://blog.upscene.com/thomas/