Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Incident Reports » Incident Reports Reported for Version 2.01 » View Incident Report |
Serious |
Reported By: David Cornelius Reported On: 8/12/2008 For: Version 2.01 Build 4 |
SCRIPT BEGIN EXECUTE IMMEDIATE 'CREATE FUNCTION "DecimalValue" () RETURNS DECIMAL(20,2) BEGIN RETURN 1.2; END'; EXECUTE IMMEDIATE 'CREATE PROCEDURE "ReturnDecimal" (OUT "Value" DECIMAL(20,2)) BEGIN SET Value = 1.3; END'; END Single statement to test the Function: SELECT DecimalValue() FROM Configuration.DataTypes WHERE NAME = 'Char'; Script to test the Stored Procedure: SCRIPT BEGIN DECLARE DecVal DECIMAL(20,2); CALL ReturnDecimal(DecVal); SET LOG MESSAGE TO 'Result = ' + CAST(DecVal AS VARCHAR); END Create a delphi program and setup the engine, session, and database. Then place both a TEDBQuery and a TEDBStoreProc component on the form. Set the query's SQL value to: SELECT DecimalValue() FROM Configuration.DataTypes WHERE NAME = 'Char' --anything to return a row and point the stored procedure to point accordingly. (Both should prepare CURRENCY parameters.) Then set a button's OnClick event to the following: var FNVal: Currency; SPVal: Currency; begin // get value from function EDBQuery.Open; FNVal := EDBQuery.FieldByName('Value').AsCurrency; // get value from stored procedure EDBStoredProc.ExecProc; SPVal := EDBStoredProc.ParamByName('Value').AsCurrency; // show results MessageDlg(Format('Function call returned: %5.2f'#13#10 + 'Stored procedure returned: %5.2f', [FNVal, SPVal]), mtInformation, [mbOK], 0); end; (--ALL CODE CAN BE FOUND IN THE BINARIES NEWSGROUP--) What you SHOULD get is 1.3 and 1.2, respectively. Instead, you get 1.0 and 1.2.
This web page was last updated on Monday, August 19, 2024 at 05:55 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |