CREATE TABLE TBPRONTUARIO_PRESCRICAO (
    ID INTEGER NOT NULL,
    MEDICAMENTO VARCHAR(100),
    USO VARCHAR(50),
    POSOLOGIA VARCHAR(200),
	DATA DATE,
    OBSERVACAO VARCHAR(100),
	ATENDIMENTO_ID INTEGER);

ALTER TABLE TBPRONTUARIO_PRESCRICAO
ADD CONSTRAINT PK_TBPRONTUARIO_PRESCRICAO
PRIMARY KEY (ID);

CREATE SEQUENCE GTBPRONTUARIO_PRESCRICAO;

create trigger ttbprontuario_prescricao_b01i for tbprontuario_prescricao
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gtbprontuario_prescricao,1);
end;

