This discussion is archived
3 Replies Latest reply: Jan 9, 2013 6:29 AM by 982153 RSS

SUBSTR function working only in SQL developper?

982153 Newbie
Currently Being Moderated
Hello,

I type the following query based on what I am learning in terms of Single-row Functions and it seems to work in SQL developer but for some reason not in SQL Plus ? Can anyone tell me where i am going wrong?

Select Job_title,
SUBSTR(Job_title, 1, 10)
SUBSTR(Job_Title, 11)
from jobs;

This is just to test the function's abilities and to see what it does but I was wondering as to why it doesn't work on the SQL plus prompt. Any help would be greatly appreciated.

Thank you
  • 1. Re: SUBSTR function working only in SQL developper?
    EdStevens Guru
    Currently Being Moderated
    Vlakarmis wrote:
    Hello,

    I type the following query based on what I am learning in terms of Single-row Functions and it seems to work in SQL developer but for some reason not in SQL Plus ? Can anyone tell me where i am going wrong?

    Select Job_title,
    SUBSTR(Job_title, 1, 10)
    SUBSTR(Job_Title, 11)
    from jobs;

    This is just to test the function's abilities and to see what it does but I was wondering as to why it doesn't work on the SQL plus prompt. Any help would be greatly appreciated.

    Thank you
    "Doesn't work" is not an actionable error message.
    Please use copy and paste - copy your entire sqlplus session - full sqlstatement and full response, and post back here. If it returns many rows, we don't need to see all of them, just a representative sample.
  • 2. Re: SUBSTR function working only in SQL developper?
    rp0428 Guru
    Currently Being Moderated
    >
    I type the following query based on what I am learning in terms of Single-row Functions and it seems to work in SQL developer but for some reason not in SQL Plus ? Can anyone tell me where i am going wrong?

    Select Job_title,
    SUBSTR(Job_title, 1, 10)
    SUBSTR(Job_Title, 11)
    from jobs;

    This is just to test the function's abilities and to see what it does but I was wondering as to why it doesn't work on the SQL plus prompt. Any help would be greatly appreciated.
    >
    It won't work anywhere.

    You are missing a comma between the two SUBSTR functions.
    Select Job_title,
    SUBSTR(Job_title, 1, 10), --     <--- added the missing comma
    SUBSTR(Job_Title, 11)
    from jobs;
  • 3. Re: SUBSTR function working only in SQL developper?
    982153 Newbie
    Currently Being Moderated
    THanks guys and yeah sorry, next time I will post the error code to be more specific. This forum is great and I really appreciate your patience and help guys. I am totally new to IT, although I did do around 2 months of MySQL self teaching before moving to Oracle as it seems to be the most powerful and detailed of the database languages/programs.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points