Solved

MS DOS Set Time

Posted on 2004-08-12
13
1,064 Views
Last Modified: 2012-08-14
I'm writing a script set_time.sql
the sets a time variable by hosting to dos.

The variable displays the current time the first time the script is called from SQL>@set_time
but when I executed the script again,
the variable stays the same.

My question is how to refresh (clear) the variable
so each time the script is called it displays the new time?

host Set HHMISS=%TIME%
host echo %hhmiss%
0
Comment
Question by:revxprts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
13 Comments
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787127
do a

host Set HHMISS=
host Set HHMISS=%TIME%
host echo %hhmiss%

This should clear it each time, first.

J
0
 

Author Comment

by:revxprts
ID: 11787169
I tried that already--the time did not change.
0
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787226
ok just a sec
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 9

Expert Comment

by:jdeclue
ID: 11787257
THis is odd... it is working flawlessly for me. What kind of machine are you running on NT/2000/2003?

J
0
 

Author Comment

by:revxprts
ID: 11787345
I'm on a Windows 2000 machine, partitioned into C: and D: drives.

=========
set_time.sql
=========
host Set HHMISS=
host echo %hhmiss%

host Set HHMISS=%TIME%
host echo %hhmiss%

=========
=========
D:\> dir
set_time.sql

D:\> sqlplus /nolog
D:\> connect system/passwd
D:\> @set_time

-- time stays the same
0
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787410
what happens whe you go to a command prompt and do it manually, are they the same time?

set time=
set time=%TIME%
echo %TIME%

set time=
set time=%TIME%
echo %TIME%
0
 

Author Comment

by:revxprts
ID: 11787423
It works fine from the command prompt.
0
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787489
the sqlplus is not holding the environment between commands. Can you put this in cmd file and call it?

J
0
 

Author Comment

by:revxprts
ID: 11787568
I don't understand
0
 
LVL 9

Accepted Solution

by:
jdeclue earned 500 total points
ID: 11787747
Create a text file on d:\time.cmd

Put this in the text file:

@Echo off
Set HHMISS=
Set HHMISS=%TIME%
echo %hhmiss%

then call

host time.cmd

0
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787937
So, that worked?

J
0
 

Author Comment

by:revxprts
ID: 11787941
You ROCK!
0
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787955
Thank you sir ;)

J
0

Featured Post

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question