My stored procedure (below) wont work. When I call execproc I get either a
parameter or type mismatch or I am told there is no Params[0] - the return
value. The generator it uses has not incremented.

I have an IB Insert TRigger that correctly uses the generator to fill in a
Null field value when I post but now want to use the stored procedure to
pass in a non-null value (which is so much more convenient).

Heres my ISQL script (Set term $;) for the procedure, ISQL tells me it is on
the server (but I do not know how to test it other than through Delphi).
  
CREATE PROCEDURE PRO_GETSLPRTY
RETURNS (ID_SLPRTY INTEGER)
AS
BEGIN
ID_SLPRTY = gen_id(GEN_SLPRTY, 1);
END $
COMMIT$

The stored Procedure is called onInsert:

begin
    With StoredProc do begin
        myParamname := RETPREFIX + Tablename;
        StoredProcName := SPPREFIX + Tablename;
        Params.AddParam(Params.CreateParam(ftInteger, myParamname,
ptInput));
        Prepare;
        ExecProc;
// raises DB error here.

Result := ????;//would have thought Params[0] or ParambyName(myParamname)
... but the program advises me there are no params.
     end;
end;


All D5 pro/ IB5/ ODBC (which raises the errors). Any thoughts?
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to