Solved

MS DOS Set Time

Posted on 2004-08-12
13
1,057 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
  • 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now