Search
 
SCRIPT & CODE EXAMPLE
 

SQL

ring MySQL create new table and insert records

func main
        see "Create Table and Insert Records" + nl
        con = mysql_init()

        see "Connect" + nl
        if mysql_connect(con, "localhost", "root", "root","mahdb") = 0
                system_error(con)
        ok

        see "Drop table" + nl
        if mysql_query(con, "DROP TABLE IF EXISTS Employee")  system_error(con) ok

        see "Create table" + nl
        if mysql_query(con, "CREATE TABLE Employee(Id INT, Name TEXT, Salary INT)")
           system_error(con) ok

        see "Insert data" + nl
        if mysql_query(con, "INSERT INTO Employee VALUES(1,'Mahmoud',15000)")
           system_error(con) ok

        if mysql_query(con, "INSERT INTO Employee VALUES(2,'Samir',16000)")
           system_error(con) ok

        if mysql_query(con, "INSERT INTO Employee VALUES(3,'Fayed',17000)")
           system_error(con) ok

        see "Close connection" + nl
        mysql_close(con)

func system_error con
        see mysql_error(con)  mysql_close(con)  bye
Comment

PREVIOUS NEXT
Code Example
Sql :: how to innjert in other database 
Sql :: root mysqu 
Sql :: mysql aspas simples 
Sql :: oracle sql developer script output limit 
Sql :: dependency 
Sql :: mysql conf.d exampel 
Sql :: How can INSERT INTO a table 300 times within a loop in SQL? 
Sql :: mysql order specific records at the top 
Sql :: multiple row join 
Sql :: Get top 1 row of each group 
Sql :: mysql select where field like in list 
Sql :: forenkey code alchemy sql 
Sql :: spring Flyway Teams Edition or MySQL upgrade required: MySQL 5.5 is no longer supported by Flyway Community Edition, but still supported by Flyway Teams Edition. 
Sql :: sql examples from your work 
Sql :: mysql grant execute 
Sql :: enable mysql remote connection to two specific ip address 
Sql :: for row in sql database python loop 
Sql :: SQL Create Named CHECK Constraint 
Sql :: sql query wordpress export post 
Sql :: SQL FULL OUTER JOIN With AS Alias 
Sql :: like in openquery 
Sql :: sql insert into only auto id 
Sql :: MySQL Quartiles in SQL query 
Sql :: deny select insert update delete sql 
Sql :: sql query contains multiple ids 
Sql :: get created time of database psql 8 
Sql :: add mysql database to power bi web 
Sql :: cahnge column name apex oracle 
Sql :: python sqlalcahmey compare datetime using AND_ or OR_ 
Sql :: can we compare two timestamps in mysql 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =