> Can I Use the Print ' This Is the new CaseNo Created by Server :' @UID
> But how do I add the @UID on the end of the string I tryied a + and I get
a
> error and not allowed to save the stored procedure.
> > put this:
> > SProc.StoredProcName := 'dbo.GenUniqueCaseID;1';
> What does the ;1 Mean and why do I need to use it. - I Do not understand
> THANKS
> I figured that mastake after I posted the question - THANKS
> > call ExecProc instead of Open:
> > SProc.ExecProc;
> My Stored procedure has gotton a little better it now does not require a
> argument passed to it which is what I wanted but how do I print out the
> @UID - I tried a cast but that did not work do not know how to use the
> convert function tried that also - note: I use SQL SERVER 6.5 -THANK
> if exists (select * from sysobjects where id =
> object_id('dbo.GenUniqueCaseID') and sysstat & 0xf = 4)
> drop procedure dbo.GenUniqueCaseID
> GO
> CREATE PROCEDURE GenUniqueCaseID
> As
> Begin
> Declare @UID Int
> Print 'Stored Procedure - GENUNIQUECASEID'
> Begin Tran
> update SystemInfo
> set Last_Case_No = Last_Case_No + 1
> Select @UID = Last_Case_No
> From SystemInfo
> Commit Tran
> Print cast(@UID as varchar(50))
> Return @UID
> End
> GO
> Tomislav Kardas <nomail@sorry> wrote in message
> news:38fdda00.25286486@forums.inprise.com...
> > Hi Frank!
> > On Tue, 18 Apr 2000 13:00:48 -0400, "Frank H. Shaw"
> > <fs...@runestones.com> wrote:
> > >One of the problems is do not know if I am calling the actual stored
> > >procedure sitting on the server - When I do a Open in the function
> > >GetUniqueCaseNo in delphi - I get the message General Sql error - Is
> their a
> > >way to tell if the actual stored procedure is getting called and does
the
> > >following code make any senece -
> > put the following line in the stored procedure and if you see the
> > exception message in the program then your SP is executed.
> > raiserror ('Stored procedure executed!',16,-1)
> > > Is the return value from the stored
> > >proceduere correct coded and should my function be able to trap that
> return
> > >value.
> > Personaly, i usualy do not use Result parameter for anything else
> > except 0 - indicating success, or > 0 as error code indicating
> > failure.
> > > Note I want to create the
> > >TStoredProc on the fly like I have done below.
> > Why doing that on the fly. Let the procedure be there as a part of the
> > database. My big project has over 300 stored procedures. Stored
> > procedures are part of your database logic and your exe program is a
> > front end process that only access database and initiates task that
> > database should do. This is a good programming practice.
> > >Function GetUniqueCaseNo: Integer;
> > >Var
> > > SProc: TStoredProc;
> > >Begin
> > > try
> > > SProc := TStoredProc.Create(Nil);
> > > SProc.DatabaseName := 'MyDataBase';
> > > SProc.StoredProcName := 'dbo.GenUniqueCaseID';
> > put this:
> > SProc.StoredProcName := 'dbo.GenUniqueCaseID;1';
> > > SProc.Params.CreateParam(ftInteger, 'Result', ptOutPut);
> > > SProc.Open;
> > call ExecProc instead of Open:
> > SProc.ExecProc;
> > > Result := Sproc.ParamByName('Result').AsInteger; // Returns the
> value
> > >that was returned from Stored Procedure
> > > finally
> > > SProc.Free;
> > > End;
> > >End;
> > tomi.