SQL Language (MOSC)

MOSC Banner

Struggle with syntax

edited Dec 28, 2011 3:59AM in SQL Language (MOSC) 7 comments
I have the following sql that is giving me trouble:

select 'select timepoint, space_usage, space_alloc, quality from table(dbms_space.object_growth_trend(' ||"' owner'" ||',' ||"' table_name'" ||','"'TABLE'"')
);' from dba tables where owner='USER';

ERROR at line 1:
ORA-00923: FROM keyword not found where expected

I am not sure where I might missed a quote.

But I intend the query to return me the following:

select timepoint, space_usage, space_alloc, quality from table(dbms_space.object_growth_trend('SCHEMA','TABLENAME','TABLE'));

But I am not sure what I need to use as escape to print the single quote. I used the double quote outside of the single quote and obviously it is not working right. Any SQL gurus has any suggestions? Thanks.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center