Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2011
    Posts
    82

    Unanswered: Concatenate with a space in between fields

    Hello

    Could someone kindly help me

    I am using SQL developer and I am trying to concatenate 2 fields together with a space in between so I can return the following results:

    "09-DEC-10 12:45"

    I have written the following, and get the subsequent results

    A)
    SELECT
    SESSION_START || '' ||INTO_RECOVERY AS CHECKING
    FROM GRS

    09-DEC-1012:45

    B)
    SELECT
    CONCAT(SESSION_START,'',INTO_RECOVERY)
    FROM GRS

    "invalid number of arguments"



    Can someone help me with the correct syntex to use?

    Many Thanks
    Helen

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    A "space" should be a "space", not an empty string:
    Code:
    SQL> select ename || ' '|| job from emp;
    
    ENAME||''||JOB
    --------------------
    SMITH CLERK
    ALLEN SALESMAN
    WARD SALESMAN
    JONES MANAGER
    MARTIN SALESMAN
    In other words:
    Code:
    YES: || ' ' ||
    NO : || '' ||
    See the difference?

  3. #3
    Join Date
    Dec 2011
    Posts
    82
    Thank you

    I definately see the difference now..Gosh, how stupid was I

    Thanks
    Helen

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    An objection, if I may: learn how to use code tags. They will preserve formatting and make your code easier to read (see the difference between your code and mine?). Mistakes - just like the one you made - are much easier to spot when a code is formatted.

Posting Permissions

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