     RETURN VARCHAR
   IS
     schema_srid INTEGER;
-      unknown_srs_ex EXCEPTION;
-    BEGIN
-      EXECUTE IMMEDIATE 'SELECT COUNT(SRID) FROM MDSYS.CS_SRS WHERE SRID=:1' INTO schema_srid USING srsno;
-
-      IF schema_srid = 0
-      THEN
-        RAISE unknown_srs_ex;
-      END IF;
-
-      RETURN 'SRID ok';
-
-      EXCEPTION
+    unknown_srs_ex EXCEPTION;
+  BEGIN
+    SELECT COUNT(srid) INTO schema_srid FROM mdsys.cs_srs WHERE srid = srsno;
+
+    IF schema_srid = 0 THEN
+      RAISE unknown_srs_ex;
+    END IF;
+
+    RETURN 'SRID ok';
+
+    EXCEPTION
       WHEN unknown_srs_ex THEN
-      dbms_output.put_line('Table MDSYS.CS_SRS does not contain the SRID ' || srsno);
-      RETURN 'SRID not ok';
-    END;
+        dbms_output.put_line('Table MDSYS.CS_SRS does not contain the SRID ' || srsno);
+        RETURN 'SRID not ok';
+  END;
 
   /*****************************************************************
   * is_db_coord_ref_sys_3d

    transform           NUMBER := 0
  )
  IS
      unknown_srs_ex EXCEPTION;
    BEGIN
      IF citydb_srs.check_srid(schema_srid) <> 'SRID ok'
      THEN
        DBMS_OUTPUT.PUT_LINE(
            'Your chosen SRID was not found in the MDSYS.CS_SRS table! Chosen SRID was ' || schema_srid);
      ELSE
        -- update entry in DATABASE_SRS table first
        UPDATE DATABASE_SRS
        SET SRID = schema_srid, GML_SRS_NAME = schema_gml_srs_name;
        COMMIT;

        -- change srid of each spatially enabled table
        FOR rec IN (SELECT
                      table_name                       AS t,
                      column_name                      AS c,
                      get_dim(table_name, column_name) AS dim
                    FROM user_sdo_geom_metadata) LOOP
          change_column_srid(rec.t, rec.c, rec.dim, schema_srid, transform);
        END LOOP;
        DBMS_OUTPUT.PUT_LINE('Schema SRID sucessfully changed to ' || schema_srid);
      END IF;
    END;

END citydb_srs;
/
  * @param srid the SRID of the coordinate system to be checked
  * @return NUMBER the boolean result encoded as number: 0 = false, 1 = true                
  ******************************************************************/
  FUNCTION is_coord_ref_sys_3d(schema_srid NUMBER)
    RETURN NUMBER
  IS
    is_3d NUMBER := 0;
  BEGIN
    SELECT COUNT(*) INTO is_3d FROM sdo_crs_compound WHERE srid = schema_srid;

    IF is_3d = 0 THEN
      SELECT COUNT(*) INTO is_3d FROM sdo_crs_geographic3d WHERE SRID = schema_srid;
    END IF;

    RETURN is_3d;
  END;

  /*******************************************************************
  * check_srid
