Re: SQL queries for Server Scripts
2000-08-31 14:37:04
Subject: |
Re: SQL queries for Server Scripts |
From: |
"Cook, Dwight E" <cookde AT BP DOT COM> |
Date: |
Thu, 31 Aug 2000 13:36:35 -0500 |
maybe
tsm: TDCDSM01>select cast((current_timestamp-last_backup_date) as
varchar(10)) f
rom adsm.db
Unnamed[1]
----------
0 02:25:42
0 02:25:42
ANR2900W The character string '0 02:25:42.000000' was truncated during
assignment.
where the 1st zero is day, then the 02:25:42 is hour difference...
> ----------
> From: Tim Melly[SMTP:Tim.Melly.B AT BAYER DOT COM]
> Reply To: ADSM: Dist Stor Manager
> Sent: Thursday, August 31, 2000 10:40 AM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: SQL queries for Server Scripts
>
> Hi all,
>
> I'm in the process of implementing "server scripts" and could use some
> assistance with SQL queries.
> Prior to scheduling a "full" database backup, I want to check if a full DB
> backup has already been performed that day.
> I'm performing a migration prior to executing the DB backup so i was going
> to
> check the stgpool.chg_time vs. db.last_basckup_date. The query would look
> like
> this:
>
> select stgpool.chg_time, db.last_backup_date from stgpools, db
> where stgpools.stgpools_name='BACKUPPOOL'
> and stgpool.chg_time <= db.last_backup_date
>
> I want to compare the hh:mm portion of the timestamp. Does anyone know how
> to
> extract the hh:mm portion of the
> timestamp.
>
> Any assistance with timestamp formatting would be greatly appreciated.
>
>
> Thx, Tim Melly
> Sr. IS Analyst
> Bayer Corporation
>
|
|
|