Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8290313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:46:14+00:00 2026-06-08T12:46:14+00:00

I have a strange behaviour where I execute a methods that run a query.

  • 0

I have a strange behaviour where I execute a methods that run a query. It works on localhost but fails on the quality envoronement. The query and the error are the follows:

WITH t AS 
(
    SELECT
        *,
        ROW_NUMBER() OVER(PARTITION BY matricola  ORDER BY esercizio DESC, cod_valutazione, valutaz_sintetica, matricola, FigureOrder) AS RowN 
    FROM 
        (SELECT DISTINCT 
            '' AS pdf,
            Vm.NomeManager + ' ' + Vm.CognomeManager AS valutatore,
            vpd.ESERCIZIO AS esercizio,
            vpd.cod_valutazione,
            Vm.NomeValutato +' ' + Vm.CognomeValutato AS valutato,
            vpd.matricola,
            valutaz_sintetica,
            vpd.COD_STATO AS stato_scheda,
            vpd.VALUTAZIONE_RANKING_SINTETICA,
            vvv.COD_FIGURA,
            CASE
                WHEN COD_FIGURA = 'OWNG' THEN 0
                WHEN COD_FIGURA = 'VAL1' THEN 1
                WHEN COD_FIGURA = 'OWN' THEN 2
            END AS FigureOrder      
        FROM
            View_SchedePerDistribuzione vpd
            INNER JOIN RL_VALUTAZIONE_VALUTATI_VALUTATORI vvv ON vpd.COD_VALUTAZIONE = vvv.COD_VALUTAZIONE AND vpd.MATRICOLA = vvv.MATRICOLA_VALUTATO 
            INNER JOIN ValutatiManager  Vm ON vpd.MATRICOLA = Vm.MatricolaVAlutato AND vpd.COD_VALUTAZIONE = Vm.COD_VALUTAZIONE
        WHERE 
            vpd.cod_valutazione='PA_SCI_11-12_test' AND 
            vpd.cod_stato='PROP' AND 
            chiusa = 0 AND 
            valutaz_sintetica <> '' AND 
            VVV.COD_FIGURA IN ('VAL1', 'OWN', 'OWNG') AND 
            VVV.Matricola = '06000013' 
        ) AS tab) 

        SELECT * 
          FROM t
         WHERE RowN = 1
         ORDER BY esercizio DESC, cod_valutazione, valutaz_sintetica, matricola, FigureOrder

This is the error:

        nnString=Provider=SQLOLEDB;Data Sourcexxx;Initial Catalog=xxx;Persist Security Info=True;User ID=xxx;Password='xxx';Connect Timeout=xx System.Data.OleDb.OleDbException (0x80040E14): 
        Incorrect syntax near the keyword 'with'.     
        at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)     
        at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)     
        at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)     
        at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)     
        at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)     
        at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)     
        at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)     
        at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)     
        at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)     
        at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)     
        at valDipLibrary.utility.getQuery(String qry, OleDbTransaction SqlTrn, String ConnString, Boolean fromPool, Boolean logReq, Int32 startRecord, Int32 maxRecord)     
        at valDipLibrary.utility.getQuery(String qry, OleDbTransaction SqlTrn, String ConnString, Boolean fromPool, Boolean logReq, Int32 startRecord, Int32 maxRecord)

More info:

If I run the query on my SSMS it works.
If I run the query on the SSMS of the quality server it works.

It does not works only if I run the method thet execute the query.

Can you help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:46:16+00:00Added an answer on June 8, 2026 at 12:46 pm

    Try a semicolon before the word with

    ie:

    ;WITH t AS  
    ( 
        SELECT 
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know it's a simple question, but I have strange behaviour in here. <pre>
I have run into a very strange behaviour I can’t make sense of. I
I have a strange behavior trying to execute a query declaring ObjectQuery MergeOption to
Just started with JavaCC. But I have a strange behaviour with it. I want
I have strange behaviour with firefox (other browser works good). I have rule: .feed.input.community
I have strange behaviour in Python/PyMongo. dbh = self.__connection__['test'] first = dbh['test_1'] second =
I have a strange behaviour. I am using a rather heavy page (4000 nodes)
I have very strange behaviour of Java Date class: System.out.println(new Date().toGMTString()); long l =
Why this two functions have the strange behaviour of when I click on thead,
I have a strange Hibernate behaviour in my program. I have two classes with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.