创建更新查询时出现数据库异常问题

时间:2018-05-24 04:46:29

标签: sql database oracle

我正在尝试在oracle数据库中创建更新查询,但我已尝试解决此问题,但我仍然遇到以下问题:

执行部分更新查询时发生数据库异常(ERROR:语法错误在“=”位置:66处或附近)。如需帮助或意见,请访问schelp.ge.com

        <dependency> 
            <groupId>com.querydsl</groupId> 
            <artifactId>querydsl-apt</artifactId> 
        </dependency>
        <dependency> 
            <groupId>com.querydsl</groupId> 
            <artifactId>querydsl-jpa</artifactId> 
        </dependency>

         <plugin>
                <groupId>com.mysema.maven</groupId>
                <artifactId>maven-apt-plugin</artifactId>
                <version>1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/generated-sources</outputDirectory>
                            <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

2 个答案:

答案 0 :(得分:0)

即使没有该表,您也会遇到语法错误

SQL> explain plan for
  2  UPDATE pgsbizdim.ps_mnd_reqeng_sc_projectsummary
  3      SET (form_doc_id=to_number(:column1, '99999999999'),
  4      logged_date=to_timestamp(:column2, 'YYYY_MM_DD HH24:MI:SS'),
  5      last_updated_date=to_timestamp(:column3, 'YYYY_MM_DD HH24:MI:SS'),
  6      logged_by=:column4,
  7      last_updated_by=:column5,
  8      project_id=to_number(:column6, '99999999999'),
  9      project_name=:column7,
 10      project_opened_date=to_date(:column8, 'MM/DD/YYYY'),
 11      unit_serial_numbers=:column9,
 12      project_Scope=:column10,
 13      project_funding=:column11,
 14      project_status=:column12,
 15      region=:column13,
 16      funding_account_for_parts_costs=:column14,
 17      enpp_project=:column15,
 18      kronos_code=:column16,
 19      m_and_d_pm=:column17,
 20      requisition_manager=:column18,
 21      data_freshness=:column19,
 22      tg1_end_date_planned=to_date(:column20, 'MM/DD/YYYY'),
 23      tg2_end_date_planned=to_date(:column21, 'MM/DD/YYYY'),
 24      tg3_end_date_planned=to_date(:column22, 'MM/DD/YYYY'),
 25      tg4_end_date_planned=to_date(:column23, 'MM/DD/YYYY'),
 26      tg1_end_date_actual=to_date(:column24, 'MM/DD/YYYY'),
 27      tg2_end_date_actual=to_date(:column25, 'MM/DD/YYYY'),
 28      tg3_end_date_actual=to_date(:column26, 'MM/DD/YYYY'),
 29      tg4_end_date_actual=to_date(:column27, 'MM/DD/YYYY'),
 30      last_tollgate_completed=:column28,
 31      tg1_end_date_estimate=to_date(:column29, 'MM/DD/YYYY'),
 32      tg2_end_date_estimate=to_date(:column30, 'MM/DD/YYYY'),
 33      tg3_end_date_estimate=to_date(:column31, 'MM/DD/YYYY'),
 34      tg4_end_date_estimate=to_date(:column32, 'MM/DD/YYYY'),
 35      business_region=:column33,
 36      project_scope_additional_monitoring=:column34,
 37      status_technical=:column35,
 38      status_commercial=:column36,
 39      status_procurement=:column37,
 40      status_risk_and_issues=:column38,
 41      funding_business=:column39,
 42      overall_status=:column40,
 43      quote_baseline=:column41,
 44      current_project_cost_estimate=:column42,
 45      obd_percentage=:column43,
 46      plan_start_date=to_date(:column44, 'MM/DD/YYYY'),
 47      actual_start_date=to_date(:column45, 'MM/DD/YYYY'),
 48      tg0_end_date_planned=to_date(:column46, 'MM/DD/YYYY'),
 49      tg0_end_date_actual=to_date(:column47, 'MM/DD/YYYY'),
 50      schedule_days=:column48,
 51      year_project_closed=:column49,
 52      project_channel=:column50,
 53      total_no_of_new_assets_added_to_mul=:column51,
 54      dcs_engineer=:column52,
 55      dcs_integration_for_bop_data=:column53,
 56      cdm_scope=:column54,
 57      funding_source=:column55,
 58      micro_m_and_d_start_date=to_date(:column56, 'MM/DD/YYYY'),
 59      micro_m_and_d_completion_date=to_date(:column57, 'MM/DD/YYYY'),
 60      power_services_cm_and_u_outage_date_tg3=to_date(:column58, 'MM/DD/YYYY'),
 61      power_services_cm_and_u_plm_id=:column59,
 62      total_number_of_units_assisted=:column60,
 63      power_services_cm_and_u_completion_date_TG4=to_date(:column61, 'MM/DD/YYYY'),
 64      micro_m_and_d_completion_date_plan=to_date(:column62, 'MM/DD/YYYY'),
 65      customer_name=:column63,
 66      date_of_customer_close_out_call=to_date(:column64, 'MM/DD/YYYY'),
 67      customer_close_out_call_approved_as=:column65,
 68      p_and_e_internal_reconciliation_complete=to_char(:column66),
 69      funding_account_for_Labor_costs=:column67,
 70      is_active_archived_deleted=to_number(:column68, '99999999999'),
 71      equipment_oem=:column69,
 72      requisition_project_engineer=:column70,
 73      osm_commissioning_resource=:column71,
 74      schedule_dependence_on_outage=:column72,
 75      date_of_end_of_outage_tg4=to_date(:column73, 'MM/DD/YYYY'),
 76      first_fire_date=to_date(:column74, 'MM/DD/YYYY'),
 77      swiss_time_labor_code=:column75
 78      )
 79      WHERE requisition_project_engineer =:column70 AND project_id=to_number (:column6, '99999999999') AND m_and_d_pm=:column17;
    SET (form_doc_id=to_number(:column1, '99999999999'),
                    *
ERROR at line 3:
ORA-00907: missing right parenthesis


SQL>

答案 1 :(得分:0)

不是太大 - 只需删除整个SET子句的括号,它就会编译;会不会有用,我不知道。

否:

update table
  set (col1 = 1, 
       ...
       coln = n
      )
where ...

是:

update table
  set col1 = 1, 
      ...
      coln = n
where ...