Subject IBObjects - tutorial 1
Author Norman Dunbar
I am just starting to evaluate IBObjects (for my own learning) and as I
don't have Delphi, I re-wrote the tutorial1 application in C++Builder 4. (I
used to have Delphi 1 many years ago)

There is a stored proc called SP_GEN_DUMMY and this is giving
overflow/string truncation when executed. I have traced this to the insert
into the BARCODE column as the full expression seems to be tripping up the
evaluator. I made the following changes and all was well. (My bits are
flagged >>>>> at the start of each line.

Hope this might help if anyone else is having these problems.

Just to say that I have not yet got to grips with this suite of components,
but first look seems very impressive. I got mine from the new 'C++ Builder 5
Developers Guide' book by Jarrod Hollingworth et al. It is IBO version 3.5.

Kind regards, Norman.

PS. I am NOT using IBO for work, merely sending this email from work - in
case my sig gives the wrong impression :o)

My fix :

CREATE PROCEDURE SP_GEN_DUMMY_ITEM(P_CATEGORY_ID INTEGER,
P_DESCRIPTION VARCHAR(50),
P_BAR_PREFIX VARCHAR(5),
P_COUNT INTEGER) AS

DECLARE VARIABLE i INTEGER;
>>>>> declare variable tmp integer;
BEGIN
i = 1;
WHILE ( i <= :P_COUNT ) DO BEGIN
>>>>> tmp = ( :P_CATEGORY_ID * ( 100000 + :i ) + :i * 10000 + :i * 10 +
:P_CATEGORY_ID );
INSERT INTO ITEM(ID_CATEGORY, DESCRIPTION, BARCODE, COST_PRICE,
CURR_VALUE)
VALUES( :P_CATEGORY_ID,
( :P_DESCRIPTION || " " || :i ),
>>>>> ( :P_BAR_PREFIX || ( :tmp ) ),
( :i * 121 + :P_CATEGORY_ID * 10 + :i ),
( :i * 59 ) );
i = i + 1;
END /* WHILE */
END !!

----------------------------------------------------------------------------
----
Norman Dunbar EMail: NDunbar@...
Database/Unix administrator Phone: 0113 289 6265
Lynx Financial Systems Ltd. Fax: 0113 201 7265
URL: http://www.LynxFinancialSystems.com
----------------------------------------------------------------------------
----