Discussion:
TIBQuery - Field Not Found
(too old to reply)
Adalberto Baldini
2008-05-02 07:47:59 UTC
Permalink
I have a TIBQuery with this definition :
..... c.au_inpaut ambinp, d.au_inpaut filinp, ...
(tried also this version "c.au_inpaut as ambinp, d.au_inpaut as filinp,")

that always worked well. I upgraded Win32 to December 2007 Update and now
I get error message "field not found".

I added all fields in fields editor and these fields are included in Fields
List, but I still get same error.
I checked in Text Form and they are well defined.
I rebuilt Project but error remains.

Any suggestion ?

Adalberto Baldini
Bill Todd [TeamB]
2008-05-02 13:51:51 UTC
Permalink
Post by Adalberto Baldini
Any suggestion ?
Post the full text of the error message and the complete SQL statement.
--
Bill Todd (TeamB)
Adalberto Baldini
2008-05-04 14:57:24 UTC
Permalink
Post by Bill Todd [TeamB]
Post the full text of the error message
---------------------------
Debugger Exception Notification
---------------------------
Project GesCom_01_prj.exe raised exception class EDatabaseError with message
'IBQry_Doc: Field 'ambinp' not found'.
---------------------------
Break Continue Help
---------------------------
Post by Bill Todd [TeamB]
and the complete SQL statement.
select a.prgname , a.param as opeparam,
b.csoc, b.nreserc,b.coddoc, b.codgio,
b.desdoc, b.desgio, b.tipdoc, b.tipgio,
b.x_seqdoc, b.fl_numeradoc,
b.x_unicogio, b.x_reggio, b.x_rettifgio, b.x_paramgio,
b.fl_annualgio, b.fl_bollagio, b.fl_numeragio,
c.abinp, c.ambname, c.a_abiqt, c.au_inpaut ambinp,
d.fil, d.filname, d.f_filiqt, d.au_inpaut filinp
from fiopedoc a
left join doc_gio(:csoc, :nreserc) b on a.doc_2=b.tipdoc
left join AB_DOC_UNO (:utente, :csoc, :nreserc, :camb, b.coddoc ) c on
( c.fblc = '0')
left join FIL_DOC_UNO (:utente, :csoc, :nreserc, :cfil, b.coddoc) d on
( d.fblc = '0' )
where a.codope = :ope and b.coddoc = :cdoc and
(c.au_inpaut = '1' or c.au_celur = '1') and
(d.au_inpaut = '1' or d.au_celur = '1') and
( b.x_reggio = '1' or b.x_reggio = '0') and
exists
(select f.codgio
from AB_GIORN (:utente, :csoc, :nreserc) e
left join FIL_GIORN (:utente, :csoc, :nreserc) f on
( f.codgio = e.codgio )
where e.codgio = b.codgio and
e.fblc ='0' and f.fblc = '0' and
e.abinp = c.abinp and
f.fil = d.fil and
(e.au_inpaut = '1' or e.au_celur = '1') and
(f.au_inpaut = '1' or f.au_celur = '1')
)
ORDER BY
b.x_reggio


Adalberto
Bill Todd [TeamB]
2008-05-04 18:49:07 UTC
Permalink
Post by Adalberto Baldini
ambinp
ambinp only appears once in the SQL statement as a column alias. Does
the statement execute if you remove ambinp?
--
Bill Todd (TeamB)
Adalberto Baldini
2008-05-05 07:38:59 UTC
Permalink
Post by Bill Todd [TeamB]
Post by Adalberto Baldini
ambinp
ambinp only appears once in the SQL statement as a column alias. Does
the statement execute if you remove ambinp?
If I don't define list fields, statement open well, error raises with:
fl_ambinp := IBQry_Doc.FieldByName('ambinp').asString;

If I assign list fields error raises in Open .

I changed "c.au_inpaut ambinp" in uppercase in Proc, in Table and in SQL
but error remains.
In IBConsole query works normally.

Adalberto
Adalberto Baldini
2008-05-05 08:11:43 UTC
Permalink
I find problem was in my code. Thanks for help.
Adalberto

Wayne Niddery (TeamB)
2008-05-02 18:03:17 UTC
Permalink
Post by Adalberto Baldini
..... c.au_inpaut ambinp, d.au_inpaut filinp, ...
(tried also this version "c.au_inpaut as ambinp, d.au_inpaut as filinp,")
that always worked well. I upgraded Win32 to December 2007 Update and
now I get error message "field not found".
What version did you upgrade from? In the database table definitions, are
these fields names all uppercase or are they mixed or lower case? If the
latter then you must match the casing *exactly* in your SQL statements.
--
Wayne Niddery - TeamB (www.teamb.com)
Winwright, Inc. (www.winwright.ca)
Adalberto Baldini
2008-05-04 15:07:42 UTC
Permalink
Post by Wayne Niddery (TeamB)
Post by Adalberto Baldini
..... c.au_inpaut ambinp, d.au_inpaut filinp, ...
(tried also this version "c.au_inpaut as ambinp, d.au_inpaut as filinp,")
that always worked well. I upgraded Win32 to December 2007 Update and
now I get error message "field not found".
What version did you upgrade from?
from 11.0.2804.9245.4
Post by Wayne Niddery (TeamB)
In the database table definitions, are these fields names all uppercase
or are they mixed or lower case? If the latter then you must match the
casing *exactly* in your SQL statements.
When I add all fields they are put in upper case and error raise.
If I change in lower case as they are defined in SQL, error still raises

Adalberto
Wayne Niddery (TeamB)
2008-05-04 23:28:17 UTC
Permalink
Post by Adalberto Baldini
When I add all fields they are put in upper case and error raise.
If I change in lower case as they are defined in SQL, error still raises
If they are defined in lower case in the database then you *must* match it
in your query and field name needs to be delimited with doublequotes:

select a."prgname" , a."param" as opeparam,
...

If in the database, the 1st field above is actually "PrgName", then that is
what you must write in you sql (in quotes).

When a table is created, if a fieldname is specified as either PRGNAME or
"PRGNAME" then quotes in your SQL become optional, all of PRGNAME, prgname,
PrgName, or "PRGNAME" will work, but "prgname" will not.
--
Wayne Niddery - TeamB (www.teamb.com)
Winwright, Inc. (www.winwright.ca)
Adalberto Baldini
2008-05-04 16:43:49 UTC
Permalink
Post by Adalberto Baldini
..... c.au_inpaut ambinp, d.au_inpaut filinp, ...
(tried also this version "c.au_inpaut as ambinp, d.au_inpaut as filinp,")
that always worked well. I upgraded Win32 to December 2007 Update and
now I get error message "field not found".
I reinstalled version 11.0.2804.9245 and problem remains. So it is not a
release problem .

Adalberto
Loading...