-- bind_var.sql

VARIABLE newid NUMBER

DECLARE
  fname VARCHAR2(15);
  lname VARCHAR2(25);
BEGIN
   fname := 'Max';
   lname := 'Headroom';

   SELECT person_id_seq.NEXTVAL INTO :newid FROM dual;
   INSERT INTO PERSON (id, firstname, lastname)
   VALUES (:newid, fname, lname);

END;
/

PRINT newid
