Help Center/
    
      
      Database and Application Migration UGO/
      
      
        
        
        User Guide/
        
        
        Syntax Conversion/
        
        
        Risky Custom Functions/
        
        
        Replacing Custom MySQL Functions with GaussDB Functions/
        
      
      acos
    
  
  
    
        Updated on 2025-06-07 GMT+08:00
        
          
          
        
      
      
      
      
      
      
      
      
  
      
      
      
        
acos
Database Type and Version
- Source database type and version: all MySQL versions
 - Target database type and version: all GaussDB versions
 
Function replacement syntax:
CREATE OR REPLACE FUNCTION dsc_mys_ext.dsc_fn_acos
/* This function is used to support MYSQL ACOS */
     ( i_str           IN   TEXT
     )
RETURN NUMBER 
IMMUTABLE
AS 
    v_acos         NUMBER;
BEGIN
IF i_str < -1.00 or i_str > 1.00
 THEN 
     RETURN NULL;
ELSE 
 SELECT ACOS(i_str) into v_acos from sys_dummy;
    RETURN v_acos;
END IF;
EXCEPTION
   WHEN OTHERS THEN
    v_acos := 0;
	RETURN v_acos;
END;
   Parent topic: Replacing Custom MySQL Functions with GaussDB Functions
  
 Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
                The system is busy. Please try again later.
                
            
        For any further questions, feel free to contact us through the chatbot.
Chatbot