Functions for work with MYSQL

Hi! I know that SC has function sc_lookup, but I don’t know if there are functions like INSERT and UPDATE. Please, help.

Of course. But the best way is to open up an event like onvalidate and then you’ll find on the right side a lot of code snippets to insert, update, delete and search for data. Just click the green spot and a piece of code is generated for you to change to your needs. No need to copy it here.

Thanks! It was really helpful! But now I have another questions.

  1. How can I update and insert into second(another) DB?
  2. On the right side of the window I could not find function that can help me create a table in DB. Is there a CREATE function or similar?

Thank you in advance

Simon,

       Every sql command you can run with the macro sc_exec_sql even create commands, see some examples:

sc_exec_sql(“delete from outratab where field= {value}”);
sc_exec_sql(“update outratab set name ='teste 'where field= {value}”);

Simon,

       Every sql command you can run with the macro sc_exec_sql even create commands, see some examples:

sc_exec_sql(“delete from outratab where field= {value}”);
sc_exec_sql(“update outratab set name ='teste 'where field= {value}”);

Another tip is: if you want to run a sql command in another database you can pass the connection’s name in the second parameter of the sc_exec_sql like this:

sc_exec_sql (“delete from outratab where field= {value}”, “conn_teste”);

Thank You!

You are welcome