Query syntax error

Hi all

I get the syntax error: ORA-00905: lack of keyword
kindly can someone correct me, where I'm wrong.
  
SELECT rt.estimated_time, rt.start_date, rt.actual_date, rt.end_date,
       rt.task_status_id, rt.resource_id, rt.billable, rt.actual_date,
       rt.actual_end_date, rt.actual_time, t.ID AS task_id, t.project_id,
       p.final_date, c.NAME AS category_name, ts.NAME AS task_status_name,
       ts.state_machine_order, c.billable AS billable_category, po.value1,
       pr.NAME AS project_name, u.username, t.requeriment_id, t.created_by,
       t.category_id, t.task_id AS parent_task_id, t.NAME AS task_name,
       req.iteration, tpl.instance_id, p.iteration AS task_iteration,
       req.req_desc
  FROM pd_resource_task rt, pd_tool_user u, pd_task t
 LEFT OUTER JOIN (select id, iteration, description as REQ_DESC from pd_planning) 
as req on req.id = t.requeriment_id, pd_planning as p
LEFT OUTER JOIN (select instance_id, related_task_id from pd_custom_node_template) 
as tpl on p.id = tpl.related_task_id, pd_category c, pd_project pr, pd_task_status ts
LEFT OUTER JOIN (select substr(id,21) 
as task_status_id, value1 from pd_preference where user_id='3'
and id like 'home.taskList.order.%' order by value1) as po on ts.id = po.task_status_id 
where t.id = p.id  and t.category_id = c.id and rt.project_id = t.project_id 
and rt.task_id = t.id and rt.task_status_id = ts.id and rt.project_id = pr.id 
and t.is_parent_task = 0 and rt.resource_id = '3' 
and rt.resource_id = u.id and (p.final_date is null or p.final_date > '2011-08-23 13:57:23.737') 
order by po.value1 asc, ts.state_machine_order asc, rt.start_date desc ;
Thank you
Prakash P

You're welcome Prakash, please mark the thread as finished/responded to finish followed them...

Edited by: lifexisxnotxsoxbeautiful Vithalani August 30, 2011 04:22

Tags: Database

Similar Questions

  • Insert query syntax error

    I have a flash form that is used for inserts a record in an Access database table. In the because there are 4 datefields, several fields of text, and then on several fields. When I submit the form, I get a syntax error that reads:

    Running database query. [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] Syntax error in INSERT INTO statement.
    The error occurred on line 184. Complex object types cannot be converted to simple values.

    184 line is the last line of the values in the Insert query. The query looks like this:

    < CFQUERY DATASOURCE = '#REQUEST. DataSource #">"
    INSERT INTO EstimateNumber)
    BidNumber,
    Project,
    Construction,
    EstimatedBy,
    Region,
    Company,
    Division,
    InquiryNumber,
    SafetyChecklist,
    SafetyChecklistDate,
    QCChecklist,
    QCChecklistDate,
    EstimatedValue,
    UserUsername,
    UserPassword
    Updated,.
    ReviewDate,
    ReviewedBy,
    Discipline,
    BidDate,
    JobNumber,
    UpdatedBy
    )
    VALUES)
    #FORM. BidNumber #.
    ' #FORM. Project #',
    ' #FORM. Site #',
    ' #FORM. EstimatedBy #'.
    #FORM. Region #.
    #FORM.Company #,.
    #FORM. Division #.
    ' #FORM. InquiryNumber #'.
    #FORM. SafetyChecklist #.
    #FORM. SafetyChecklistDate #.
    #FORM. QCChecklist #.
    ' #FORM. QCChecklistDate #'.
    #FORM. EstimatedValue #.
    ' #FORM. UserUsername #',
    ' #FORM. UserPassword #',
    #FORM. # Update,
    #FORM. ReviewDate #.
    #FORM. ReviewedBy #.
    #FORM. Discipline #.
    #FORM. BidDate #.
    #FORM. JobNumber #.
    ' #FORM. "UpdatedBy #
    )
    < / CFQUERY >

    Any recommendations?

    chrispilie wrote:
    > Any recommendations?

    (1) enable debugging in order to visualize the generated actual query and post the SQL here
    (2) empty the form field. Are all of the form simple strings of values?

    (3) for the values inserted into a date/time column, you use cfqueryparam or CreateODBCDate, CreateODBCDateTime to convert the string to an object of good time. This ensures that the value is inserted properly

    Although I personally recommend to use cfqueryparam to subject parameters (not only date values).

  • DRG-50901: text query parser syntax error

    The query
    SELECT * FROM ij
    where
    CONTAINS (ij.summary, 'ATTENZIONE!') > 0 
    Returns an error:

    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-20000: Oracle text error:
    DRG-50901: text analysis on line 1, column 13 query syntax error


    Why?

    There is a TEXT index on the column of synthesis:
    CREATE INDEX IJL_SUMMARY_IX ON IJ
    (SUMMARY)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('
        lexer           MITO_LEXER
        wordlist        DEFAULT_WORDLIST
        stoplist        IJL_STOPLIST
        storage         IJL_TEXT_STORAGE
        SYNC (EVERY "SYSDATE + 10/1440")')
    PARALLEL ( DEGREE 4 INSTANCES 1 );
    where is the MITO_LEXER

    BEGIN
    CTX_DDL.create_preference ("mito_lexer", "BASIC_LEXER");
    CTX_DDL.set_attribute ('mito_lexer', 'INDEX_STEMS', 'ITALIAN');
    -MITO-318: the asterisks text Index research
    CTX_DDL.set_attribute ('mito_lexer', 'printjoins', ' *');
    END;
    /

    Because mark exclamation (""! "") is a reserved operator, soundex of sense and must appear before the word, it applies to.

  • MS SQL - error in query syntax is valid

    I have a problem with the second query in this code (gives me a syntax error in my HAVING line)

    < name cfquery = "getDupes" datasource = "#application. "ODBC1 #" dbtype = "ODBC" username = "" #application.userNameODBC1 # "password =" #application.userPassODBC1 # ">"
    SELECT *.
    OF view_FormCount
    WHERE formCount > = 2
    ORDER BY formNum
    < / cfquery >

    < cfset variables.lstForms = "" > "".

    < cfoutput query = "getDupes" >
    < cfset variables.lstForms = listAppend(variables.lstForms,"'#getDupes.formNum#'") >
    < / cfoutput >

    < cfset variables.whereClause = "(formNum = #ReplaceNoCase(variables.lstForms,',',' OR formNum = ','ALL') #)" > ".

    < name cfquery = 'getDetails' datasource = '#application. "ODBC1 #" dbtype = "ODBC" username = "" #application.userNameODBC1 # "password =" #application.userPassODBC1 # ">"
    SELECT tblForms.formNum, tblForms.formName, tblForms.formCustNum, tblCompanies.companyAbbr
    FROM tblForms INNER JOIN tblCompanies ON tblForms.formCustNum = tblCompanies.companyNum
    GROUP OF tblForms.formNum, tblForms.formName, tblForms.formCustNum, tblCompanies.companyAbbr
    WITH #variables.whereClause #.
    ORDER BY tblForms.formNum, tblForms.formCustNum
    < / cfquery >

    Now, the really strange thing is that if I just take the text of the query on the CFQUERY tags and use CFOUTPUT rather (to see in my browser which application is getting executed) I have a query that I can paste into Enterprise Mgr and works very well.

    I can even paste the text from a CFQUERY and CF in my code it will work very well.

    In other words, the application of the dynamic version gives me an error, but if I've just out of the SQL statement, copy - paste in the CFQUERY which is less out error (which replaces what is there) to run as a static query, it works very well (sample static query below).

    The error I get when I try to do it dynamically is "runtime error query database. [Macromedia] [SQLServer JDBC Driver] [SQL Server] Line 4: Incorrect syntax near '10169318'. The error occurred on line 21. "that is where begins the HAVING clause.

    SELECT tblForms.formNum, tblForms.formName, tblForms.formCustNum, tblCompanies.companyAbbr FROM tblForms INNER JOIN tblCompanies ON tblForms.formCustNum = tblCompanies.companyNum GROUP BY tblForms.formNum, tblForms.formName, tblForms.formCustNum, tblCompanies.companyAbbr HAVING (formNum = '10169318 ' OR formNum = "1016CONCERTA" OR formNum = "1016NSAIDS" OR formNum = "1016STRATTERA" OR formNum = "1016WELLBUTRIN" OR formNum = '18504211' OR '185093807' OR formNum = ' 73208565 = formNum' GOLD formNum = ' 732120027' GOLD formNum = ' 7322154' GOLD formNum = ' 7323402' GOLD formNum = ' 7323522' GOLD formNum = ' 73238900' GOLD formNum = ' 7324211' = '7324211S' formNum = ' 7324265 GOLD formNum GOLD ' GOLD formNum = ' 73242891' GOLD formNum = ' 732434341' GOLD formNum = ' 732434342' GOLD formNum = ' 73243435' OR) formNum = '73243436' OR formNum = '73243439' OR formNum = '73243440' OR formNum = '73243441' OR formNum = '73243442' OR formNum = '73243443' OR formNum = '7324359' OR formNum = '7324360' OR formNum = '7324370' OR formNum = '7324560' OR formNum = '7324959' OR formNum = '7326411ptreg' OR formNum = '7326599' OR formNum = '7326600' OR formNum = '7326620' OR formNum = '7326707' OR formNum = '7326931' OR formNum = '7328410' OR formNum = '732851031TOP' OR formNum = '7328512' OR formNum = '7328548' OR formNum = '7328548P2' OR formNum = '7328548P3' OR formNum = '7328548P4' OR formNum = '73289400' OR formNum = '73290D' OR formNum = '7329154' OU formNum = « 73291544JHS » OR formNum = « 73291545JHS » OR formNum = « 73291546JHSMH » OR formNum = « 73291547JHSMH » OR formNum = '7329174' OR formNum = '7329308' OR formNum = '7329402' OR formNum = '7329424' OR formNum = '7329455' OR formNum = '7329520' OR formNum = '7329539' OR formNum = « 73297701JH » OR formNum = '73298273' OR formNum = '73298400' OR formNum = '73298403' OR formNum = '73298404' OR formNum = '7329883' OR formNum = '73298860' OR formNum = '7329887' OR formNum = '73298974' OR formNum = '7329899' OR formNum = « 7329899S » OR formNum = '73299190' OR formNum = '7329987' OR formNum = « 7329999PTO » OR formNum = « 732AV5160 » OR formNum = ' 732CMHFRAZ' GOLD formNum = "732HIPAA" OR formNum = "732HIPAAFLYERS" formNum = "734HEART" formNum = ' 7444711 GOLD GOLD ' GOLD formNum = ' 7449230' GOLD formNum = ' 744 HR 4991' formNum GOLD = 7538014 MI' formNum = ' 77511044 GOLD ' GOLD formNum = ' 77511045' OR formNum = "775stampnochange" OR formNum = "80851001BLUE" OR formNum = "80MR4200" OR formNum = "80MR4273" OR formNum = "80MR4274" OR formNum = "80MR4300" OR formNum = "80MR9934" OR formNum = "80MR9935" OR formNum = "80SHC100" OR formNum = "80SHC4301" formNum = "80SHC9830" GOLD formNum GOLD = '80SHC9832') ORDER BY tblForms.formNum tblForms.formCustNum

    Use the function preservesinglequotes for your whereclause variable.

  • in the query expression syntax error

    I get the following error message:

    Microsoft] [ODBC Microsoft Access driver] syntax error (missing operator) in query expression 'customerid_cus ='.

    for the following code:

    If IsEmpty (Request.Form("company_cus")) then

    rs_company. Source = "SELECT customerid_cus, company_cus FROM customers_cus WHERE customerid_cus =" & Request.QueryString ("customerid") & "". "

    On the other

    rs_company. "Source =" SELECT customerid_cus, company_cus FROM customers_cus WHERE company_cus = ' "& Request.Form ("company_cus") &" "'"

    End If

    What could be the problem?

    Are you sure that you pass the customerid querystring when the form
    company_cus is empty.

    --
    Paul Whitham
    Certified Professional Dreamweaver MX2004
    Adobe Community Expert - Dreamweaver

    Valleybiz Web design
    www.valleybiz.NET

    "aonefun" wrote in message
    News:epmf3n$f3u$1@forums. Macromedia.com...
    > I get the following error message:
    >
    [> Microsoft] [ODBC Microsoft Access driver] Syntax error (missing operator)
    > in
    > query expression 'customerid_cus ='.
    >
    > to the following code:
    >
    > If IsEmpty (Request.Form ("company_cus")) then
    >
    > rs_company. Source = "SELECT customerid_cus, company_cus FROM".
    > customers_cus
    "> WHERE customerid_cus =" & Request.QueryString ("customerid") & ""
    >
    > Other
    >
    > rs_company. Source = "SELECT customerid_cus, company_cus FROM".
    > customers_cus
    > WHERE company_cus = ' "& Request.Form ("company_cus") &" ' "
    >
    > End If
    >
    > What could be the problem?
    >

  • Query of queries syntax error.

    Hi all

    I have the following query:

    < cfquery 'agent' datasource = name = 'Datasourcename' >
    SELECT * FROM quote where status = 'pending '.
    < isDefined ("form.agent") cfif >
    AND agent = ' #FORM.agent # '.
    < / cfif >
    < / cfquery >

    Then I have the following query of this query

    < cfquery name = "totalvalue" dbtype = "query" >
    SELECT total MySQL under the name OF the agent
    < / cfquery >

    However, I get the following error:

    Query of queries syntax error.
    Met «SUM (value.» List of incorrect selection,

    on line 20, which is:

    < cfquery name = "totalvalue" dbtype = "query" >

    now, I'm sure it's identical to what ive used before, but the error. totals query works fine when querying the database direct, only had this error when I changed it to query the master query.

    I appreciate any help in advance, that no matter how I look at I can't see whats wrong!

    In my view, that this value is a reserved word which originally is probably your current error. I would rename this column or alias it in your initial query. Also, I would like to add value WHERE IS NOT NULL to your Q-Q to cover your NULL values.

    Phil

  • DB connectivity Kit: syntax error in a SELECTION of data from joined tables

    Hello everyone

    I'm putting in labview a SQL query on joined tables.

    As an example I take a database to store the data of basketball 2on2 matches, which tables are

    corresponds to (matchId, Thomas, teamB)

    teams (teamId,PlayerAname, PlayerBname, nationality)

    nationalities (NatId, natName)

    To get an array of result with the game as well as the names of player as well as their nationality, I use this query on MySQL (which works on command line interface)

    SELECT MatchID,
    T1. PlayerAName, t1. PlayerBName, n1.natName,
    T2. PlayerAName, t2. PlayerBName, n2.natName
    MATCHES m
    INNER JOIN teams t1 ON t1.teamID = m.teamA
    INNER JOIN teams t2 ON t2.teamID = m.teamB
    INNER JOIN nationalities L1 ON n1.natID = t1.nationality
    INNER JOIN nationalities n2 ON n2.natID = t2.nationality

    When I put it in labview, using the block 'select data', I get a syntax error as shown in the attached screenshot.

    Am I something mistanking using the JOIN examples statements or aliases?

    Thanks in advance!

    The select VI is designed to be a simple way to select from a table. I doubt that he can do joins (and would not certainly need the 'FROM', even if it can). What you can do instead calls the query execute VI and give him the complete SQL query. I don't remember if it returns the data in the recordset object, so you must do so separately.

  • sql syntax error code

    Hello

    I'm trying to run a script sql in Toad and I feel say syntax error:

    ORA-00907: lack of right parenthesis

    I tried different ways to solve this problem, but can't. Here is the sql script I'm running and get the result. Please any help would be appreciated.

    SELECT Metric_Name,

    DECODE (Metric_run_mode, 1, ' on)
    Ask ', 2, 'Regular') Run_Mode,
    Max_Run,

    Min_Run,

    Avg_Run,

    number_of_runs,

    Max_Run-Avg_Run,

    Avg_Run-Min_Run,

    Avg_Run * number_of_runs,.

    NUM_RECORDS

    )

    (SELECT Metric_Name, Metric_run_mode, )
    MAX (Runtime_In_Seconds) Max_Run,

    MIN (Runtime_In_Seconds) Min_Run,

    Round (AVG (Runtime_In_Seconds), 2) AS Avg_Run,

    Count (*) AS number_of_runs,

    Max (NUM_RECORDS) NUM_RECORDS

    OF

    (SELECT DISTINCT
    B.Metric_Name,

    B.Metric_run_mode,

    ROUND ((A.Result_Stored-A.Request_To_Run) * 24 * 60 * 602) AS
    Runtime_In_Seconds,

    Success_code,

    A.NUM_RECORDS

    Of
    SI_INFOLET_RUN_STATISTICS has,
    Si_Metrics_T B

    WHERE
    a.INFOLET_ID = B.METRIC_ID and (select in b.metric_id

    separate input_metric_id of si_metric_columns where metric_id = (select
    metric_id si_metrics where metric_name =' REM MS REPAIR ACTION
    PLAN ");"

    Thanks in advance.

    See in this query, you have a group by clause.

  • "VMware converter-all-4.3.0 - 292238.exe NetBSD conversion starts do not/vmware-sysinfo - lin32.sh" received the error code (2) result:. / vmware-sysinfo-lin32: 1: syntax error: "(" unexpected

    Someone at - it successfully converted NetBSD? Thank you.

    Need to VMWARE Converter: Support for NetBSD 3.0 and later, please. I get the below error

    VMware Converter Standalone GUI show me this message: failed to query the source of linux computer

    = vmware-converter-worker - 5.log =.

    [#3] [2011-02-02 09:23:15.300 03084 info "App"] Results of the query to the host 172.30.2.48
    [#3] [2011-02-02 09:23:20.494 03084 error "App"] [Converter Agent SysinfoQuery] while trying to run "C:\Program VMware vCenter Converter Standalone\plink.exe - noprompt - stdin - Pei 22 [email protected] cd nokeycheck /tmp/.vmware-sysinfo-udhrkaaejqfyrfgf/;.» "/ vmware-sysinfo - lin32.sh" received the error code (2) result:. / vmware-sysinfo-lin32: 1: syntax error: "(" unexpected
    [#3]
    [#3] [2011-02-02 09:23:20.494 03084 error "App"] [Converter Agent SysinfoQuery] received an error code (2) of the ssh client which is dealt with later
    [#3] [2011-02-02 09:23:20.494 03084 error "App"] [Converter Agent SysinfoQuery] vmware-sysinfo execution failed; return code: 2; result:. / vmware-sysinfo-lin32: 1: syntax error: "(" unexpected
    [#3]
    [#3] [2011-02-02 09:23:20.494 03084 error "App"] [Converter Agent SysinfoQuery] Query(): Took exception, cleanup before you bail out ([converter Agent SysinfoQuery] implementation of vmware-sysinfo failed; return code: 2; result:. / vmware-sysinfo-lin32: 1: syntax error: "(" unexpected)
    [#3] )
    [#3] [2011-02-02 09:23:21.296 03084 error "App"] [Converter Agent SysinfoQuery] while trying to run "C:\Program VMware vCenter Converter Standalone\plink.exe - noprompt - stdin - Pei 22 [email protected] cat /tmp/.vmware-sysinfo-udhrkaaejqfyrfgf/vmware-sysinfo.log nokeycheck" received the error code (1) result: Cat: /tmp/.vmware-sysinfo-udhrkaaejqfyrfgf/vmware-sysinfo.log: no such file or directory
    [#3]
    [#3] [2011-02-02 09:23:21.296 03084 error "App"] [Converter Agent SysinfoQuery] received an error code (1) of the ssh client which is dealt with later
    [#3] [2011-02-02 09:23:21.296 03084 error "App"] Converter SysinfoQuery the Agent failed to retrieve the log file. return code: 1; result: Cat: /tmp/.vmware-sysinfo-udhrkaaejqfyrfgf/vmware-sysinfo.log: no such file or directory
    [#3]
    [#3] [2011-02-02 09:23:21.998 03084 error "App"] SysInfo query failed with error [converter Agent SysinfoQuery] implementation of vmware-sysinfo failed; return code: 2; result:. / vmware-sysinfo-lin32: 1: syntax error: "(" unexpected
    [#3]
    [#3] [2011-02-02 09:23:21.998 03084 info "App"] Programmed timer cancelled, succeeds StopKeepAlive
    [#3] [2011-02-02 09:23:32.240 04928 info "App"] [Converter.Worker.DiagnosticManagerImpl] build LogBundle.

    You are using a generic NetBSD kernel?

    so I think that it is similar to the Open and FreeBSD.

    hotclone is the waste of time - it won't work.

    Use Coldclone - or dd the entire disk - write a descriptor for him then and use it as vmdk.

    In the other BSD systems I boot first time in single user mode - as everything else probably does not work.
    Can I fix fstab and etc/rc.conf if necessary

    I'm in a hurry - if you need details for dd-road let me know and I explain a bit...

    Ulli

  • Syntax error when you use 'let '.

    HI gentlemen,

    I have a small XQuery file that works A1 if I do not use leash $p... However, the scheme is deeply nested and I tried to do for the sake of readability. Now I always get a syntax error - it will put in place with 'let' and 'element' together. Here is a test for a single line. By removing $p and re - his replacement by its content, it's OK.
    <?xml version="1.0" encoding='windows-1252'?>
    <!--<?xml-stylesheet type="text/xsl" href="icd.xsl"?>-->
    <page xmlns:xsql="urn:oracle-xsql"  connection="gksconnection">
    <xsql:include-xml xmlns:xsql="urn:oracle-xsql">
    SELECT XMLSerialize(DOCUMENT
    XMLQuery(
      'xquery version "1.0"; (: :)
       declare namespace n1="urn:ehd/001"; (: :)
       declare namespace n2="urn:ehd/icd/001"; (: :)
    
    let $p := /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel
    
       element h 
       {  
         /n1:ehd/n1:header/n1:provider/n1:organization/n1:id/@EX,
         element kap 
         {
           $p[n2:gruppen_liste/n2:gruppe/n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:nummer,
           /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel[n2:gruppen_liste/n2:gruppe/n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:bezeichnung,
           /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel[n2:gruppen_liste/n2:gruppe/n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:von_icd_code,
           /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel[n2:gruppen_liste/n2:gruppe/n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:bis_icd_code,
           element group 
           {
              /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel/n2:gruppen_liste/n2:gruppe[n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:bezeichnung,
              /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel/n2:gruppen_liste/n2:gruppe[n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:von_icd_code, 
              /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel/n2:gruppen_liste/n2:gruppe[n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:bis_icd_code, 
              element diag
              {
                 /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel/n2:gruppen_liste/n2:gruppe/n2:diagnosen_liste/descendant::n2:diagnose[n2:icd_code/@V="{@icd_code}"]
              }
           }
         }
       }'
      PASSING xml_document
      RETURNING CONTENT
    )
    AS CLOB INDENT SIZE = 2
    ) as result
    FROM icd
    where id = {@idno} 
    </xsql:include-xml>
    </page>
    Can someone help me find the cause of the error? Unfortunately, I need some 'header' < chapter > and < group > data too, which lies over the "core" of the query: < diagnose > node. That's why I chose the technique of qualification.

    Thank you, best regards

    Miklós HERBOLY
     RESULT
     --------------------------------------------------------------------------------
     
       
         
       
                                                                                                                         
    

    OK, you get the empty elements on 11.2.0.2, so there is certainly a problem on this version.
    The fact that the NO_XML_QUERY_REWRITE indicator work means that there is a problem with the optimizer tries to use the internal binary XML structure to deal with the XQuery.

    I can't say much more than that, but since the test case is simple enough, you probably connect a SR with Oracle Support on that one.

  • Stmt case answers column fx syntax error

    Hello

    I want to update the 'Project name' column that is of type VARCHAR to "Undefined" If the "Project_date" column has a value of January 1, 1900 12:00 "." I use the stmt case following answers column Fx of 'Project name' but do syntax error.

    BOX WHEN "hand-made". "" Project_date "= January 1, 1900 12:00 ' THEN 'Undefined' ELSEWHERE 'hand made '. "' Project name ' END

    Thanks for your time and your help.

    Hi Ssk,

    It should work. Please make sure once again that the underside of things in your query:

    (1) 1st January 1900 12:00 - value exists in the column
    (2) and remove all spaces between the column name and values.

    Without spaces:

    BOX WHEN "hand-made". "Project_date" = January 1, 1900 12:00 ' THEN 'Undefined' ELSEWHERE 'hand made' "." " The project name"END;

    I would like to know if that works for you or not.

    Thank you
    -Laurence.

  • Syntax error in the loop statement For

    Hello

    Normally my staements FOR were not a problem as only the access one table. I have the example below, I'm to access the three table and that's why I get a syntax error.

    I want only to select the 'product' recored but need the other table to select it the good results.

    FOR product_rec IN (SELECT * from PRODUCT, PRODUCT_GROUP, PROD_PROD_GROUP)
    where PRODUCT_GROUP. PRODUCT_GROUP_KEY = PROD_PROD_GROUP. PRODUCT_GROUP_KEY
    and PROD_PROD_GROUP. PRODUCT_KEY = PRODUCT. PRODUCT_KEY
    and product.supplier_key = company_no
    and PROD_PROD_GROUP. MULTI_WEB_DIS = 1
    order of PROD_PROD_GROUP. MULTI_WEB_SEQ)

    Can someone make the correct syntx for this statement.

    Thank you

    Pete

    As Dom says:

    FOR product_rec IN (SELECT PRODUCT.* from PRODUCT, PRODUCT_GROUP,PROD_PROD_GROUP
    where PRODUCT_GROUP.PRODUCT_GROUP_KEY = PROD_PROD_GROUP.PRODUCT_GROUP_KEY
    and PROD_PROD_GROUP.PRODUCT_KEY = PRODUCT.PRODUCT_KEY
    and product.supplier_key = company_no
    and PROD_PROD_GROUP.MULTI_WEB_DIS = 1
    order by PROD_PROD_GROUP.MULTI_WEB_SEQ) 
    

    Or what he meant by "nice to have", use aliases:

    select p.*
    from
      product p,
      product_group pg,
      prod_prod_group ppg
    where
      pg.product_group_key = ppg.product_group_key
      and ppg.product_key = p.product_key
      and p.supplier_key = company_no
      and ppg.multi_web_dis = 1
    order by
      ppg.multi_web_seq
    

    Also note that company_no is not an alias in the above query. If there is a column, it should be an alias also (although with the full table name or alias if you switch to their use). If it is a PL/SQL variable, it is fine as it is.

    Published by: cmartin2 on February 2, 2011 13:56

  • LRM-00116: syntax error

    Hi all

    10.2.0.4 on solaris 10
    nohup expdp username/password directory=dump_dir dumpfile=medlog_nov2008_dec2009.dmp logfile=medlog_nov2008_dec2009.log query=med_log:"WHERE 
    logdate between  (SELECT logdate from med_log where logdate between to_Date('01-NOV-2008','DD-MON-YYYY') and
    to_date('01-JAN-2010','DD-MON-YYYY'))" tables=med_log parallel=20
    has failed with the error below:

    LRM-00116: syntax error in ')' sequel "MON-DD-YYYY.

    Hello
    Try

    
    query=med_log:' "WHERE
    logdate between  (SELECT logdate from med_log where logdate between to_Date('01-NOV-2008','DD-MON-YYYY') and
    to_date('01-JAN-2010','DD-MON-YYYY'))" ' 
    
  • MySQL stored procedure syntax errors

    I have a request online, I want to use transactions either commit all updates of db or anything. The code I created is as follows, not only am I getting an error of syntax on lines 5 and 16, but frankly I do not know that the code is really going to do what I want. Please let me know if you see syntax errors and explain them.

    CREATE PROCEDURE increase_maint_priority
        (maint_item INT, new_priority INT, cur_priority INT, center_id INT)
     
    BEGIN
        START TRANSACTION; -- line 5 syntax error
        -- start updates
        UPDATE maintitem SET priority = (priority+1) 
            WHERE priority > cur_priority
            AND priority <= new_priority
            AND centerID = center_id;
            
        UPDATE maintitem SET priority = new_priority
            WHERE id = maint_item;
        
        COMMIT;
    END; -- line 16 syntax error
    

    Thank you in advance for helping a newb to stored procedures.

    If you want to help me to know if this code will actually work for what I want, that the following describes the situation.

    Main idea: business location apply for maintenance at their Center. Applications can be added anywhere in the list of priority (1 = highest priority). They can also change the priority of an application at any time.

    Previously I was using php to control a loop of update mysql queries (ouch, I know now, 2 sql statements could do the trick) and we live lately priorities in double, and other problems which seem to be very likely related to the update of the priorities of several elements.

    Ex: moving priority 6 to priority 1 requires 1 update query because the current priority of the 6th point, but a second query (or loop of several others since I am very new to the drafting 2 years ago sql statements) to update the other priorities.

    Thus, the desire for transaction method.

    Once again, thanks in advance for any help on this matter.

    PS - I use MySQL workbench to write this and it's where to find errors.

    I do not use MySQL and its syntax is slightly different from the other DBMS stored procedures. In all cases, once you eliminate the warning, you also add a handler to ensure that updates roll back in case of error:

    http://khanrahim.WordPress.com/2010/05/16/transaction-with-stored-procedure-in-MySQL-serve r.

  • PreparedStatement, creation of syntax error.

    The poblem is in the first query prepared if I get the value directly in the works of everying string statement very well. However, when I use one? placeholder and a supply then the same value of sting, I would have entered the education channel, I get a syntax error.

    import java.sql.*; import javax.swing.*; import java.awt.BorderLayout; import java.awt.event.*; public class Exercise34_5 extends JFrame { private JTextField jtfInput = new JTextField(10); private JButton jbShowTable = new JButton("Show Table"); private JTextArea jta = new JTextArea(); private PreparedStatement pstmt1; private PreparedStatement pstmt2; private PreparedStatement pstmt3; public Exercise34_5() { JPanel northPanel = new JPanel(); northPanel.add(new JLabel("Table Name")); northPanel.add(jtfInput); northPanel.add(jbShowTable); add(northPanel, BorderLayout.NORTH); add(new JScrollPane(jta)); try { Class.forName("com.mysql.jdbc.Driver"); Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/test" , "root", "root"); pstmt1 = connection.prepareStatement("describe ?"); pstmt2 = connection.prepareStatement("select count(*) from enrollment"); pstmt3 = connection.prepareStatement("select * from enrollment"); }catch(Exception ex) { ex.printStackTrace(); } jbShowTable.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String table = jtfInput.getText(); try{ pstmt1.setString(1, "enrollment"); /*pstmt2.setString(1, "enrollment"); pstmt3.setString(1, "enrollment");*/ ResultSet rset1 = pstmt1.executeQuery(); ResultSet rset3 = pstmt3.executeQuery(); int count = 0; while(rset1.next()) { jta.append(rset1.getString(1) + "\t"); count++; } jta.append("\n"); System.out.println(count); while(rset3.next()) { for(int i = 1; i <= count; i++) { jta.append(rset3.getString(i) + "\t"); } jta.append("\n"); } }catch(Exception ex) { ex.printStackTrace(); } } }); } public static void main(String[] args) { Exercise34_5 frame = new Exercise34_5(); frame.setSize(400, 200); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(EXIT_ON_CLOSE); frame.setVisible(true); } }

    java.sql.SQLException: syntax error or access violation of the server message: "you have an error in your syntax SQL; consult the manual for your version of the MySQL server for the right syntax to use near "entry" on line 1 "
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1997)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2251)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1586)
    to Exercise34_5$ 1.actionPerformed(Exercise34_5.java:47)

    Alyosha says:
    I don't understand.

    You can not just put a? setting any old place in a prepared statement. That's all just a simple string substitution. For example, you cannot use a? setting for a table name or a column.

    // wrong
    ps = conn.prepareStatement("select * from ? where ? = ?");
    ps.setString(1, tableName);
    ps.setString(2, columnName);
    ps.setString(3, columnValue);
    
    // right
    ps = conn.prepareStatement("select * from " + tableName = " where " + columnName + " = ?");
    ps.setString(1, columnValue);
    

Maybe you are looking for