Service Virtualization

 View Only
  • 1.  Migrating to PostgreSQL database Match Script Join Query Error

    Posted Jan 27, 2020 06:46 AM
    Edited by Saikiran Garapati Jan 27, 2020 06:47 AM
    Hi Team,

    We are writing some join Query through Match script and that match script is generating some PostgreSql Join query but while generating it is not inserting double quotes in end of the query. Example query has given below:

    Match Script:

    JoinQuery query2 = TDMJoinQuery.create(Table.name("students2").PK("ID"), Table.name("Percentage2").FK("ID"));
    query2.whereArr(new WClause[]{new WClause("students2", "Name", request_Name)});

    Generated Query in Work Station: 

    SELECT DISTINCT "students2"."ID", "students2"."Name", "students2"."Class", "students2"."Address", "Percentage2"."ID", "Percentage2"."Perce" FROM DBName."students2" INNER JOIN DBName."Percentage2" ON "students2"."ID" = "Percentage2"."ID" WHERE "students2"."Name" = 'sai' AND students2.ID = Percentage2.ID

    Error in Logs:

    Internal Errororg.eobjects.metamodel.MetaModelException: Could not execute query: ERROR: column students2.id does not exist
    Position: 275

    If i add double quotes on last two table names "(students2"."ID" = "Percentage2"."ID") and column names it is fetching the values correctly

    So Please let me know where i am doing wrong..


  • 2.  RE: Migrating to PostgreSQL database Match Script Join Query Error

    Broadcom Employee
    Posted Jan 29, 2020 06:45 AM
    Hi Sai
          Is this a question for TDM product line ?

    regards
    Sankar

    ------------------------------
    Sankar Natarajan
    Service Virtualization Product Engineering Team
    Broadcom
    ------------------------------



  • 3.  RE: Migrating to PostgreSQL database Match Script Join Query Error

    Posted Jan 29, 2020 11:51 PM
    Yes Sankar, Please let me know whether my Query is wrong or do i need to do some thing in the code.



  • 4.  RE: Migrating to PostgreSQL database Match Script Join Query Error
    Best Answer

    Broadcom Employee
    Posted Jan 30, 2020 05:13 AM
    Hi Sai
                There is a community Dedicated to TDM questions. Please kindly post your question there:  https://community.broadcom.com/enterprisesoftware/communities/community-home/digestviewer?CommunityKey=909e0526-d8ad-455d-97eb-aa009df5d3aa  

    --
    regards
    Sankar Natarajan





  • 5.  RE: Migrating to PostgreSQL database Match Script Join Query Error

    Posted Jan 30, 2020 11:59 PM
    Ok I will check in that community thanks for the info Sankar