Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2005
    Posts
    2

    Unhappy Unanswered: Problems with SUBSTRING COMMAND

    I am using ORACLE 9i and it doesn't recognize neither the function SUBSTRING (or SUBSTR) nor PARSENAME.

    Let's say I want the first and the second letter of a department name. I tried that in the SQL PLUS WORKSHEET:

    SELECT SUBSTRING(DEPARTNAME,1,2) FROM DEPARTMENT;

    and it says that can't recognize the SUBSTRING FUNCTION. The same applies to PARSENAME and SUBSTR.

    The thing is that, when you are using sql plus worksheet, everytime you write something like SELECT, WHERE, ORDER, FROM... the programs changes their colour to blue, whereas SUBSTRING remains black... just like if the program didn't recognize it.

    Could you help me please =)

    JRRM

    PS: I searched the forum =) but couldn't find a solution to that.

    ----------------
    Learning to fly

  2. #2
    Join Date
    Nov 2002
    Posts
    833
    RTM

    tahiti.oracle.com

  3. #3
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    I don't use SQL Worksheet, so Idon't know about the blue font issue, but the function is SUBSTR - SUBSTRING and PARSENAME are not built-in Oracle functions. Forget about the colour, what actually happens if you use SUBSTR in a SQL statement? Do you get an error?
    Code:
    SQL> select substr(dname,1,1) from dept;
    
    S
    -
    A
    R
    S
    O
    
    SQL> select substring(dname,1,1) from dept;
    select substring(dname,1,1) from dept
           *
    ERROR at line 1:
    ORA-00904: invalid column name

  4. #4
    Join Date
    Jan 2005
    Posts
    2

    Talking it works

    it works with substr

    thanks a lot

    JRRM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •