Ola Anderson, tudo bem. Faz assim coloca o default na frente do not null e usa com aspas simples. Como abaixo: Create table TBL_CO_PEDIDOS ( COD_PEDIDO Number (5) NOT NULL , DAT_PREVISTA Date NOT NULL , DAT_CADASTRO Date Default SYSDATE NOT NULL , COD_USUARIO Number (5) NOT NULL , OBS Varchar2(100) , VAL_TOTAL Number(11,2) NOT NULL , STA_PEDIDO Char(1) DEFAULT ('P') NOT NULL , constraint ped_codped_pk primary key (COD_PEDIDO) ); []
Anderson bisarria <[EMAIL PROTECTED]> wrote: Amigos gostaria de saber como faço pra criar um campo com valor default no oracle segue abaixo o meu script pra gerar a tabela Create table TBL_CO_PEDIDOS ( COD_PEDIDO Number (5) NOT NULL , DAT_PREVISTA Date NOT NULL , DAT_CADASTRO Date Default SYSDATE NOT NULL , COD_USUARIO Number (5) NOT NULL , OBS Varchar2(100), VAL_TOTAL Number(11,2) NOT NULL , STA_PEDIDO Char(1) NOT NULL DEFAULT ("P") , constraint ped_codped_pk primary key (COD_PEDIDO)); como podem notar, o campo sta_pedido deve ter como padrao caso o usuario nao preencha nada o valor P, porem quando eu estou criando o banco da a seguinte msg de erro STA_PEDIDO Char(1) NOT NULL DEFAULT ("P") , erro linha 8 ora_00907: parentese direito nao encontrado ja tentei tb como ' ' e com " " e nada . Sera que alguem pode me ajudar? Desde ja agradeço a todos. [As partes desta mensagem que não continham texto foram removidas] Alexandre Borgmann Bacharel em Ciência da Computação - UPF Pós-Graduado em Desenvolvimento WEB - Ulbra Oracle Forms Developer Certified Professional Porto Alegre - RS --------------------------------- Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains. [As partes desta mensagem que não continham texto foram removidas]