Oracle Message PCC-02445 - USING clause valid only on a PREPAREd dynamic statement

ERRORUSING clause valid only on a PREPAREd dynamic statement
CAUSEThe USING clause was used with an OPEN cursor statement where the cursor declaration was not for a PREPAREd statement. The correct sequence of statements should be as follows EXEC SQL PREPARE s FROM : stmt; EXEC SQL DECLARE c CURSOR FOR s; EXEC SQL OPEN c USING ...;
ACTIONUse the PREPARE statement for the SQL statement and use that in the DECLARE CURSOR statement.