Connected with two databases and a different host

Connected with the two databases and a different HOST, I’ve done.
In this case I have a problem when entering record into the database A.

example:
I have 2 database connection that is:
con1 -> host 192.19.0.10; database name = A
con2 -> host 192.19.0.1 ; database name = B


I created a button in order to include records from database B to the database A.
I use a macro sc_exec_sql, and the error message like “ERROR: schema” HR “does not exist”

Please help me to get out of this error.
Thanks Before

Regard
LeiGen

Re: Connected with two databases and a different host

Did you specify the connection in sc_exec_sql?


sc_exec_sql ("sql command", "connection")

Regards,
Scott.

Re: Connected with two databases and a different host

Thanks Scott, you have helped me.

Regards
LeiGen

Re: Connected with two databases and a different host

Can explain better the procedure of connection of 2 differentes bases, 1 interbase + 1 mysql
I no comprernds not this story of macro

Thank you in advance fran?ois

Re: Connected with two databases and a different host

“ERROR: schema” HR “does not exist” sounds a connection problem.

Like oracle or others database that you need to connect on a schema.

Please, put turn on the debug mode.

Re: Connected with two databases and a different host

For example
Can give me myself a script of connection for two database mysql.
I am lost

THANK YOU

Hi DUFOUR,
Here is an example to connect to another database. First you need to create ‘connection_A’ and ‘connection_B’. Please go to ScriptCase Database>NewConnection.

#1 Example to execute a SQL query using ‘connection_A’

sc_lookup(rs, "select field from table", 'connection_A');

#2 Example to execute a SQL query using ‘connection_B’

sc_lookup(rs, "select field from table", 'connection_B');

Note: Your connection NAME is the name that you define in ScriptCase Database>NewConnection

How did make query with 2 different database and 2 different host ?