#1  
Old 3rd November 2019, 01:38 AM
Samuel
 
Posts: n/a
Default Field error while executing a script a second time

Hi,

I encountered a problem when NexusDB processes a long script that I created.

When I run the script for the first time, it is processed without errors
but on the second run I get the error:

NexusDB: Query10155031: Query execution failed:
Error in statement: Unable to resolve the identifier "clCODIGO" at line
478, pos 18

The error occurs in the part below:

DROP TABLE IF EXISTS ##TMP_RAIO_X_CLI_COD;
CREATE LOCAL TEMPORARY TABLE ##TMP_RAIO_X_CLI_COD AS
* (SELECT TOP 15 clCODIGO, QTD_TOT_CLI FROM
*** (SELECT clCODIGO, SUM(QTD_CLI) QTD_TOT_CLI FROM ##TMP_RAIO_X_CLI
GROUP BY clCODIGO ) CLI
**** ORDER BY QTD_TOT_CLI DESC
*** ) WITH DATA;

If I replace it with the code below, the entire script runs without
error every time:

DROP TABLE IF EXISTS ##TMP_RAIO_X_CLI_1;
CREATE LOCAL TEMPORARY TABLE ##TMP_RAIO_X_CLI_1 AS
*** (SELECT clCODIGO, SUM(QTD_CLI) QTD_TOT_CLI FROM ##TMP_RAIO_X_CLI
GROUP BY clCODIGO) WITH DATA;
DROP TABLE IF EXISTS ##TMP_RAIO_X_CLI_COD;
CREATE LOCAL TEMPORARY TABLE ##TMP_RAIO_X_CLI_COD AS
* (SELECT TOP 15 clCODIGO, QTD_TOT_CLI FROM ##TMP_RAIO_X_CLI_1 ORDER BY
QTD_TOT_CLI DESC
*** ) WITH DATA;

I ran the script on E.M. connected to NexusDB 4.5015 (64bits), but this
error also occurs if running using "internal server" of the EM32 or EM64.

I will put the full script in binaries, along with the tables used, and
appreciate if anyone can tell me if it's a NexusDB issue or if the code
has any errors that I didn't realize.

This script is still under development and so it has a lot of repeated
code that will be optimized when I'm done :-)

Thank you,

Samuel



  #2  
Old 3rd November 2019, 04:46 PM
Eivind Bakkestuen [NDD]
 
Posts: n/a
Default Re: Field error while executing a script a second time

> I ran the script on E.M. connected to NexusDB 4.5015 (64bits), but
> this error also occurs if running using "internal server" of the EM32
> or EM64.


I could reproduce, thanks for providing the case. If you would please
log the issue in the tracker, you'll be updated on its progress.

--
Eivind Bakkestuen [NDD]


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
auto updating date modified field - SQL script help William O. nexusdb.public.support.sql 7 25th July 2007 07:09 PM
Problem executing Northwind_V2 script MJMatthew nexusdb.public.support 3 1st March 2007 11:46 PM
Error Executing SQL in Single User Jesse nexusdb.public.support 4 22nd May 2006 11:39 PM
Strange Error when executing query ... plz help Henry - AR nexusdb.public.discussions 6 2nd April 2006 11:53 AM
AVG of TIME field ? Joao Borges nexusdb.public.support.sql 15 14th October 2003 04:34 PM


All times are GMT +11. The time now is 07:38 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.