oracle中创建表的sql语句如何添加default约束
代码如下,但是执行时,default那老是报错?????createtablebookType(bookTypeIdnumberprimarykey,parentIdnu...
代码如下,但是执行时,default那老是报错?????
create table bookType(
bookTypeId number primary key,
parentId number not null,
bookTypeName varchar2(20) not null,
isDelete number not null, --1为可用,0为不可用
context varchar2(40)
)
alter table bookType
add constraint df_isDelete default (1) for isDelete
<%
List<BookInfo> lst = (List<BookInfo>)request.getAttribute("lst");
for(BookInfo book:lst){
%>
为啥这里老是报错呢:org.apache.jasper.JasperException: Unable to compile class for JSP: ????? 展开
create table bookType(
bookTypeId number primary key,
parentId number not null,
bookTypeName varchar2(20) not null,
isDelete number not null, --1为可用,0为不可用
context varchar2(40)
)
alter table bookType
add constraint df_isDelete default (1) for isDelete
<%
List<BookInfo> lst = (List<BookInfo>)request.getAttribute("lst");
for(BookInfo book:lst){
%>
为啥这里老是报错呢:org.apache.jasper.JasperException: Unable to compile class for JSP: ????? 展开
3个回答
展开全部
create table bookType(
bookTypeId number primary key,
parentId number not null,
bookTypeName varchar2(20) not null,
isDelete number not null default 1,
context varchar2(40)
)
bookTypeId number primary key,
parentId number not null,
bookTypeName varchar2(20) not null,
isDelete number not null default 1,
context varchar2(40)
)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
alter table booktype modify isdelete default 1;
--感觉你们都是用sqlserver语法在解决
--感觉你们都是用sqlserver语法在解决
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
create table bookType(
bookTypeId number primary key,
parentId number not null,
bookTypeName varchar2(20) not null,
isDelete number not null default 1 , --1为可用,0为不可用
context varchar2(40)
)
alter table bookType
alter isDelete set default 1
bookTypeId number primary key,
parentId number not null,
bookTypeName varchar2(20) not null,
isDelete number not null default 1 , --1为可用,0为不可用
context varchar2(40)
)
alter table bookType
alter isDelete set default 1
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询