sc_select with connection parameter not work.

Hi, i have two ODBC connection in SC:

  1. conn_a
  2. conn_b

In a blank app i wanto to execute some query on all my connection, first on conn_a, then on conn_b.

This is my code:


for ($i = 1; $i <= 2; $i++) {
       //sc_reset_change_connection ();
    if ($i == 1){
        //conn_a
        $connection = "conn_a"; 
    } else {
        //conn_b
        $connection = "conn_b";   
    }
    $sqlString = "SELECT
        codicegruppo,
        idTemplate
    FROM slam_auto_spedisci
    WHERE  spedisci = 1";
    sc_select(my_data_gruppi, $sqlString, $connection);

    if ({my_data_gruppi} === false){
        echo "Access 1 error. Message=". {my_data_gruppi_erro} ;
    } elseif (empty({my_data_gruppi})){
        echo "Select 1 command didn't return data";
    } else {
.....
}

Php return to me this error:

[Tue Feb 09 11:58:54.054149 2016] [:error] [pid 1473] [client ::1:47652] PHP Parse error:  syntax error, unexpected ',' in /srv/http/scriptcase/app/tabulatostatusordini/esportazione_ordini_agenti/index.php on line 1174, referer: http://localhost/scriptcase/devel/iface/editor.php?randjs=ARRdVQ5CZMllAgT4

and this is my index.php, first line 1174


...

            
      $nm_select = $sqlString,$connessione;
      $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
      $_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
      if ($this->my_data_gruppi_agenti = $this->Db->Execute($nm_select))
...

Why this error?
There is a better way?

Thanks.

Some SC macros don’t work if you use standard php variables as some of their parameters. In this case you can use a variabile for the SQL statement but not for the connection name.

Sometimes this seems workaroundable by using SC variables: [varname] or {varname}.

It’s a little messy and it seems something that NetMake could fix easily, but apparently they don’t care.

Hello everyone, I also confirm the post of Robydago.
Some macros are SC have problems, I’ve also met this kind of problem and I lost a lot of time to solve the problem. This is also caused by poor documentation SC provides.

Estoy pasando por el mismo problema, alguien lo soluciono de alguna forma?