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

  • try {
    
    	sql connect "session1" {cm get "demo_cm_mysql";};
    
    	xml load "result" "<data></data>";
    	sql parse "session1" "T" (concat "select id, name, quantity from products") {
    
    		xml load "row" (concat "<item id=\"" [T_id] "\" quantity=\"" [T_quantity] "\"></item>");
    		xml utext "row" "/item" [T_name];
    
    		xml inode "result" "/data" (xml doc "row";);
    	
    	};
    
    	sql disconnect "session1";
    
    	xml doc "result";
    
    } {
    
    	try {sql disconnect "session1";} {} "[err]";
    
    } "[err]";
Services     Supporters     Contact     About     Legal notice © 2024