The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Double quotes or single quotes when using ssh? password636 Shell Programming and Scripting 3 05-29-2008 05:52 PM
awk to print ' (single quotes) orahi001 UNIX for Dummies Questions & Answers 2 03-11-2008 01:30 PM
Help Please. Need to add quotes to o field tjbopp Shell Programming and Scripting 13 02-10-2006 01:52 PM
I want the output within quotes gopskrish UNIX for Dummies Questions & Answers 5 06-24-2005 07:17 AM
quotes wannabe_guru UNIX for Dummies Questions & Answers 4 04-12-2004 06:25 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-08-2007
Registered User
 

Join Date: May 2007
Posts: 11
how to put quotes ina .sql file

Hi i am new on Unix..........
I have to write a ddl and for tables and I am using single quotes in the comment for the table and its column...........but when i see on the unix server the ' dont show .

e.g. DROP TABLE DMR_PURGED;

CREATE TABLE DMR_PURGED
(
HEALTH_SERVICE_ID NUMBER(20) NOT NULL,
HEALTH_SERVICE_ITEM_NO NUMBER(2) NOT NULL,
SYSTEM_CD VARCHAR(2) NOT NULL,
PURGED_DT DATE NOT NULL,
REC_CREATE_TIMESTAMP DATE NOT NULL
);

COMMENT ON TABLE DMR_PURGED IS 'This stores purged member claims from PBS';

COMMENT ON COLUMN DMR_PURGED.HEALTH_SERVICE_ID IS 'Health Service ID';

COMMENT ON COLUMN DMR_PURGED.HEALTH_SERVICE_ITEM_NO IS 'Health Service Item Number';

COMMENT ON COLUMN DMR_PURGED.SYSTEM_CD IS 'System Code';

COMMENT ON COLUMN DMR_PURGED.PURGED_DT IS 'Purged Date';

COMMENT ON COLUMN DMR_PURGED.REC_CREATE_TIMESTAMP IS 'Record Create Timestamp';


CREATE OR REPLACE TRIGGER TRG_DMR_PURGED_TS
BEFORE UPDATE OR INSERT
ON DMR_PURGED
FOR EACH ROW
BEGIN

the comment line quotes either dont show or comes out as special character........plz help
Reply With Quote
Forum Sponsor
  #2  
Old 06-08-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
How are you composing the file?

If you edit the file on the UNIX box with vi does the problem go away?
Reply With Quote
  #3  
Old 06-08-2007
awk awk is offline
Registered User
 

Join Date: Feb 2007
Posts: 120
[quote=agarwalniru]Hi i am new on Unix..........
I have to write a ddl and for tables and I am using single quotes in the comment for the table and its column...........but when i see on the unix server the ' dont show .

Ran this code -

more run.ksh

sqlplus <<ENDIT
$(cat $HOME/.dw_plus_logon.sec)

CREATE TABLE DMR_PURGED
(
HEALTH_SERVICE_ID NUMBER(20) NOT NULL,
HEALTH_SERVICE_ITEM_NO NUMBER(2) NOT NULL,
SYSTEM_CD VARCHAR(2) NOT NULL,
PURGED_DT DATE NOT NULL,
REC_CREATE_TIMESTAMP DATE NOT NULL
);

COMMENT ON TABLE DMR_PURGED IS 'This stores purged member claims from PBS';

COMMENT ON COLUMN DMR_PURGED.HEALTH_SERVICE_ID IS 'Health Service ID';

COMMENT ON COLUMN DMR_PURGED.HEALTH_SERVICE_ITEM_NO IS 'Health Service Item Number';

COMMENT ON COLUMN DMR_PURGED.SYSTEM_CD IS 'System Code';

COMMENT ON COLUMN DMR_PURGED.PURGED_DT IS 'Purged Date';

COMMENT ON COLUMN DMR_PURGED.REC_CREATE_TIMESTAMP IS 'Record Create Timestamp';



quit
ENDIT

-------------------------------------------------------------------------
Looks like it worked - I saw these results -

select * from user_col_comments
where table_name like 'DMR%'

TABLE_NAME COLUMN_NAME COMMENTS

DMR_PURGED HEALTH_SERVICE_ID Health Service ID
DMR_PURGED HEALTH_SERVICE_ITEM_NO Health Service Item Number
DMR_PURGED SYSTEM_CD System Code
DMR_PURGED PURGED_DT Purged Date
DMR_PURGED REC_CREATE_TIMESTAMP Record Create Timestamp
------------------------------------------------------------------

But there may be parameters you need to check - like some of the NLS parameters in Oracle.
Reply With Quote
  #4  
Old 06-08-2007
Registered User
 

Join Date: May 2007
Posts: 11
Quote:
Originally Posted by porter
How are you composing the file?

If you edit the file on the UNIX box with vi does the problem go away?

thats the whole problem......i m trying to edit it via Vi editor on unix and it doesnt let me edit.
so i making the changes ona notepad and FTP on unix....it still gives special characters in place of quotes
Reply With Quote
  #5  
Old 06-08-2007
Registered User
 

Join Date: May 2007
Posts: 11
the DBA got back to me saying that fo rthem it showed special chracters instead of quotes in the comment line........actually i created this doc in notepad an dthen FTP on unix server
Reply With Quote
  #6  
Old 06-09-2007
solfreak's Avatar
Registered User
 

Join Date: Jun 2007
Posts: 35
Quote:
Originally Posted by agarwalniru
thats the whole problem......i m trying to edit it via Vi editor on unix and it doesnt let me edit.
so i making the changes ona notepad and FTP on unix....it still gives special characters in place of quotes
On the unix machine try:
tr -d '\r' < file.txt > file
Reply With Quote
  #7  
Old 06-09-2007
Shell_Life's Avatar
Registered User
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
Agarwalniru,
If you have the text in Notepad, the quick solution is to just
copy and paste it to unix vi.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:44 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0