Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving and SQL Query...

Status
Not open for further replies.

ChiTownDiva

Technical User
Jan 24, 2001
273
US
Okay, I'm having a brain-fart.

How do I save and SQL query so I can go back and run it later on today?

ChiTownDivaus [ponytails2]
 
From SQL*Plus:
- copy & paste
OR
- "ed" then "save as" (default is \bin - silly choice!?)
DaPi - no silver bullet
 
If you are running your query in SQL*Plus then type "ED" and the last run query will be written in a file called afiedt.buf and opened in your editor. You can then save the query as a named file (ex.: myquery.sql) for use later. If you have also typed in SQL*Plus formatting commands (set linesize, etc.) you will want to type "SHOW ALL" and copy those settings into myquery.sql.

Good luck,
Barbara
 
Thanks guys for responding so quickly...

But for some dumb reason, it keeps saving it as a *.*txt file. Even when I change the "Save As Type" to "All Files", it keeps slapping that txt on the end.

Help!!!

ChiTownDivaus [ponytails2]
 
Don't know why that happens. I use Window's NotePad and when you save as myquery.sql with "Save As Type" set to "All Files" it works fine. If it were me, I would rename the file using Windows Explorer and then research the editor help to see how to do it the "right" way next time.
 


Thanks BJ...

I had to go into Explorer and delete the txt extension and it changed to an SQL file.

ChiTownDivaus [ponytails2]
 
It's probably a bug in your text editor. I had the same problem with Notepad on W95: regardless on file extensions it saved them as .txt Regards, Dima
 
Put quotes around the filename when you save it, for example "myquery.sql". This prevents Notepad from adding another extention to the filename.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top