473,394 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Urgent Help Needed

35
Can somebody please help me resolve this?

I have a batch file that copies various sql file into a temp folder. Then run the sql file from the temp location. However, I have to type exit at the sql prompt when on file is done for it move to the next file. I don't what to hard code exit in the sql script, how do I go about this? Also I want to spool each sql file but don't want to hard code it as well.
Please help as I dire need and my project is behind schedule.

Thanks


[code]
copy c:\text1.sql c:\temp
copy c:\text2.sql c\temp
copy c:\text3.sql c:\tem

sqlplusw user/admin@mtestdb @c:\temp\text1.sql
sqlplusw user/admin@mtestdb @c:\temp\text2.sql
sqlplusw user/admin@mtestdb @c:\temp\text3.sql

[\code]

--------------------------------------------------------------------------------
Mar 28 '08 #1
5 1179
kwartz
35
Can somebody please help me resolve this?

I have a batch file that copies various sql file into a temp folder. Then run the sql file from the temp location. However, I have to type exit at the sql prompt when on file is done for it move to the next file. I don't what to hard code exit in the sql script, how do I go about this? Also I want to spool each sql file but don't want to hard code it as well.
Please help as I dire need and my project is behind schedule.

Thanks


Expand|Select|Wrap|Line Numbers
  1. copy c:\text1.sql  c:\temp
  2. copy c:\text2.sql  c\temp
  3. copy c:\text3.sql  c:\tem
  4.  
  5. sqlplusw user/admin@mtestdb  @c:\temp\text1.sql
  6. sqlplusw user/admin@mtestdb  @c:\temp\text2.sql
  7. sqlplusw user/admin@mtestdb  @c:\temp\text3.sql
  8.  
  9.  
--------------------------------------------------------------------------------
Mar 28 '08 #2
amitpatel66
2,367 Expert 2GB
Can somebody please help me resolve this?

I have a batch file that copies various sql file into a temp folder. Then run the sql file from the temp location. However, I have to type exit at the sql prompt when on file is done for it move to the next file. I don't what to hard code exit in the sql script, how do I go about this? Also I want to spool each sql file but don't want to hard code it as well.
Please help as I dire need and my project is behind schedule.

Thanks


Expand|Select|Wrap|Line Numbers
  1. copy c:\text1.sql  c:\temp
  2. copy c:\text2.sql  c\temp
  3. copy c:\text3.sql  c:\tem
  4.  
  5. sqlplusw user/admin@mtestdb  @c:\temp\text1.sql
  6. sqlplusw user/admin@mtestdb  @c:\temp\text2.sql
  7. sqlplusw user/admin@mtestdb  @c:\temp\text3.sql
  8.  
  9.  
--------------------------------------------------------------------------------
You will need to use either EXIT or QUIT at the end of each *.sql files. Else the file will not exit after executing the source code in that particular file. Try giving a "/" if you do not want to use exit or quit keyword and using a command EXIT at the END OF FILE is not said as HARD CODING.

Coming to your second requirement, I am not clear with your requirement. You do not want to hardcode the file name to which you want to SPOOL the DATA or you do not want to use SPOOL command in the sql files?
Mar 29 '08 #3
amitpatel66
2,367 Expert 2GB
Duplicate Threads Merged for better management of the forum

MODERATOR
Mar 29 '08 #4
kwartz
35
You will need to use either EXIT or QUIT at the end of each *.sql files. Else the file will not exit after executing the source code in that particular file. Try giving a "/" if you do not want to use exit or quit keyword and using a command EXIT at the END OF FILE is not said as HARD CODING.

Coming to your second requirement, I am not clear with your requirement. You do not want to hardcode the file name to which you want to SPOOL the DATA or you do not want to use SPOOL command in the sql files?

I want to spool the the sql file as the DOS command prompt or in the batch fill.
Mar 31 '08 #5
amitpatel66
2,367 Expert 2GB
This is what you are looking at:

Expand|Select|Wrap|Line Numbers
  1.  
  2. CMD> SQLPLUS uid/pwd@dbname
  3. SQL> SPOOL d:/a.txt
  4. SQL> select * from emp;
  5. SQL> SPOOL OFF;
  6. SQL> EXIT;
  7.  
  8.  
Mar 31 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: choksi | last post by:
Hello All I am running PHP5.0.2 over apache 1.3.29 and openssl-0.9.7d on a Debian Linux and with a fake (internal)ip. Php Configure command './configure' '--with-apxs=/www/bin/apxs'...
10
by: Tony Archer | last post by:
Gentlemen, your urgent help is needed in solving a STRANGE problem. I have two servers a dev box, and a production box. On the dev box everything works fine, in production it hoses: One of...
1
by: Tony Archer | last post by:
(Forgive the dupicate post, I had left out the OS Version out of the prior post.) Gentlemen, your urgent help is needed in solving a STRANGE problem. I have two servers a dev box, and a...
0
by: felix_william | last post by:
Attention=3A Dear friend=2C REQUEST FOR BUSINESS RELATIONSHIP OF GREAT PROFITS I am HON=2E =28DR=2E=29 Felix William=2C the Director of Procurement and Contract Award at the Nigerian National...
12
by: Vibhajha | last post by:
Hi friends, My sister is in great problem , she has this exam of C++ and she is stuck up with some questions, if friends like this group provides some help to her, she will be very grateful....
4
by: Random | last post by:
The way I've built my page is to take the user through a multi-form process, only rendering those controls that are needed for each section. The ViewState is working the way I want it to,...
7
by: meenasamy | last post by:
Hi all, i need to create a function that takes three parameters( Original currency, needed currency, amount) i need to convert from the original currency to the needed currency the amount and...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
2
by: Preetam Pattanashetty | last post by:
Hi I am learning ASP.NET using C#. I am able to run .aspx files on local system, but when I load them to the server, I get the "Server Error in '/' Application" error. I have tried to configure the...
0
by: Christopher | last post by:
Urgent Help Needed: The EPVH-1.1 Visual Hull Library. Dear All, I am a student doing research in computer vision. The EPVH-1.1 Visual Hull Library will really help a lot in my research. I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.