473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Error in select

Hello.

When I run the next query:

SELECT DATE_TRUNC('hour', TL.TAL005_DATE), TL.SRV_ID, TL.MSU_NUMBER,
DS.DESCRIPTION, DS.CALLTYPE, COUNT(*)
FROM OWNER_CATALOG.TAL005 TL,
OWNER_CATALOG.DS_AREA_CODE DS
WHERE SRV_ID = 1 AND
TAL005_DATE > to_date('01011900','ddmmyyyy') AND
DS.CODE = ( SELECT MAX(DSS.CODE)
FROM OWNER_CATALOG.DS_AREA_CODE DSS
WHERE DSS.CODE =
SUBSTR(TL.TAL005_INCLI,1,LENGTH(DSS.CODE)))
GROUP BY DATE_TRUNC('hour', TL.TAL005_DATE), TL.SRV_ID, TL.MSU_NUMBER,
DS.DESCRIPTION,DS.CALLTYPE;

I get:

ERROR: variable not found in subplan target list

This query works fine in 7.3.4, but we are migrating to 7.4 and it
doesn't work.

Some idea about the problem????

Thanks.

CG
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #1
3 3360
Carmen Gloria Sepulveda Dedes <cs********@atichile.com> writes:
I get:
ERROR: variable not found in subplan target list


Could we have enough context to reproduce the problem? I don't have
time to guess at your table definitions ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #2
Ok ... sorry.

The tables ...
CREATE TABLE STS_TRFAREA (
c_date TIMESTAMP ,
srv SMALLINT ,
msu SMALLINT ,
description VARCHAR(30) ,
calltype VARCHAR(1) ,
ncalls INTEGER
) WITHOUT OIDS;

CREATE TABLE TAL005(
file_id BIGINT ,
srv_id SMALLINT NOT NULL,
msu_number SMALLINT NOT NULL,
mmu_id INTEGER ,
tal005_date TIMESTAMP ,
tal005_seccid VARCHAR(12) ,
tal005_tconect INTEGER ,
tal001_tconect INTEGER ,
tal005_mboxid VARCHAR(16) ,
tal005_incli VARCHAR(16) ,
tal005_msgid VARCHAR(18) ,
tal005_tvcmsg INTEGER ,
tal005_nfaxpg INTEGER ,
tal005_msgclas SMALLINT ,
tal005_msgcncl SMALLINT ,
tal005_msgsts SMALLINT ,
tal005_clgrsnterm SMALLINT
) WITHOUT OIDS;

CREATE TABLE DS_AREA_CODE(
code VARCHAR(16) NOT NULL,
description VARCHAR(30) NOT NULL,
calltype VARCHAR(1) ,
UNIQUE (code)
) WITHOUT OIDS;

I want to insert into table STS_TRFAREA, by selecting on TAL005 AND
DS_AREA_CODE,
with:
INSERT INTO STS_TRFAREA (C_DATE, SRV, MSU, DESCRIPTION,
CALLTYPE, NCALLS)
SELECT DATE_TRUNC('hour', TL.TAL005_DATE), TL.SRV_ID,
TL.MSU_NUMBER,
DS.DESCRIPTION, DS.CALLTYPE, COUNT(*)
FROM TAL005 TL,
DS_AREA_CODE DS
WHERE SRV_ID = 1 AND
TAL005_DATE >
to_date('01011900','ddmmyyyy') AND
DS.CODE = ( SELECT MAX(DSS.CODE)
FROM DS_AREA_CODE DSS
WHERE DSS.CODE =
SUBSTR(TL.TAL005_INCLI,1,LENGTH(DSS.CODE)))
GROUP BY DATE_TRUNC('hour', TL.TAL005_DATE), TL.SRV_ID,
TL.MSU_NUMBER, DS.DESCRIPTION, DS.CALLTYPE;

.... but ... on execute, I get the error:
ERROR: variable not found in subplan target list

Any idea?

We have postgresql 7.4 installed on Tru64 and Solaris. The error is the
same.
In other machine we have postgresql 7.3.4 on Solaris and this insert
works fine.

Thanks.

CG
Tom Lane wrote:
Carmen Gloria Sepulveda Dedes <cs********@atichile.com> writes:
I get:
ERROR: variable not found in subplan target list


Could we have enough context to reproduce the problem? I don't have
time to guess at your table definitions ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #3
Carmen Gloria Sepulveda Dedes <cs********@atichile.com> writes:
Ok ... sorry.
[example snipped]
... but ... on execute, I get the error:
ERROR: variable not found in subplan target list


Hmm. I tried your example on CVS tip and didn't see a problem, which
means either that the bug is already fixed or that the example with
no data isn't sufficient to trigger it. If you enter just the table
declarations you gave into an empty database and then try the INSERT,
does it fail? If not, can you make it fail by altering the values of
enable_nestloop, enable_mergejoin, enable_hashjoin?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael | last post by:
Hello again everyone, Hope you can help. I have a form with a lot of code going on in the background but I can't find the route cause of the following error message. Update or Cancel Update...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
4
by: Troy | last post by:
We recently installed the .Net framework on a windows 2000 server. Shortly after that we experienced intermitant problems running a web based program that accesses an Access 2002 database. The...
2
by: frbn | last post by:
hi all, we currently experience an original problem on a production server with a postgresql 7.1.3 ( a bit old, I know :\ ) We just want to know if somebody experienced this problem: the...
5
by: Omer | last post by:
Hi, I am using C# 2.0 along with MS Access database. All my queries are working perfectly fine, but one inner join query is ocntinously throwing. I ahve tried it both from code and running...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
3
by: Leighya | last post by:
Im currently working on this xml file but when i load it to Mozilla, i got an error "Error Loading Stylesheet: Xpath parse failure: invalid variable name" It loads on IE properly. Only with the...
1
by: resqtech | last post by:
I am having an issue with an Access Database that worked at one time and after a Windows Update that screwed up the profile it stopped working. The following is what VB is stating causes the error. ...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.