Use double quotes in column alias

Hi,
I would like to alias a column that would look something like this <University "John Smith"> (without <,> chars).
I know in oracle when you use aliases you need to enclose the column name in double quotes if there are "special" characters.
In other words how can I write the query below:
select 1 as University "John Smith" from dual;
Thank you
Edited by: orange_square on Jan 14, 2010 7:39 AM
Edited by: orange_square on Jan 14, 2010 7:40 AM
Edited by: orange_square on Jan 14, 2010 7:40 AM

I might be wrong but I don't think you can use double quoted text inside another double quoted string. I don't think there's an escape character for it.
But maybe you could use single quotes? Not sure it will suit your needs.
SQL> select 1 as "University ""John Smith""" from dual;
select 1 as "University ""John Smith""" from dual
ORA-03001: unimplemented feature
SQL> select 1 as "University 'John Smith'" from dual;
University 'John Smith'
                      1
SQL>

Similar Messages

  • SAPscript DEFINE using double quotes.

    Hello all,
    It is OK to use double quotes in a DEFINE statement so an apostrophe will print?
    <u>Example:</u>
    :/Define &TITLE& = "That's all there is"
    which will then print <i>That's all there is</i>
    It worked in a test I created, but is this the best approach?  Is there a better solution?
    Thank you
    Bill Lomeli

    Hi,
    In the Script, Normally we define the varialbes using DEFINE and assign the text to it with Single codes ...
    Syntax: /: DEFINE &symbol_name& = 'value'
    /: DEFINE &subject& = 'Your letter of 7/3/95'
    The value assigned can have a maximal length of 60 characters. It may itself contain other symbols. A symbol contained within the value assigned to another symbol is not replaced with its own value at the point at which the DEFINE command is executed. Rather, this replacement is made when the symbol defined in the DEFINE command is called in the text.
    /: DEFINE &symbol1& = 'mail'
    /: DEFINE &symbol2& = 'SAP&symbol1&'
    Regards
    Sudheer

  • Re: Using double quotes with CellWrapper parameter on rwservlet

    I'm on 11.1.2 on Windows 2008 and I cannot for the life of me get a delimited report to generate with a double-quote cell wrapper.
    I've tried every suggestion that I can find, including the ones in this thread, but nothing seems to work.
    I reliably used delimiter=',' and cellwrapper='"' with 9i and 10g reports, but I can't find anything that does the trick in 11g.
    Any hints?
    Thank you!

    A little update....
    I was able to successfully generate a comma-separated report with a double-quote cellwrapper by creating a wrapper.cmd file as above with only the following contents:
    cellwrapper='"'
    BUT... I could only get this to work if I submitted the job using a URL to rwservlet. It still doesn't work with rwclient or rwrun. It's better than nothing, but I'd really like this to work with rwclient.
    FYI

  • Loading External files in Oracle - error (double quotes on columns)

    I managed to successfully load some external (Excel ) files in my Oracle database, but when I queried the table, I see that some of the columns have double quotes on them. Any idea how to remedy this problem?

    damorgan wrote:
    OPTIONALLY ENCLOSED BY double quotes in your syntax to remove them.
    http://www.morganslibrary.org/reference/externaltab.html
    Damorgan,
    Thank you!

  • ORA-00904 when use column alias in Record Group Query

    Is it possible to use column aliases in Record Group Queries?
    I have a query that runs fine in SQL*Developer, but gives me runtime errors when I use it as a Record Group Query.
    When I use it as a Record Group Query, the Form compiles, but at runtime I receive the following errors:
    FRM-40502: ORACLE error: unable to read list of values
    when I use Help - Display Error, I see:
    ORA-00904:"CHILDNAME":invalid identifier
    The query is something like this
    select decode(complex stuff here) as "childname" ....
    I've tried it with and without the double quotes surrounding the alias name, and have also tried it without using the "as" keyword.
    I would appreciate any suggestions or insights. I'm using Forms 9.0.4.
    Thanks.

    It looks like this is caused by bug 725059:
    "FILTER BEFORE DISPLAY" DOESN'T WORK IF LOV HAS COLUMN ALIASES (TRIAGE1098)
    My LOV does have the Filter Before Display turned on. Here's the text of the bug:
    IF an LOV is created with column aliases in the select statement, (eg: select ename emp_name from emp) and the LOV property "Filter Before Display" is "Yes", THEN when you attempt to filter the LOV at runtime, (eg: type '%' then press the 'Find' button) the internal WHERE clause that forms sends to the database is: WHERE column_alias LIKE '%%' This is incorrect syntax. A client-side sqlnet trace shows this. The correct syntax should be: WHERE column LIKE '%%' . The incorrect syntax results in no rows returned. However no error is displayed by forms to the user.

  • Using environment variable / double quotes in "Arguments" in "Server Start"

    I have an admin server, NodeManager, and 1 managed server, all on the same machine (windows). I am trying to enter something similar to this to the arguments field in the Server Start tab:
    -Dmy.property=%USERPROFILE%\someDir\someJar.jar
    But when the managed server is started it throws this exception:
    Error opening zip file or JAR manifest missing : %USERPROFILE%\someDir\someJar.jar
    It appears that the environment variable is not being translated into it's value. It is just passed on to the managed server as plain-text. I tried surrounding the path with double quotes (") but the console validates the input and does not allow this: *"Arguments may not contain '"'"*
    Even editing the config.xml file manually cannot work, as the admin server fails to startup after this:
    <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason: [Management:141266]Parsing failure in config.xml: java.lang
    .IllegalArgumentException: Arguments may not contain '"'.>
    I also tried using %20 to no avail, it is just passed as %20.
    I thought that perhaps this had something to do with the spaces in the value of %USERPROFILE% (which is "C:\documents and settings.."), but the same thing happens with other env. variables which point to other directories with no spaces.
    _My question:_
    Is there any supported way of :
    using double quotes? what if i have to reference a folder with spaces in it's name?
    reference an environment variable? What if i have to rely on it's value for distributed servers where i do not know in advance the variable's value?
    Edited by: 937622 on Sep 28, 2012 1:02 AM

    There is workaround : http://stackoverflow.com/questions/12629395/weblogic-using-environment-variable-double-quotes-in-arguments-in-server
    Just posting here for reference. Let's see if we get a different answer from anyone else.

  • Double quote encapsulated identifiers in sql developer 1.5.1

    hello,
    i migrated a mysql database to oracle using the sql developer 1.5.1 on linux. unfortunately i'm using some reserved words in my table name / columns. how is it possible to generate an import script that uses double quote encapsulated identifiers? in the migration workbench, there is an option named "Create ANSI-compilant names" which should do what i need, but i cannot find this option in sql developer.
    thank you for your help. regards,
    sebastian

    I'm not sure what your question is; Did you migrate successfully? How do you generate an import script? What is failing? Can you provide an example?
    K.

  • Ping and editing and double quotes

    Couple of issues using the Ping to comment and send email.
    1) It appears that using double quotes in either a comment on a Ping invite or a Recent Activity Item appears to cause problems. When referencing other songs/album/content I tend to quote them in the recent activity item comment and this causes an error.
    2) Not sure exactly how this happens, but a couple of times I have managed to delete my whole comment. It seems to occur when deleting in the middle of paragraph of text. Anyway, when this occurs the undo does not seem to work.
    Anybody notice these behaviors?

    Thanks for the tip! This worked for me for my invitation to friends to the "Ping" service. Non-specific error with quotes, but with Quotes removed, works fine.

  • Quotes in a column alias

    Possible to have double quotes in a column alias in a SQL projection? Long story involving Apex, Anychart v5 and how Apex names data serie in XML generated for multiple Y axis.
    This problem can be easily solved if I can add a double quote into a column alias. E.g.
    select
      some_col as "COL1"" param1=123"
    from dualNo comment about Apex using column labels for generating XML tag name-values... {noformat} ;-) {noformat}
    Of course, the SQL parser does not like the above format at all.
    Had a look at the SQL Reference guide and it does not say much in this regard. Seems like there's no workaround - correct?

    Hi,
    I can't think of any way to do that in SQL.
    In SQL*Plus, you can use COLUMN ... HEADING, with doubled double-quotes:
    COLUMN     dummy     FORMAT     A20     HEADING     "COL1"" param=123"
    SELECT     *
    FROM     dual;Output:
    COL1" param=123
    X
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • MySQL will only let me use backticks (not single or double quotes)

    What the hell is going on here? This worked fine until a recent update.
    SELECT * FROM "table";
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"table"' at line 1
    SELECT * FROM 'table';
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''table'' at line 1
    SELECT * FROM `table`;
    (table prints normally here)
    12 rows in set (0.00 sec)
    The error happens both in the mysql client, phpmyadmin, and all my php scripts. How do I make it accept single and double quotes?
    Phpmyadmin has this to say about the mySQL installation
    Server: Localhost via UNIX socket
    Server version: 5.1.50
    Protocol version: 10
    User: root@localhost
    MySQL charset: UTF-8 Unicode (utf8)
    Last edited by Krause (2010-10-16 10:18:16)

    Hello
    In the SQL Standard, table and column names don't have to be between quotes, only values can be (for instance if you have spaces in a value).
    Just call "SELECT * FROM table;", that's all.

  • How to Include Double Quotes in the Column Name

    Hi,
    I am using Dynamic Sql for creating the columns of a table. I am getting a situation where the user will give the double quotes for some column names. So,Can we add double quote to the column name.
    Thanks in advance.
    Regards,
    Alok Dubey

    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements008.htm
    However, neither quoted nor nonquoted identifiers can contain double quotation marks or the null character

  • 00904 error when sorting columns that require double quotes

    We have used an ETL tool to import an XML file into Oracle 10g. The column names are mixed case and unfortunately have to remain mixed case because we have a "column" and a "Column" name with different info in them. So when we migrate it in, the field names have be enclosed in double quotes in all SQL operations. The problem in SQL Developer 1.5.1 (Win XP SP2, Oracle 10G) though is that if I try to sort on a column by double clicking the column header, we get an ORA-00904 error COLUMN does not exist. So it looks like it is trying to do an ORDER BY without putting the column name in double quotes. Has anybody else had issues with this and is there a fix for it?
    Message was edited by:
    coachy

    It's a bug.
    Logged Bug 7344539 - 00904 error when sorting columns that require double quotes
    Workaround: Use the sort button on DataTab's toolbar.
    -Raghu

  • Using column alias with CASE

    It is possible to use a column alias with a CASE in a SELECT? e.g. I have this code
    SELECT
    CASE WHEN categ_1 = 'BASIC' THEN total_1 WHEN categ_2 = 'BASIC' THEN total_2 END
    FROM totalsBut the results column name comes out as CASEWHENCATEG_1='BASIC'THENTOTAL_1WHENCATEG_2='BASIC'THENTOTAL_2END
    I want to use an alias but can't get it to work with the CASE. I guessed at
    SELECT
    CASE WHEN categ_1 = 'BASIC' THEN total_1 WHEN categ_2 = 'BASIC' THEN total_2 END 'alias'
    FROM totalswhich doesn't work.

    Try without the single quotes after END
    Christopher Soza
    Oracle BI DBA
    Orix Consultancy Services Ltd
    b: http://sozaman.blogspot.com

  • View Columns with Double Quotes

    When Creating a view I specify Column Names, but when you look at the SQL tab it puts double quotes around the columns is there a preference to turn this off? Is there a reason for it operating this way?
    CREATE OR REPLACE FORCE VIEW "MCT"."V_USER_ORGANIZATIONS" (CUSTOMERS_ID, CUSTOMER_NAME) AS
    SELECT Customers_ID, Customer_Name FROM mct.Customers
    UNION ALL
    SELECT Proc_Offices_ID *-1 as Customers_ID, Proc_Office_Name as Customer_Name FROM mct.proc_offices;
    becomes the following
    CREATE OR REPLACE FORCE VIEW "MCT"."V_USER_ORGANIZATIONS" ("CUSTOMERS_ID", "CUSTOMER_NAME") AS
    SELECT Customers_ID, Customer_Name FROM mct.Customers
    UNION ALL
    SELECT Proc_Offices_ID *-1 as Customers_ID, Proc_Office_Name as Customer_Name FROM mct.proc_offices;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    The only control we have over the DDL that is generated are the options in Tools > Preferences > Database > ObjectViewer Parameters, which doesn't include an option to exclude unnecessary double quotes.
    The reason why they are put in when generating the DDL is to simplify the logic of generating the DDL - if they were not there, it would be necessary to check if names were in mixed case or not. For example, it would be possible to create a view as follows:
    CREATE OR REPLACE FORCE VIEW "My_View" ("Customer_ID", "Customer_Name") AS ...
    With this, I have explicitly said that my view and column names are case sensitive - and this is NOT equivalent to:
    CREATE OR REPLACE FORCE VIEW MY_VIEW (CUSTOMER_ID, CUSTOMER_NAME) AS ...
    That being said, as I understand it, SQL Developer uses the DBMS_METADATA package to generate the DDL and the inclusion of the double quotes is presumably the standard option with that.
    theFurryOne

  • How to enclosed the column with in double quotes while spooling to csv fie

    Dear Members,
    I have to spool a sql to a CSV file. I have two columns to spool one is vendor_id and another is vendor_name. But the 2nd column vendor_name has commas in it so if i see the o/p it looks like this:
    Suppose vendor_id = 12790 vendor_name = T T I, INCORPORATED
    when i see the csv file it looks
    12790,T T I, INCORPORATED
    I want each column be enclosed in double quotes like this
    "12790","T T I, INCORPORATED"
    How can i do this in sql*plus while spooling to a csv file.
    Thanks
    sandeep

    this?
    SQL> select '"'||'Hi'||'"'||',"'||'how'||'"' from dual;
    '"'||'HI'|
    "Hi","how"

Maybe you are looking for