Can I interface tcl script with a database Mysql

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Is there a method in Hypermesh, so that tcl scripts can interface with a database (mysql)?

 

Many thanks in advance,

 

Tagged:

Answers

  • Sanjay Nainani_20973
    Sanjay Nainani_20973 New Altair Community Member
    edited February 2018

    Hello,

     

    Can you please tell me what is your usecase and elaborate more about it.

     

    Thank you

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited February 2018

    Hi,

    We would purely like to keep a track of when a user uses a certain tcl script.

    So the thought is to keep track of script stats in a small db.

     

    Many thanks

     

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited February 2018

    TCL has binding interface for MySQL, for sure!

    But with Hyperworks's Tcl, I'm not sure. Any way, if it does not work, you need install some add-on module for MySQL.

  • tinh
    tinh Altair Community Member
    edited February 2018

    Hi,

    We would purely like to keep a track of when a user uses a certain tcl script.

    So the thought is to keep track of script stats in a small db.

     

    Many thanks

     

     

    try using trace command, example

     trace add execution source enter p_RecordScriptRunning  proc ::p_RecordScriptRunning args {          set fpt [open Database.db a]          puts $fpt $args          close $fpt  }

     

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited February 2018

    If you want to keep some simple things, just use plain text log file. You not need MySQL for that.