Innov-AI
    Documentation | MentDB Weak Server
Read a SQL Database and write a JSON Array file

  • try {
    
    	sql connect "session1" {cm get "demo_cm_mysql";};
    
    	json load "keyIdArray" "[]";
    	sql parse "session1" "T" (concat "select id, name, quantity from products") {
    
    		json load "row" "{}";
    		json iobject "row" / "id" [T_id] NUM;
    		json iobject "row" / "name" [T_name] STR;
    		json iobject "row" / "quantity" [T_quantity] STR;
    
    		json iarray "keyIdArray" / (json doc "row") OBJ;
    	
    	};
    
    	sql disconnect "session1";
    
    	json doc "keyIdArray";
    
    } {
    
    	try {sql disconnect "session1";} {} "[err]";
    
    } "[err]";
Services     Supporters     Contact     About     Legal notice © 2024