Anonymous_User Absent Member.
Absent Member.
934 views

Data Integrator Query Syntax


We are working on an adapter for RoomView to bring alerts int NOC about
projectors, and we are running into a problem with a query we have in
the data integrator. We are wondering how to add an else clause to an
if statement. I know this is a simple question, but we have not been
able to get it to work.
Here is the if statement:
#if ( ${query.initial} ) 'None' #end as "_ID2_Ticket_Number"
We want to add an else statement, would we just add "else(<my logic
here>)"? Is there any other brackets or curly braces we need to add?
Thanks in advance for the help!


--
jeffcroskrey
------------------------------------------------------------------------
jeffcroskrey's Profile: https://forums.netiq.com/member.php?userid=2905
View this thread: https://forums.netiq.com/showthread.php?t=46699

Labels (1)
0 Likes
2 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Data Integrator Query Syntax


Hi Jeff,

Perhaps not a direct answer on your question but I use oftern the a Case
statement.

The syntax goes as follows

select a, b, c, "caseVar"=
CASE WHEN ([syntax value A]) > [compare value A] THEN '[Result value
A]'
WHEN ([syntax value B]) > [compare value B] THEN '[Result value B]'
ELSE '[else value]'
from [database]
etc.

Change the [] with your values. You can also cases to the statement.

Syntax is ouf my head. Please check it as well.

Regards,

Jeroen


--
jvangassel
------------------------------------------------------------------------
jvangassel's Profile: https://forums.netiq.com/member.php?userid=2532
View this thread: https://forums.netiq.com/showthread.php?t=46699

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Data Integrator Query Syntax


In the place where you would drag and drop one column, you can use a SQL
OEM "if" statement or a case statement like Jeroen mentioned above. I
have done both but tend to use case statements more.

CASE room
WHEN '135' THEN 'Room 135'
WHEN '085' THEN 'Room 85'
ELSE 'No Room, must be basement'
END

If you really need an 'if', give me an example of the query and if it is
oracle, sql, etc.


--
tisenberg
------------------------------------------------------------------------
tisenberg's Profile: https://forums.netiq.com/member.php?userid=1851
View this thread: https://forums.netiq.com/showthread.php?t=46699

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.