Note that there are some explanatory texts on larger screens.

plurals
  1. POPostgreSQL database stored procedure
    text
    copied!<p>Create stored procedure <code>getoperatordetails</code> in postgresql database.</p> <p>Getting the three parameters in another stored procedure, but it is causing error, avoid the error and will get result True (or) False </p> <pre><code> CREATE OR REPLACE FUNCTION getoperatordetails(value character varying, operator character varying, fieldinputvalue character varying, retvalue boolean) RETURNS SETOF boolean AS $BODY$ declare iVal numeric; gVal numeric; begin IF fieldInputValue != ' ' AND operator!='equal' THEN gVal := value :: numeric; iVal := fieldInputValue:: numeric; IF (operator = ('lesserThan') AND iVal &lt; gVal) THEN retValue= true; ELSIF (operator = ('greaterThan') AND iVal &gt; gVal) THEN retValue= true; ELSIF (operator = ('lessOrEqual') AND iVal &lt;= gVal) THEN retValue= true; ELSIF (operator = ('greaterOrEqual') AND iVal &gt;= gVal) THEN retValue= true; ELSIF (operator = ('equal') AND value = (fieldInputValue)) THEN retValue= true; ELSE retValue= false; END IF; ELSIF (operator=('equal') AND value=(fieldInputValue)) THEN retValue= true; ELSE retValue= false; END IF; return next retValue; end; $BODY$ LANGUAGE plpgsql VOLATILE COST 100 ROWS 1000; ALTER FUNCTION getoperatordetails(character varying, character varying, character varying, boolean) OWNER TO postgres; </code></pre> <p>I need to get the result True (or) False</p> <blockquote> <p>ERROR: argument of AND must not return a set<br> LINE 1: SELECT retValue AND getoperatordetails(value, operator, fiel...)</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload