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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quotes in select statements

Status
Not open for further replies.

dklloyd

MIS
Mar 9, 2001
78
0
0
GB
Hi again
I want to create an SQL that will put the default values in one database into another. The trouble is that most of the rows have ' ' as a default value (quotes included).

The select statement so far goes like this:
select 'alter TABLE '||table_name||' modify '||c.COLUMN_NAME||' default '||c.DATA_DEFAULT
from user_tab_columns c
where c.DATA_DEFAULT = ''' ''';

I'm either getting an SQL not properly terminated error or inconsistant datatype error on c.DATA_DEFAULT.

I'm sure the solution is rather logical, but it's baffling me in the early hours.

Many thanks in advance........

dklloyd
 
I tried using a temp table which has only one field of varchar type.

I insert '' as the value of the column thru the following insert statement.

insert into tt1 values('''''');

in the same way to select I have to say:

select * from tt1 where value in ('''''');

I cannot justify the above query. I am not sure how it works. As of now u can try yr query using "in" operator followed by 6 quotes.

Hope this helps. Talent is what you possess;
genius is what possesses you

 
Hi,
Just a side question about your data design..Why are there '' default values? Do you like making your life difficult?

[profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top