Board index » delphi » Why Store procedure cannot work in delphi?

Why Store procedure cannot work in delphi?

I declared a store procedure like this in Sybase:

CREATE PROCEDURE sp_dump_db2file
  @dbname varchar(20),
  @filename varchar(100)
AS
  DECLARE @dbfilename varchar(120)
  IF @dbname IS NULL
 RETURN -100
  IF @filename IS NULL
    RETURN -101
 SELECT @dbfilename = @filename + ".bdb"
 DUMP DATABASE @dbname to @dbfilename
 SELECT @dbfilename = @filename + ".btr"
 DUMP TRAN @dbname to @dbfilename
 RETURN 100

It can work in ISQL fine, but cann't work in Delphi
TStoreproc, It seems that Backup Server cannot excute sp_volchanged
according to Sql error message!
  Can anybody help?
  Best regards!

 

Re:Why Store procedure cannot work in delphi?


Make sure SQLQRYMODE in the BDE Admin is set to server. Make sure that
you are using ExecSQL and not Open or Active=true to run the stored
proc.

Juan (TeamB)

Quote
kjerry wrote:

> I declared a store procedure like this in Sybase:

> CREATE PROCEDURE sp_dump_db2file
>   @dbname varchar(20),
>   @filename varchar(100)
> AS
>   DECLARE @dbfilename varchar(120)
>   IF @dbname IS NULL
>  RETURN -100
>   IF @filename IS NULL
>     RETURN -101
>  SELECT @dbfilename = @filename + ".bdb"
>  DUMP DATABASE @dbname to @dbfilename
>  SELECT @dbfilename = @filename + ".btr"
>  DUMP TRAN @dbname to @dbfilename
>  RETURN 100

> It can work in ISQL fine, but cann't work in Delphi
> TStoreproc, It seems that Backup Server cannot excute sp_volchanged
> according to Sql error message!
>   Can anybody help?
>   Best regards!

Re:Why Store procedure cannot work in delphi?


hi,Juan Jimenez
   I  set SQLQRYMODE to server, and it still cannot work. the error message
as follows:
        Key violation.
        [INTERSOLV][ODBC SQL Server driver][SQL Server] Backup server
session id is: 8.
   using this value when excuting 'sp_volchanged' system stroe procedure
after fulfilling any volume
  change request from backup server.
       General SQL Error.
        [INTERSOLV][ODBC SQL Server driver][SQL Server] Backup server:
6.28.1.1: Dump filename
   'htlsys0027408C5D' section number 0001 mounted on disk file
'C:\HT\DATA\hh.bdb'

   I call sp_dump_db2file in TStoredProc like this:
        spBackup.Params[0].AsString := 'htlsys';            /*@dbname
        spBackup.Params[1].AsString := stFileName;    /*@filename
        spBackup.Prepare;
        spBackup.ExecProc;
        iRetVal := spBackup.Params[2].AsInteger;
  Many thanks.

Quote
Juan Jimenez <fly...@home.com> wrote in message

news:39D478BA.DFB01999@home.com...
Quote
> Make sure SQLQRYMODE in the BDE Admin is set to server. Make sure that
> you are using ExecSQL and not Open or Active=true to run the stored
> proc.

> Juan (TeamB)

> kjerry wrote:

> > I declared a store procedure like this in Sybase:

> > CREATE PROCEDURE sp_dump_db2file
> >   @dbname varchar(20),
> >   @filename varchar(100)
> > AS
> >   DECLARE @dbfilename varchar(120)
> >   IF @dbname IS NULL
> >  RETURN -100
> >   IF @filename IS NULL
> >     RETURN -101
> >  SELECT @dbfilename = @filename + ".bdb"
> >  DUMP DATABASE @dbname to @dbfilename
> >  SELECT @dbfilename = @filename + ".btr"
> >  DUMP TRAN @dbname to @dbfilename
> >  RETURN 100

> > It can work in ISQL fine, but cann't work in Delphi
> > TStoreproc, It seems that Backup Server cannot excute sp_volchanged
> > according to Sql error message!
> >   Can anybody help?
> >   Best regards!

Other Threads