How to include sql function in an sql query in Dataset using Opentext Birt tool

Sai krishna
edited February 11, 2022 in Analytics #1

Hello,

I would like to add an sql function in the SQL query using Case condition in the Dataset using BIRT tool. Could anyone please help me how to write a query for this. Or if there any other option like mapping in the tool. Thanks in advance.

Warning No formatter is installed for the format ipb

Comments

  • The query syntax depends on the database. Birt doesn't have its own query language. It simply passes the query to the database through the database driver and the result is returned. Look at what the database expects for syntax. You can find the syntax by searching the web, looking at the database user guide, or asking on a forum for the database you are using.

    Warning No formatter is installed for the format ipb
  • Hello Jeff,

    Good day!
    I have to write an if condition like :
    if ID matches - then do update to the remaining columns of that ID.
    else - then do insert that values into the table.
    But I have to write this condition in PGSQL. Here I am trying to use MERGE in the function. But after that I am getting an error. Could you please help me how to merge in pgsql.

    Thanks in advance.

    Warning No formatter is installed for the format ipb
  • @Sai Krishna said:
    Hello Jeff,

    Good day!
    I have to write an if condition like :
    if ID matches - then do update to the remaining columns of that ID.
    else - then do insert that values into the table.
    But I have to write this condition in PGSQL. Here I am trying to use MERGE in the function. But after that I am getting an error. Could you please help me how to merge in pgsql.

    Thanks in advance.

    Please find the error message below:

    Warning No formatter is installed for the format ipb
  • jfranken
    edited September 12, 2019 #5

    Hi Sai,

    I wish I could help, but this question is outside of the forum scope. I noticed that the error message has an extra "t" at the end of "insert".

    Warning No formatter is installed for the format ipb
  • Hi Jeff,

    It was the user-defined table name "insertt" created by me. I have given two t's to make it different with the keyword 'insert'.
    :neutral:

    Warning No formatter is installed for the format ipb
  • @Sai Krishna said:
    Hi Jeff,

    It was the user-defined table name "insertt" created by me. I have given two t's to make it different with the keyword 'insert'.
    :neutral:

    And Could you also please tell me how to use MERGE in postgre SQL. I am getting the above error while I am running the below code in the postgre SQL function.( I am using pgAdmin III). Please let me know if I have done any mistake in the code while creating the function.

    Code:-

    _BEGIN

    MERGE INTO insertt as target  
    USING (values(uusername, ttime)) AS source
    ON (target.user_name = source.uusername)  
    
    THEN MATCHED and target.user_name source.uusername THEN
    UPDATE SET target.scrolltime = source.ttime 
    
    WHEN NOT MATCHED BY target THEN  
        INSERT (user_name, scrolltime) VALUES (source.uusername, source.ttime);
    

    END; _

    Thanks in advance.

    Warning No formatter is installed for the format ipb
  • Warning No formatter is installed for the format ipb