Re: using load tran until_time with a variable





"ZeldorBlat" <zeldorblat@xxxxxxxxx> wrote in message
news:1183647699.670296.144680@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jul 3, 5:04 pm, darkknight56 <prey...@xxxxxxxxxxxxx> wrote:
I'm running a series of tests on a new instance. Rather than edit the
script each time I run it to perform the load tran with until_time
parameter, I want to declare a variable in the procedure that gets the
date and time at a point in the script. Then later, I want to load
the transactions up to that point.

The relevant commands are:

DECLARE @char_string varchar(60)

select @char_string=convert(char(35),getdate(), 109)

load transaction mydatabase from "/dump/srvr0686/mydatabase.logdump"
with until_time = "@char_string"

The load tran command doesn't like the @char_string at the end of the
command.

Any suggestions?

Patrick Reynolds

What if you don't put quotes around it?


Then you'll get an error...

Try wrapping the entire load tran comand in execute-immediate, converting
the @char_string contents to a string first...

Rob V.


.



Relevant Pages

  • Re: using load tran until_time with a variable
    ... I want to declare a variable in the procedure that gets the ... date and time at a point in the script. ... Try wrapping the entire load tran comand in execute-immediate, ... Backup Server session id is: ...
    (comp.databases.sybase)
  • Re: using load tran until_time with a variable
    ... date and time at a point in the script. ... DECLARE @char_string varchar ... The load tran command doesn't like the @char_string at the end of the ...
    (comp.databases.sybase)
  • using load tran until_time with a variable
    ... date and time at a point in the script. ... DECLARE @char_string varchar ... The load tran command doesn't like the @char_string at the end of the ...
    (comp.databases.sybase)
  • Re: User creation script
    ... USERNAME and PASSWORD passed to it. ... I have this in a script but it is written such that you can do it at ... Or you could simply supply the names on the command line as follows: ... declare -ar USERNAMES=) ...
    (Fedora)