Create an object returning a constant value

For some of our reports we need objects which return a constant value. The syntax in SQL would be “Select ‘TEXT’ from dual;”. Is there an easy way to do this? We are now decoding like this: “decode(table.column, ‘TEXT’, ‘TEXT’, TEXT’)”. It works just like we want it to, but I assume there is a better way to accomplish this.

Thanks for your reaction,

Susanne Bakker
ING Netherlands


Listserv Archives (BOB member since 2002-06-25)

In a message dated 98-08-15 16:34:20 EDT, you write:

@Susanne:
Simply enter your text in the “Select” portion of the object, and leave the “Tables” portion blank. In other words, you are creating SQL that looks like:

Select "Text" From... 

… which will fail to parse. However, as long as the user puts this object on a query with at least one object that does reference a table, the generated SQL will be:

Select "Text", Table.Column From Table

Which will work just fine. You could also consider creating an @Prompt() object which promts the user for the desired text.

Regards,
Dave Rathbun
Integra Solutions
www.islink.com


Listserv Archives (BOB member since 2002-06-25)

Hi

I have tried to create an object returning a constant value at the universe. But when I use this object with another object at the report level , it is giving this error. I am using 6.1a version of BO.

Also the SQL generated at the report level is :

SELECT
  "FSRID",
  dbo.ErrorPages.ErrorPageID
FROM
  dbo.ErrorPages

Is there a solution to this problem.
Pls let me know, any help will be appreciated. Thanks


neha008 (BOB member since 2007-07-09)

The constant should be in apostrophes, not quotation marks … ‘FSRID’


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

you simply need to create a new object and in the select statement put ‘text’ including the single quotes. No need to put select or from part. Object will not parse but will return the constant


bigman (BOB member since 2007-06-20)

Any particular, good reason are you posting in a thread 4 years old/stale? :roll_eyes:


Andreas :de: (BOB member since 2002-06-20)