ORA-00907: 缺失右括号问题!!!???

今天遇到了数据库建表时的问题:ORA-00907: 缺失右括号问题!!!???

我的SQL脚本如下:

create table sys_managers(ID bigint NOT NULL PRIMARY KEY,
name varchar(28) NOT NULL,
sex varchar(4) NOT NULL,
age int(3) NOT NULL,
address varchar(100) NOT NULL,
password varchar(18) NOT NULL,
role varchar(28) NOT NULL,
flag varchar(6) NOT NULL,
flag2 varchar(6) default null,
degree varchar(8) not null,
positional_title varchar(18) default null,
date1 date not null,
date2 date default null,
flag3 varchar default null,
self TEXT default null)ENGINE=InnoDB DEFAULT CHARSET=gb2312;

若在MySQL中,会出现如附图片的报错信息。
请教各位大神该如何修改,解决问题啊?

0

1个回答

估计是你的flag3的varchar没有指定长度

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ORA-00907: 缺失右括号
/* Formatted on 2018/7/17 14:59:32 (QP5 v5.256.13226.35538) */ UPDATE yl_user    SET YL_COMPANY_ID =           (  SELECT ID                FROM YL_REPAIR_SHOP               WHERE     CONTRACT_MOBILE =...
ORA-00907: 缺失右括号问题整理解决
ORA-00907: 缺失右括号前言        最近在开发过程中使用oracle数据库,在程序中进行查询数据时遇到了“ORA-00907: 缺失右括号”的问题,但是如果直接把sql语句直接在数据库或PL/SQL中执行时,却又能够正常查询,为了解决这个问题,折腾了半天,查找了一些资料,所以就对各种导致出现“缺失右括号”的情况进行了整理总结。行文如下。1 union all中order by 导致
创建数据库表时,关于ORA-00907: 缺失右括号与左括号问题总结
今天使用Oracle数据库建表的时候,遇到了“ORA-00907: 缺失右括号”的问题,关于这个,做了一些总结: 报错的sql语句: create table pre_info(pre_name varchar2(20),pre_code varchar2(20),pre_num number(5),pre_price_old number(5), pre_tax decimal...
ORA-00907: 缺失右括号与左括号问题总结
在创建数据表总结如下:  1.date限定字段大小的时候,会报错,比如,将date(12)去掉(12);  2.关键字顺序有误,也会报这样的错;  3.创建表时,如果表有关键字,用双引号括起来;  4.如果创建表时,未对字段中的表设置长度,也会报错;  5.创建主外键约束时外键类型跟主键类型不完全一致,也是会报错的。  ...
ORA-00907: 缺失右括号;代码我在sql运行中都正确,但到了idea中就报错
这代码我在sql运行中都正确,但到了idea中就报错 我觉得是子查询中那个order by的毛病,但分页语法必须有 SELECT PP.EMP_CODE, E.NAME, PP.EMP_SEQ_NUM, PP.ORG_NAME, PP.EMP_PROPERTY, PP.EMP_TYPE, PP.EMP_ORG_ID, PP.ID FROM (SELECT T.ID, T.IS_DELETED, T...
oracle 使用union提示ORA-00907:缺少右括号
在使用union的时候提示:ORA-00907:缺少右括号 此原因是因为在union的左边和右边都有order by,因此需要去掉一边的order by,保留一个即可。 select * from  (  select id,name from emp order by name union  select id,name from emp )
ORA-00907:缺失右括号
CREATE TABLE WEB_CULTURE(rnCULTURE_ID NUMBER(10),rnCULTURE_TITLE VARCHAR2(500),rnCULTURE_TYPE NUMBER(10),rnCULTURE_DATE DATE(7),rnDEPT VARCHAR2(100),rnCULTURE_CONTENT BLOB,rnCULIMG_URL VARCHAR2(256),rnCUL_TITLE VARCHAR2(128),rnCONSTRAINT WEB_CULTURE PRIMARY KEY (CULTURE_ID)rn);rn这段建表语句报 ORA-00907:缺失右括号
ORA-00907 缺失右括号
SELECTrnxmlid.nextval,rn''rnrnrnrnFROM user_tab_columns t WHERE t.TABLE_NAME=vtab;rnrn变量是前面存过定义好的。 rn
ora-00907: 缺失右括号
在pl/sql里执行  报此错rnselect TEMQ_1f040dd124f08b2ce1.GW GW,rn TEMQ_1f040dd124f08b2cb2.GZRQ GZRQ,rn TEMQ_1f040dd124f08b2bd8.DH DH,rn TEMQ_1f040dd124f08b2bd8.XKHSM XKHSM,rn TEMQ_1f040dd124f08b2c83.KHZS KHZS,rn TEMQ_1f040dd124f08b2c83.KHZS - TEMQ_1f040dd124f08b2bd8.XKHSM LKHZS,rn TEMQ_1f040dd124f08b2cb2.LDZS LDZS,rn TEMQ_1f040dd124f08b2cb2.QDZS QDZS,rn TEMQ_1f040dd124f08b2cb2.QFZS QFZS,rn TEMQ_1f040dd124f08b2d20.QYTS QYTS,rn TEMQ_1f040dd124f08b2d20.MJ MJ,rn TEMQ_1f040dd124f08b2d20.JE JE,rn TEMQ_1f040dd124f08b2d20.YSJE YSJE,rn TEMQ_1f040dd124f08b2d20.QKJE QKJE,rn sum(TEMQ_1f040dd124f08b2cb2.LFZS) LFZSrn from TEMQ_1f040dd124f08b2cb2,rn TEMQ_1f040dd124f08b2bd8,rn TEMQ_1f040dd124f08b2c83,rn TEMQ_1f040dd124f08b2d20,rn TEMQ_1f040dd124f08b2ce1rn where TEMQ_1f040dd124f08b2cb2.GZRQ = TEMQ_1f040dd124f08b2bd8.DJRQrn and TEMQ_1f040dd124f08b2cb2.GZRQ = TEMQ_1f040dd124f08b2c83.GZRQrn and TEMQ_1f040dd124f08b2cb2.GZRQ = TEMQ_1f040dd124f08b2d20.QYRQrn and TEMQ_1f040dd124f08b2cb2.PK_PSNDOC =rn TEMQ_1f040dd124f08b2ce1.PK_PSNDOCrn and ((TEMQ_1f040dd124f08b2ce1.PK_CORP = '1008') andrn (TEMQ_1f040dd124f08b2bd8.PK_PSNDOC = '0001G510000000001X90') andrn (TEMQ_1f040dd124f08b2c83.PK_PSNDOC = '0001G510000000001X90') andrn (TEMQ_1f040dd124f08b2cb2.PK_PSNDOC = '0001G510000000001X90') andrn (TEMQ_1f040dd124f08b2d20.PK_PSNDOC = '0001G510000000001X90') andrn (TEMQ_1f040dd124f08b2ce1.PK_PSNDOC = '0001G510000000001X90') andrn (TEMQ_1f040dd124f08b2bd8.PK_PROJECT = '0001G510000000000E8S') andrn (TEMQ_1f040dd124f08b2c83.PK_PROJECT = '0001G510000000000E8S') andrn (TEMQ_1f040dd124f08b2cb2.PK_PROJECT = '0001G510000000000E8S') andrn (TEMQ_1f040dd124f08b2d20.PK_PROJECT = '0001G510000000000E8S') andrn (TEMQ_1f040dd124f08b2ce1.PK_PROJECT = '0001G510000000000E8S') andrn (TEMQ_1f040dd124f08b2cb2.GZRQ >= 'select trunc(next_day(to_date('rn 2009 - 10 - 30 ', ' yyyy - mm - dd '), 1) - 6) from dual') andrn (TEMQ_1f040dd124f08b2cb2.GZRQ <= 'select trunc(next_day(to_date('rn 2009 - 10 - 30 ', ' yyyy - mm - dd '), 1) ) from dual'))rn group by TEMQ_1f040dd124f08b2ce1.GW,rn TEMQ_1f040dd124f08b2cb2.GZRQ,rn TEMQ_1f040dd124f08b2bd8.DH,rn TEMQ_1f040dd124f08b2bd8.XKHSM,rn TEMQ_1f040dd124f08b2c83.KHZS,rn TEMQ_1f040dd124f08b2c83.KHZS - TEMQ_1f040dd124f08b2bd8.XKHSM,rn TEMQ_1f040dd124f08b2cb2.LDZS,rn TEMQ_1f040dd124f08b2cb2.QDZS,rn TEMQ_1f040dd124f08b2cb2.QFZS,rn TEMQ_1f040dd124f08b2d20.QYTS,rn TEMQ_1f040dd124f08b2d20.MJ,rn TEMQ_1f040dd124f08b2d20.JE,rn TEMQ_1f040dd124f08b2d20.YSJE,rn TEMQ_1f040dd124f08b2d20.QKJErn请赐教
ora-00907 缺失右括号?????
SELECT /*+ parallel (statcmain )*/ rn sum(decode(statcmain.certitype,''P'', 1,decode(statcmain.endortype, ''19'', ''-1'', 0))) as Count, rn sum((STATCMAIN.CHGPREMIUM - STATCMAIN.CHGMIDDLECOST) * STATCMAIN.CNYEXCHRATE * STATCMAIN.COINSRATE / 100) as premium, rn sum(STATCMAIN.CHGINSURED * STATCMAIN.CNYEXCHRATE * STATCMAIN.COINSRATE / 100) as amount, rn sum(STATCMAIN.CHGLIMIT * STATCMAIN.CNYEXCHRATE * STATCMAIN.COINSRATE / 100) as limit rn FROM rep.Statcmain, rn reptest.statcogsharerate, rn rep.statdcompanylevel rn where Statcmain.Policyno = statcogsharerate.policyno(+) rn and statcmain.comcode = statdcompanylevel.comcode rn and statcmain.riskcode NOT IN (''YAB0'', ''2797'', ''2798'') rn AND STATCMAIN.CLASSCODE <> ''30'' rn group by statcmain.statdate, rn statcmain.StartDate, rn statcmain.COMCODE, rn decode(statcmain.riskcode, rn ''2700'', rn statcmain.productcode, rn statcmain.riskcode), rn statcmain.SHAREHOLDERFLAG, rn statcmain.BUSINESSNATURE, rn ((substr(statcmain.othflag, 1, 1))), rn statdcompanylevel.centercode, rn statcmain.Agentcode, rn statcmain.Handler1code, rn decode(substr(statcmain.othflag, 15, 1), rn NULL, rn ''0'', rn substr(statcmain.othflag, 15, 1)), rn statcmain.BusinessKind, rn statcmain.BusinessClass, rn CASE WHEN (statcmain.businessflag IS NULL OR statcmain.businessflag <> ''1'') THEN (''0'') rn ELSE (''1'') END, rn statcmain.businesssource, rn statcmain.constructtype,rn statcmain.channeltype,rn statcmain.servicearea,rn statcmain.agriFlag,rn statcmain.usenaturecode,rn statcmain.carkindcode,rn statcmain.toncount,rn statcmain.applitype,rn statcmain.ventureflag, rn statcmain.grouppurchaseflag;rn
ORA-00907: 缺失右括号 问题!!!???
rnrn creat table xh_projectrn(rn pk_project int(4),rn project_code varchar(20),rn project_name varchar(60),rn iflock varchar(1) not null,rn ifmerge varchar(1) not null,rn ts char(19) convert(char(19),getdate(),20),rn dr smallint(2) default 0,rn constraint P_pk_xh_project primary key (pk_project)rn);rnrn 报错提示: ORA-00907:缺失右括号 rn 请各位帮忙!rn 数据库使用的是 oracle数据库。rn rn 同样的语句 下面的创建表就可以执行:rncreate table wa_qx_parameterrn(rn pk_parameter CHAR(20) not null,rn param_code VARCHAR(20) not null,rn param_name VARCHAR(100) not null,rn param_value VARCHAR(20) not null,rn approveflag SMALLINT default 0,rn mender VARCHAR(20),rn assessor VARCHAR(20),rn amend_date CHAR(19),rn remark VARCHAR(500),rn ts CHAR(19),rn dr SMALLINT default 0,rn constraint P_pk_wa_qx_paramet primary key (pk_parameter)rn); rn
java.sql.SQLException: ORA-00907: 缺失右括号
String sqlTablespace = "select upper(f.tablespace_name) \"Tablespace\",d.tot_grootte_mb \"Size MB\",f.total_bytes \"Free MB\","rn + "to_char(round(f.total_bytes/ d.tot_grootte_mb * 100,2),'990.99') \"Percent Free\","rn + "d.autoextensible from (select tablespace_name,round(sum(bytes) /(1024 * 1024), 2) total_bytes,round(max(bytes) / (1024 * 1024),"rn + " 2) max_bytes from sys.dba_free_space group by tablespace_name) f,"rn + "(select dd.tablespace_name,round(sum(dd.bytes)/(1024 * 1024), 2) tot_grootte_mb,"rn + "round(sum(dd.maxbytes)/(1024 * 1024), 2) tot_tbs_mb,dd.autoextensible from sys.dba_data_files dd"rn + "group by dd.tablespace_name,dd.autoextensible) d"rn + " where d.tablespace_name = f.tablespace_name order by f.tablespace_name";
java.sql.SQLSyntaxErrorException: ORA-00907: 缺失右括号
select * from ( nnselect a.*, ROWNUM rnum from ( nnselect * from SHOP_ORDER nWHERE start_date between to_date(‘2016-08-22 11:34:36’,'yyyy/mm/dd hh24:mi:ss') nand close_date between to_date('2016-09-22 11:34:36','yyyy/mm/dd hh24:mi:ss') ) a where ROWNUM< ?) where rnum >= ?nnnn求各位大神大牛帮帮小弟!!!!
SQLSyntaxErrorException: ORA-00907: 缺失右括号
select * from ( select a.*, ROWNUM rnum from ( select site_code,shop_order,target_qty,start_date,close_date,sales_order,customer_code,item_code,status ,remark,create_by,create_time,update_by,update_time from SHOP_ORDER WHERE shop_order = ? and start_date between to_date(?,'yyyy/mm/dd hh24:mi:ss') and close_date between to_date(?,'yyyy/mm/dd hh24:mi:ss') and status = ? ) a where ROWNUM < ?) where rnum >= ?nnn大神大牛帮帮忙。
java实现分页技术详解
1.编写通用的分页工具 public class PageUtil { /*参数需要页面传入*/ private Integer pageSize=10;//每页显式多少条记录 private Integer currentPage=1;//当前页号 /*参数需要从数据查询*/ private Integer allRowsAmount=0;//总记录数 private
oracle数据库建表时出现错误:缺失右括号
oracle数据库建表时出现错误:缺失右括号 这个错误一般都是用了oracle中没有的语法导致的,比如:identity函数是SQLSERVER中的,oracle中不能用;数字型定义在oracle中须全写number,只写num也会报这个错误。 调试方法:逐行注释
Oracle异常ORA-00907:missing right parenthesis一种情况的解决(模糊查询)
写Oracle的SQL语句时报了异常ORA-00907:missing right parenthesis,缺失右侧括号,我的sql语句如下。 检查后并没有发现括号缺失,最后问题解决,是模糊查询这里出的问题,模糊查询处改为如下这种形式,问题解决。 like '%'||#{crmCustomerInfo}||'%'  ...
mybatis分页查询时ORA-00907: 缺失右括号
mybatis语句:rn[code=text]rnSELECT * FROMrn (SELECT rn id as id,rn appserialnumber as appserialnumber,rn who as who,rn createtime as createtime,rn operatedtype as operatedtype,rn operate as operate,rn operatedobject as operatedobject,rn description as description,rn result as result,rn ROWNUM AS row_numrn FROM server_log ROWNUM < (#startRecord+#total)) t_temprn WHERE t_temp.row_num >= #startRecordrn[/code]rnrn然后控制台打印语句:rn10:06:51,114 DEBUG Connection:27 - ooo Connection Openedrn10:06:51,442 DEBUG PreparedStatement:27 - ==> Executing: select count(*) from server_log rn10:06:51,442 DEBUG PreparedStatement:27 - ==> Executing: select count(*) from server_log rn10:06:51,442 DEBUG PreparedStatement:27 - ==> Parameters: rn10:06:51,442 DEBUG PreparedStatement:27 - ==> Parameters: rn10:06:51,630 DEBUG Connection:27 - ooo Connection Openedrn10:06:51,646 DEBUG PreparedStatement:27 - ==> Executing: SELECT * FROM (SELECT id as id, appserialnumber as appserialnumber, who as who, createtime as createtime, operatedtype as operatedtype, operate as operate, operatedobject as operatedobject, description as description, result as result, ROWNUM AS row_num FROM server_log ROWNUM < (?+?)) t_temp WHERE t_temp.row_num >= ? rn10:06:51,646 DEBUG PreparedStatement:27 - ==> Executing: SELECT * FROM (SELECT id as id, appserialnumber as appserialnumber, who as who, createtime as createtime, operatedtype as operatedtype, operate as operate, operatedobject as operatedobject, description as description, result as result, ROWNUM AS row_num FROM server_log ROWNUM < (?+?)) t_temp WHERE t_temp.row_num >= ? rn10:06:51,646 DEBUG PreparedStatement:27 - ==> Parameters: 0(Integer), 10(Integer), 0(Integer)rn10:06:51,646 DEBUG PreparedStatement:27 - ==> Parameters: 0(Integer), 10(Integer), 0(Integer)rn2014-8-1 10:06:51 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet SearchServlet threw exceptionrnorg.apache.ibatis.exceptions.PersistenceException: rn### Error querying database. Cause: java.sql.SQLException: ORA-00907: 缺失右括号rnrn### The error may involve com.itrus.mylog.domain.ServerLog.selectAllServerLog-Inlinern### The error occurred while setting parametersrn### Cause: java.sql.SQLException: ORA-00907: 缺失右括号rnrn at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:77)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:69)rn at com.itrus.mylog.dao.impl.SearchDAOImpl.searchPagination(SearchDAOImpl.java:37)rn at com.itrus.mylog.service.impl.SearchServiceImpl.searchPagination(SearchServiceImpl.java:24)rn at com.itrus.mylog.servlet.SearchServlet.search(SearchServlet.java:53)rn at com.itrus.mylog.servlet.SearchServlet.service(SearchServlet.java:40)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:619)rnCaused by: java.sql.SQLException: ORA-00907: 缺失右括号rnrn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)rn at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)rn at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)rn at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)rn at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213)rn at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:796)rn at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)rn at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:836)rn at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1116)rn at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)rn at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:45)rn at $Proxy1.execute(Unknown Source)rn at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:39)rn at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55)rn at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41)rn at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:216)rn at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:95)rn at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:75)rn ... 18 morernrn求指点,是语句哪里写错了么?
ORA-00907: 缺少右括号
代码:rnOleDbConnection objCn=new OleDbConnection();rn OleDbDataAdapter objCmd;rn DataSet Ds=new DataSet(); rn tryrn rn objCn.ConnectionString =mcnStr;rn rn objCmd = new OleDbDataAdapter("select (select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y') qysxj, "rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and ssgsd <>'新港开发区' and ssgsd <>'高新开发区' and ssgsd <>'省企业') wqqy, "rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and (ssgsd ='新港开发区' or ssgsd ='高新开发区') ) xggxqy,"rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and ssgsd ='省企业' ) sqy,"rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y') gsgzxj,"rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and gsgztz ='1'and (ssgsd <>'省企业'and ssgsd <>'新港开发区' and ssgsd <>'高新开发区')) yfzgtz,"rn+"((select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y') - (select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and gsgztz ='1'and (ssgsd <>'省企业'and ssgsd <>'新港开发区' and ssgsd <>'高新开发区')) - (select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y' and (ssgsd ='省企业'or ssgsd ='新港开发区' or ssgsd ='高新开发区')) )dfzgtz,"rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and (ssgsd ='省企业'or ssgsd ='新港开发区' or ssgsd ='高新开发区')) bxfzgtz,"rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and gsyyzzdz ='1' ) ybzzdz,"rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and swdjzdz ='1' ) swdjzdz,"rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and ssys ='1' ) ssys,"rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and dlhs ='1' ) dlhs,"rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and (gsrk <>'0'or dsrk <>'0')) rks,"rn+"(select count(ssgsd) from czjjdqy where cmpno ="+cmp+" and flag ='Y'and lhzf ='1' ) lhzfs"rn+" from czjjdqy where cmpno ="+cmp+" and flag ='Y' group by cmpno",objCn);rn objCmd.Fill(Ds,"archives");rn问题:在代码执行到objCmd.Fill(Ds,"archives");时,出现"ORA-00907: 缺少右括号".但把sql语句加入plsql执行却能查出结果集.
ora-00907 缺少右括号
我在我的数据库中对另一个数据库建立了链路,并对一个本建了同义词,访问没有问题。rn 我想利用一个过程把这个表的数据导入的我本地服务器中。rn 我建了一个RECORD,中有一个字段类型是DATE的,对应远程表中一个DATE类型字段,rn 但是FETCH后,组成生成的SQL语句的时候,字段的数据由YYYY-MM-DD HH24:MI:SS变成了DD-MM-YY形式了。rn 所以在执行SQL语句时,提示ora-00907 缺少右括号rn 我本地数据的DATE类型格式也为YYYY-MM-DD HH24:MI:SS,但是FETCH后为什么格式变了呢?
零基础oracle数据库学习记录第一天
打开WIN+R输入cmd再回车。 直接贴程序执行的过程。 //打开oracle sqlplus " /as sysdba" //启动数据库 startup; //关闭数据库 shutdown immediate; //创建用户 create user chu identified by chu default tablespace users Temporary TABLE
缺失右括号的问题??
[code=SQL]rn我现在有一个这样的 过程 rn但是执行总是报 缺失右括号 不知道为什么 大家帮忙看看rnrncreate or replace procedure test_p isrntype tcur is ref cursor;rnfi_cur1 tcur;rndos1 date;rndos30 date;rnbeginrndos1 := to_date('2006-01-01','yyyy-mm-dd');rndos30 := to_date('2006-11-01','yyyy-mm-dd');rn open fi_cur1 for ' select distinct mbrid from fi06rn where ( mbrid=''1000'' and dos >= '||dos1||' and dos <= '||dos30||')';rn--。。。。rnend test_p;rn[/code]
缺失右括号问题
最近刚开始学ORACLE, 用的10gEX版本,用HR账号登陆。rn下面的语句: update jobs set max_salary = (1000+(select avg(max_salary) from jobs)) where job_id = 'AD_VP';没有问题。rn不过如果把+1000 放在后面变成:update jobs set max_salary = ((select avg(max_salary) from jobs)+1000) where job_id = 'AD_VP';rn就会提示缺失右括号。百思不得其解~~~rn分不多了,希望大家不吝赐教
数据库建表的问题 ORA-00907: 缺失右括号问题!!!???
报错:ORA-00907: 缺失右括号问题!!!???rnrn我的建表脚本如下所示:rnrncreate table sys_managers(ID bigint NOT NULL PRIMARY KEY,rnname varchar(28) NOT NULL,rnsex varchar(4) NOT NULL,rnage int(3) NOT NULL,rnaddress varchar(100) NOT NULL,rnpassword varchar(18) NOT NULL,rnrole varchar(28) NOT NULL,rnflag varchar(6) NOT NULL,rnflag2 varchar(6) default null,rndegree varchar(8) not null,rnpositional_title varchar(18) default null,rndate1 date not null,rndate2 date default null,rnflag3 varchar default null,rnself TEXT default null)ENGINE=InnoDB DEFAULT CHARSET=gb2312;rnrnrn请教各位这是什么错误啊,该如何修改捏?rnrn若在MySQL中会出现rn[img=https://img-bbs.csdn.net/upload/201309/17/1379424206_904450.jpg][/img]rn如图所示错误。rnrn请教各位这是什么错误啊,该如何修改捏?
第 12 行出现错误: ORA-00907: 缺失右括号
create table T_RECV_MSG (rn DBID number(11) not null,rn STATUS number(11) default 0,rn SEQID varchar(20) default '',rn CALLNO varchar(20) default '',rn DSTCALLNO varchar(20) default '',rn SERVICEID varchar(20) default '',rn LINKID varchar(20) default '',rn SENDTIME date default sysdate,rn CONTENT varchar(4000) default '',rn OPERATOR varchar(20) default '',rn UDHI int(11) default -1, rn primary key (DBID)rn);rnUDHI int(11) default -1,rn *rn第 12 行出现错误:rnORA-00907: 缺失右括号rn求教,哪错了rn
缺失右括号
例如:rncrate table a(id not null number(4)); 就会报错:缺少")"rn但是:rncreate table a(id number(4) not null); 就不会报错。rn为什么呢?rnnot null 一定要放到后面吗?
缺失右括号????
我在创建一个表时,这两行老师提示缺失右括号rn去掉这两行就没问题rn没缺失右括号呀rn这是为什么?rnrn gender varchar2(10) ck_agents_gender check((gender='m')or(gender='f')),rn cellphone nvarchar2(20) uu_agents_cellphone unique
c++builder中的SQL语句出错:ORA-00907:缺失右括号
c++builder中的SQL语句出错:rn AnsiString stime,etime;rn stime="2008-12-9 1:18:00"; rn etime="2008-12-9 3:25:00"; rn ADOQuery1->Close();rn ADOQuery1->SQL->Clear();rn ADOQuery1->SQL->Add("Select distinct tag_value.* from tag_value where tag_value.clock> to_date('"+stime+"','yyyy-mm-dd hh24:mi:ss') and tag_value.id=134 or tag_value.id=129 or tag_value.id=130 and tag_value.clock<= to_date ('"+etime+"','yyyy-mm-dd hh24:mi:ss') order by tag_value.clock");rn ADOQuery1->Open();rn出现错误rn ORA-00907:缺失右括号rnrnrn如果将SQL语句改成Select distinct tag_value.* from tag_value where tag_value.clock> to_date('"+stime+"','yyyy-mm-dd [color=#FF0000]hh24:mi'[/color]) and tag_value.id=134 or tag_value.id=129 or tag_value.id=130 and tag_value.clock<= to_date ('"+etime+"','yyyy-mm-dd [color=#FF0000]hh24:mi'[/color]) order by tag_value.clockrn就不会出错!rn搞不清楚是怎么回事?请教各位大侠!
奇怪的问题 ORA-00907: 缺少右括号
一个非常奇怪的问题rnrn存储过程建立如下rnCREATE OR REPLACE PROCEDURE go (id integer)rnIS rnBEGIN rn return;rnEND go;rnrn在 SQL Plus中调用结果如下rnrnSQL> call go(0);rnrnMethod calledrnrnSQL> call go(id => 0);rnrncall go(id => 0)rnrnORA-00907: 缺少右括号rnrnSQL> rnrnrn怎么会有 ORA-00907: 缺少右括号 这个错误
oracle查询语句老是报ORA-00907缺失右括号
--大家好,我有一条oracle查询语句老是报ORA-00907缺失右括号的错误,能不能帮我看一下,谢谢:rn--统计毕业班等级考试最佳成绩rnselect distinct e.xy 学院,rn e.xzb 班级,rn e.xh 学号,rn e.xm 姓名,rn a.cet3 英语三级,rn b.cet4 英语四级,rn c.cet6 英语六级,rn d.computer 计算机rn from ((select xh, xm, djksmc, max(cj) cet3rn from xsdjksbrn where djksmc = '英语三级'rn Group by xh, xm, djksmc) a,rn (select xh, xm, djksmc, max(cj) cet4rn from xsdjksbrn where djksmc = '英语四级'rn Group by xh, xm, djksmc) b,rn (select xh, xm, djksmc, max(cj) cet6rn from xsdjksbrn where djksmc = '英语六级'rn Group by xh, xm, djksmc) c,rn (select xh, xm, djksmc, max(cj) computerrn from xsdjksbrn where djksmc like '计算机%'rn Group by xh, xm, djksmc) d, xsjbxxb e)rn where (a.xh = e.xh or b.xh = e.xh or c.xh = e.xh or d.xh = e.xh)rn and ((e.DQSZJ = '2010' AND e.XZ = '5') ORrn (e.DQSZJ = '2011' AND e.XZ = '4') ORrn (e.DQSZJ = '2012' AND e.XZ = '3'))rn AND e.SFZX = '是'rn order by e.xy, e.xzb, e.xh, e.xm;rnrnrn报错落在 djksmc) a,的a上rnrn我确信我的语句所有的左右括号都是匹配的,没有缺失,一定是语句的语法出了问题,请大家帮我把把关,谢谢!
ORA-00907: 缺少右括号(sql的问题)
下面是jsp的一点代码rnrn//取得当前时间rnjava.util.Date date=new java.util.Date();rnString year=String.valueOf(date.getYear()+1900);rnString mon=String.valueOf(date.getMonth()+1);rnString day=String.valueOf(date.getDate());rnString hour=String.valueOf(date.getHours());rnString min=String.valueOf(date.getMinutes());rnString sec=String.valueOf(date.getSeconds());rnrnString sql_post="insert into R_text values(R_TEXT_SEQ.nextval,";rnsql_post+=title+",";rnsql_post+=body;rnsql_post+=",'applytype',";rnsql_post+="todate(year-mon-day hour:min:sec,'yyyy-mm-dd hh24:mi:ss')";rnsql_post+=",'author',";rnsql_post+="'provide',";rnsql_post+="'searchkey',";rnsql_post+="todate(year-mon-day hour:min:sec,'yyyy-mm-dd hh24:mi:ss')";rnsql_post+=",'videopath',";rnsql_post+="'texttype',";rnsql_post+="'authorinfo',";rnsql_post+="todate(year-mon-day hour:min:sec,'yyyy-mm-dd hh24:mi:ss'),";rnsql_post+="10,";rnsql_post+="'course')";rnrnrntryrnstmt_post.executeUpdate(sql_post);rncatch (SQLException e) rn System.out.println("sql failed :"+e.toString());rn rn===========下面执行结果=============rnsql failed :java.sql.SQLException: ORA-00907: 缺少右括号
sql语句缺失右括号
我是根据前台传过来的年龄段对人员表里的生日字段进行查询rnsql语句如下rn[code=sql] select * from BC_BCOA_PERSON WHERE PERSON_ID != 0 and PERSON_DELETE=0 and(YEAR (CURDATE()) -1 - YEAR (PERSON_BIRTHDAY) + (DATE_FORMAT(PERSON_BIRTHDAY,'%m%d') <= (DATE_FORMAT(CURDATE(), '%m%d'))))>=20 AND (YEAR (CURDATE()) -1 - YEAR (PERSON_BIRTHDAY) + (DATE_FORMAT(PERSON_BIRTHDAY, '%m%d') <= (DATE_FORMAT(CURDATE(), '%m%d'))))<=100 [/code]rnrn谢谢大家
oracle 建表缺失右括号
CREATE TABLE BSI_AREA(rn ADCODE VARCHAR(20) NOT NULL,rn AREANAME VARCHAR(100),rn AREAPOLYSTR CLOB(1048576),rn AREACENTERLON DECIMAL(19,15),rn AREACENTERLAT DECIMAL(19,15),rn CITY_ID VARCHAR(20),rn PARENTID VARCHAR(12),rn CONSTRAINT PK_BSI_AREA PRIMARY KEY(ADCODE));rnrn以上是语句,建好了很多表都是这么写的,这个表就说啥都报错,SQL 错误: ORA-00907: 缺失右括号。rn自己尝试给表里的列分别删了就留一列还是不好用,无法定位问题原因,水平比较低,肯定各位大神走过路过帮忙看看。
sql代码缺失右括号
sb.append("select MCHT_NO,MCHT_NM,LICENCE_NO,APPLY_DATE,MAPPING_MCHNTCDONE,MAPPING_MCHNTCDTW O,MCHT_STATUS,TERM_COUNT from ");rnsb.append("((SELECT * FROM TBL_MCHT_BASE_INF_TMP t1 left outer join TBL_BRH_INFO t2 on t2.brh_id=t1.agr_br ) A left outer join (select MCHT_CD,count(1) AS TERM_COUNT from TBL_TERM_INF group by MCHT_CD) B ON (A.MCHT_NO = B.MCHT_CD))");rnsb.append("where MCHT_STATUS IN ('1','3','5','6','8','R') ");rnrnrn运行的时候显示上述代码缺失右括号,但是在数据库中可以运行出来,这是什么原因
老提示:ORA-00907: 缺少右括号
我在ORCALE里面建表,老提示错误:ORA-00907: 缺少右括号rnCREATE TABLE myuser2(rnid int(11) not null,rnusername varchar(200) not null,rnpassword varchar(20) not null,rnage int,rnprimary key (id)rn)rnENGINE=MyISAM DEFAULT CHARSET=GBK;rnrn请高手指教
ORA-00907: 缺少右括号 错误 急!!!
declare rnv_sql varchar2(1024);rnbeginrnv_sql := 'create global temporary table t_temp_accountrn (materialID varchar2(7),rn start_amount number(5,0),rn start_money number(10,2),rn in_amount nmuber(5,0),rn in_money number(10,2),rn out_amount number(5,0),rn out_money number(10,2),rn finish_amount number(5,0),rn finish_money number(10,2)rn )on commit preserve rows';rn execute immediate v_sql;rnend;rn执行后 出现错误rndeclarern*rnERROR 位于第 1 行:rnORA-00907: 缺少右括号rnORA-06512: 在line 15rn我的sql语句没有错误的阿 找了半天 望高手指教!
ORA-00906: 缺失左括号
原因: 使用PowerDesigner生成了sql脚本,在navicat下执行的时候 报了这么一个错误 . 我看网上说是类型没有指定大小.后来找到是我使用模型生成的脚本有这个问题 : constraint PK_T_CUSTOMER_ORGIN primary key clustered (ID) 这个主键的指定方式的问题 ,然后我把这个主键指定方式改成了这样:PRIMARY...
一存储过程,提示缺失右括号问题
一个按时间做的范围分区,现做了一个通用的存储过程,代码如下:rn[code=SQL]rnrncreate or replace procedure addpart(v_tbname in varchar2,v_part in varchar2,rnv_date in varchar2,v_tabs in varchar2) isrnv_sql1 varchar2(200);rnv_sql2 varchar2(200);rnv_dtime date;rnbeginrn v_dtime:=to_date(v_date,'yyyy-mm-dd hh24:mi:ss');rn dbms_output.put_line(v_dtime);rn v_sql2:='alter table '||v_tbname||' add partition '||v_part||' values less than ('||v_dtime||') tablespace '||v_tabs||'';rn dbms_output.put_line(v_sql2);rn execute immediate v_sql2;rnend addpart;rnrn[/code]rnexec addpart('mytest','p_04','2009-04-01 0:00:00','P_TEST');--表名,范围分区名,时间,表空间rn执行的结果如下:rn01-4月 -09rnalter table mytest add partition p_04 values less than (01-4月 -09) tablespace P_TESTrnbegin addpart('mytest','p_04','2009-04-01 0:00:00','P_TEST'); end;rnORA-00907: 缺失右括号rnrn现将rnalter table mytest add partition p_04 values less than (to_date('2009-04-01 0:00:00','yyyy-mm-dd hh24:mi:ss')) tablespace P_TESTrn在plsql 中执行通过 rnrnrn向各位请教,存储过程该如何改进下。。。
括号生成
n对括号,那么有2*n个字符,我们可以把每种情况写出来,看【有效括号】的规律是什么左括号和右括号的个数都等于n。左括号必须先放了后,才能放右括号class Solution { public: vector&amp;lt;string&amp;gt; generateParenthesis(int n) { vector&amp;lt;string&amp;gt; res; ...
逆波兰表达式求解 和 括号匹配问题
#pragma once #include&amp;amp;amp;lt;stdio.h&amp;amp;amp;gt; #include&amp;amp;amp;lt;stdlib.h&amp;amp;amp;gt; #include&amp;amp;amp;lt;assert.h&amp;amp;amp;gt; #include&amp;amp;amp;lt;stdlib.h&amp;amp;amp;gt; #define MAX 100 typedef char DataType; typedef s
相关热词 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd c# 操作sql视图