2

Is there anyway to add a constant value in the results of a progress query?

In sql server you can do it by going

select *, 1 As DateID from dbo.customers

1 being the static field inserted Not sure how or if you can do this in a progress db?

jarlh
  • 42,561
  • 8
  • 45
  • 63
Shiniece
  • 37
  • 1
  • 4
  • How are you going to use the query result? Are you populating a temp-table, a ProDataset? Visualizing this in a GUI Browse widget? Are you processing the query in code? – Mike Fechner Nov 30 '16 at 17:03
  • Can you please post the sample output for this query? – Austin Nov 30 '16 at 17:11
  • Im moving data to a tables using an SSIS package. I have an ODBC source and an OLE DB destination. I want one value to always be true in my destination table. I know there are other ways to do this. I was just curious to learn if Progress allows you to define constant values in query results. – Shiniece Nov 30 '16 at 17:37
  • Sample results would simply be all the data in the table plus another column titled "DateID" with all values of 1 – Shiniece Nov 30 '16 at 17:39

2 Answers2

1

No, there is no way to add constant values to the result when you use "*" in the query. One workaround is to write all the column names instead of using "*" and then at last use constant value in the query.

Example:

select c1, c2, c3, c4, 1 as DateID from dbo.customers 
Austin
  • 1,237
  • 1
  • 11
  • 22
0
     SELECT * 
       FROM (SELECT 'somestaticvalue' AS staticvalcolumn
               FROM "PUB"."_Db" AS dummy 
             OFFSET 0 ROWS 
              FETCH FIRST 1 ROWS ONLY) AS staticvalplaceholder
 RIGHT JOIN "PUB"."Customer" cust on 1=1
  • 1
    While this code may answer the question, it would be better to include some context, explaining how it works and when to use it. Code-only answers are not useful in the long run. – 7uc1f3r Jan 19 '21 at 12:02