Solved

MS DOS Set Time

Posted on 2004-08-12
13
1,065 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 
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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

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…
Popular third-party chat platforms like Slack, Discord, and Telegram are just a few of the many new productivity applications that are being hijacked by cybercriminals to create command-and-control (C&C) communications infrastructures for their malw…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 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