This content has been marked as final. Show 2 replies
The string should be long enough to accommodate the output. For example, for a maximum length of 10 characters you can do <tt>'aaaaaaaaaa'</tt> or <tt>cast('a' as varchar2(10))</tt>. Also you need to use single quotes instead of double quotes. In SQL double quotes are used for specifying identifiers (like column names, table names, etc.). In your example <tt>"1"</tt> is an unknown identifier. What you need is a string literal.
Thanks Denis, it worked.
Just one more point that was found, single quote (') needs to be prefixed with another single quote or else the sql statement would result in syntax error.
cast(''a'' as varchar2(10)) would be more appropriate.