Innov-AI
    Documentation | MentDB Weak Server
Generate Web-Service to INSERT on table

  • To generate Web-Service to INSERT on table:
  • Right click on the table 'apps' and select 'GEN WS > INSERT'
  • script create post "MENTDB.apps.insert" false 1
      (param
      	(var "[app_id]" {true} "description ..." is_null:false is_empty:false "example ...")
      	(var "[title]" {true} "description ..." is_null:false is_empty:false "example ...")
      )
      "Insert a new element into the table 'apps'."
    {
    	
    	try {
    		
    		#Connection ...;
    		sql connect "session1" {cm get "MENTDB"};
    		
    		-> "[result]" (sql dml "session1" (concat 
    			"INSERT INTO public.apps (
    				app_id,
    				title
    			) VALUES (
    				" (sql encode [app_id]) " ,
    				" (sql encode [title]) "
    			);"
    		));
    		
    		#Disconnection ...;
    		sql disconnect "session1";
    		
    		# Return the json;
    		[result]
    		
    	} {
    
    		#Close the connection;
    		try {sql disconnect "session1"} {} "[sub_err]";
    
    		#Generate an error;
    		exception (1) ([err]);
    		
    	} "[err]";
    	
    } "Return the number of impacted lines.";
  • Update the script and save:
  • Execute buttons
Services     Supporters     Contact     About     Legal notice © 2024