Home » SQL & PL/SQL » Client Tools » SQL*Plus help (desired results)
SQL*Plus help [message #275191] Thu, 18 October 2007 13:42 Go to next message
ashwin_tampa
Messages: 40
Registered: October 2005
Member
Hi guys,

Could someone help on this?



set serverouput on size 1000000
set head off
set echo off
set feedback off
set pagesize 0
set linesize 30000
set trimspool on

col filename1 new_value filename1


SELECT 
'&filedestination'||'AHCA_RX_'||TO_CHAR(SYSDATE,'MMDDYYYY')||'_Q'||&quarter_num_like_2_or_3||'.txt' filename1  
FROM DUAL;

spool  &filename1

select '&abcd' from dual;

spool off




file is saving :


Enter value for abcd: A Thing of beauty is a joy forever!
old   1: select '&abcd' from dual
new   1: select 'A Thing of beauty is a joy forever!' from dual
A Thing of beauty is a joy forever!



I want user input text only.

so file result shoule be only following text :

A Thing of beauty is a joy forever!


[Updated on: Thu, 18 October 2007 13:45] by Moderator

Report message to a moderator

Re: SQL*Plus help [message #275192 is a reply to message #275191] Thu, 18 October 2007 13:46 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
set echo off
set verify off
set showmode off

Regards
Michel
Re: SQL*Plus help [message #275195 is a reply to message #275192] Thu, 18 October 2007 13:58 Go to previous messageGo to next message
ashwin_tampa
Messages: 40
Registered: October 2005
Member

Thanks a lot Michel for your prompt reply,
but I am still getting this result in my file :


Enter value for abcd: A thing of beauty is a joy forever!
A thing of beauty is a joy forever!



Here is the code :



set head off
set echo off
set verify off
set showmode off
set feedback off
set pagesize 0
set linesize 30000
set trimspool on


col filename1 new_value filename1


SELECT '&filedestination'||'AHCA_RX_'||TO_CHAR(SYSDATE,'MMDDYYYY')||'_Q'||&quarter_num_like_2_or_3||'.txt' filename1  FROM DUAL;

spool  &filename1

select '&abcd' from dual;

spool off


Re: SQL*Plus help [message #275196 is a reply to message #275195] Thu, 18 October 2007 14:07 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use "accept" command to ask for a value.

Regards
Michel
Re: SQL*Plus help [message #275209 is a reply to message #275196] Thu, 18 October 2007 16:04 Go to previous message
ashwin_tampa
Messages: 40
Registered: October 2005
Member

Great help!

Thanks Michel.
Previous Topic: PL/SQL developer poor performance
Next Topic: Toad
Goto Forum:
  


Current Time: Sat Dec 10 02:59:11 CST 2016

Total time taken to generate the page: 0.07529 seconds