It may sound the simplest questions of all time.
I am trying to create some functions in vertica.
Function name - Total_size_in_MB
Function operation - This function should be able to tell us the total size occupied by the Data in your database.
Code: Select all
CREATE FUNCTION total_size_in_mb() return decimal
as begin
RETURN(select CEIL(sum(used_bytes)/1024/1024) as total_size_in_MB from v_monitor.storage_containers);
end;
ROLLBACK 4257: Only simple "RETURN expression" is allowed
While I am not giving any input arguments here. The SQL is giving an error as above.
Can somebody please explain this behaviour.