Announcement

Collapse
No announcement yet.

Functions for work with MYSQL

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    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.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      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

      Comment


      • #4
        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}");

        Comment


        • #5
          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");

          Comment


          • #6
            Thank You!

            Comment


            • #7
              You are welcome

              Comment

              Working...
              X