yes, you are right
a simple call to something like this and then proceed on from there
CREATE OR REPLACE FUNCTION count_pk_cols (p_constraint_name IN VARCHAR) RETURN NUMBER
AS
var_col_count VARCHAR2(100);
BEGIN
SELECT COUNT(column_name) INTO var_col_count
FROM user_cons_columns
WHERE constraint_name = p_constraint_name;
-- FOR DEBUGGING dbms_output.put_line(var_col_count);
RETURN var_col_count;
END;
/




Reply With Quote