0

Unable to concatenate output from SELECT statement query.

But I want something like:

SS = "start_" + [ID] from [Start Order = 1] ','  "ExecutionT" + [Start_Wait] 
SELECT 
    ID, Name, SName, Start_Order, Start_Wait
FROM
    File
WHERE 
    ZONE IN ('west') AND SNAME = 'DA'
ORDER BY 
    START_ORDER 

This is my current output:

ID                     SName      Name   Start_Order       Start_Wait
----------------------------------------------------------------------
i-001c9e54bc5a5fabc     DA      DevApp1     1                  3
i-03136748c823abdef     DA      DevApp2     2                  0
i-03c07d9e63eb53fgh     DA      DevApp3     3                  3

1 Answer 1

1

You can concate the column valies as following:

Select col1 || col2 || 'some string' 
from your_table

|| is the concatanation operator in oracle.

Your query should look something like following. Please adjust the constant strings, if not according to your requirement.

SELECT 'SS = start_' 
|| ID 
|| ' from [Start Order = '
|| start_order
|| '] '',''  ExecutionT ['
|| Start_Wait
|| ']'
        from File
           WHERE ZONE IN ('west') AND SNAME = 'DA'
        ORDER BY START_ORDER 

Cheers!!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.