Gen EDGE

  • 1.  SQL in Inline Code

    Posted Dec 18, 2015 09:12 AM

    I wonder if anyone can point to any specific examples of implementing an SQL Declaration within Inline Code?  I cannot find any documentation regarding this.  I am trying to call some SQL passing in parameters.

     

    Regards,

     

    Alex



  • 2.  Re: SQL in Inline Code
    Best Answer

    Broadcom Employee
    Posted Dec 18, 2015 10:34 AM

    Hi Alex

    please check the below links

    https://docops.ca.com/ca-gen-85-en/developing/designing/designing-action-diagrams/define-logic-for-elementary-processes-…

     

    There you should be able to see "how to add inline code statement containing ODBC/JDBC/ADO.NET Statements".

    Hope this help.

     

    Regards,

    Amit.



  • 3.  Re: SQL in Inline Code

    Posted Dec 21, 2015 07:09 AM

    Thank you Amit.  I had already viewed this.  It was all I had been able to find and not really that helpful with what I was trying to do, which was why I was seeking help from the community.

     

    Alex



  • 4.  Re: SQL in Inline Code

    Posted Dec 18, 2015 12:08 PM

    Could you be more specific about what you want to do (i.e. what database, what SQL statement(s), etc.)?

     

    If you want to execute generic SQL in the Inline Code statement, you do need to add the EXEC SQL ... END EXEC to the statement (when targeting DB2 and Oracle but not when targeting JDBC, ODBC/ADO.NET and MS/SQL because MS/SQL uses ODBC; the other reply points to a document on how to use ODBC/ADO.NET and JDBC databases) and you do have to select a database and, if there are any other statements besides SQL, a language.

     

    If the statement needs host variables (i.e. a SELECT statement), then you define those host variables in the box in the upper left-had corner of the Inline Code dialog.  If you need to use action diagram views, put the cursor in the position within the dialog where you want to insert a view and select the Insert View Reference button to give you a list of available views.

     

    If you need to reference the name of a table or column in the selected database and can't remember what that name is, again, put the cursor in the position within the dialog where you want to insert the name, select the Insert Physical Model Element button (only enabled when a database is selected) and select the name you want.



  • 5.  Re: SQL in Inline Code

    Posted Dec 21, 2015 07:09 AM

    Thank you John, this if very helpful.

     

    Alex