cracked egg
14th February 2003, 23:35
Hello. I am having difficulty compiling the field tdpur045.pmsk in a customised script. I have created a new session and report and when I try to add a further filter to the select I am receiving the msg "Table 'tdpur045' not declared for column tdpur045.pmsk".
I can't understand this as the table is declared and I can select other values from that table successfully (i.e. tdpur045.orno, pono, spur).
Is there something unique about the field tdpur045.pmsk?
here is part of the code:
|select tdpur045.spur, tdpur045.pmsk
select tdpur045.*
from tdpur045
where tdpur045._index1 = {:tdpur041.orno, :tdpur041.pono}
and tdpur045.spur = 9
| and tdpur045.pmsk(:stno.4423;9)<>"e"
| and tdpur045.pmsk(:stno.4223;1)<>"e"
selectdo
| if tdpur045.pmsk(:stno.4423;9) = "e" then
| if tdpur045.pmsk = "e" then
| if tdpur045.pmsk(:tdsls045.spur;9) = "e" then
osta.del_lines = true
| tdpur045.pmsk = "e"
| endif
endselect
any mention of tdpur045.pmsk and it won't compile. Is it not just a string like any other string? Stuff like : | tdpur045.pmsk = "e" isn't accurate but I still thought it would compile.
Thanks.
tjbyfield
15th February 2003, 01:59
Hi cracked-egg
I sometimes get similar messages when I have forgotten to explicitly declare a table.
have you got:-
declaration:
......
......
table ttdpur045 | Receipts
If you do get the table right I think some of the tests you were trying are not correct. eg:
tdsls045.pmsk(:stno.4423;9)<>"e"
should be .......................(:stno.4423;1)<>"e"
and tdsls045.pmsk(:tdsls045.spur;9)="e"
should not have the colon before the table name (:tdsls045) and should be testing a length of 1 not 9.
Hope this helps.
Terry
cracked egg
17th February 2003, 23:57
Terry, thanks for your help but even if I have this cleaner script
I still get the same 'not declared' message for table tdpur045.
select tdpur045.*
from tdpur045
where tdpur045._index1 = {:tdpur041.orno, :tdpur041.pono}
and tdpur045.spur = 9
selectdo
if tdpur045.pmsk(:stno.4423;1) = "e" then
osta.del_lines = true
endif
endselect
I can't see why this shouldn't work.
tools123
18th February 2003, 00:35
Could you restate your problem with the field after
trying these:
1.Is it the Program script or the report script you are
having problem with?
2.Have you tried to see if just the field being in the query (minus the string manipulations) works?
If this worked, relook at your string manipulation code.
This also checks if you included the tdpur045.pmsk in the
report input fileds if the problem is in report script.
3.Is the error message complete or does it say, tdpur045 not decalred for tdpur045.pmsk?
I would try and get a simple output first and go about stripping it off.
Good Luck
mark_h
18th February 2003, 02:54
Is it possible the data dictionary is corrupt? Do you see the field when using table maintenance?
You might want to try to rebuild the data dictionary for the table in the VRC it is defined in. Also I did not see where you answered the question by Terry on the following:
declaration:
table ttdpur045 | Receipts
I know you will get an error like you described when you try to use a table field in the if statement if you do not have it declared.
Good Luck!
Mark
cracked egg
19th February 2003, 21:59
Thanks for all help.
tools123 - It is a program script. I have tried different ways to incorporate the field into the query just to see if it is ok?
mark_h - I can see and manipulate this field in GTM. The table has been declared - otherwise I would not be able to query other fields in it (when all refs to pmsk are commented out). I agree that the error usually comes from not declaring the table.
I have changed this script again and I might be getting past the error but I am now getting these 2 errors
"Error: 'stno.4223' not declared
"Error: 'SQL host variable ':stno.4223' not declared.
select tdpur045.*
from tdpur045
where tdpur045._index1 = {:tdpur041.orno, :tdpur041.pono}
and tdpur045.spur = 9
and tdpur045.pmsk(:stno.4223;1)<>"e"
selectdo
osta.del_lines = true
endselect
Again, thank you
mark_h
20th February 2003, 01:42
How did you get past the tdpur045.pmsk problem?
As for the other problem have you included the right include file for the variable - maybe tdpur0004. Not sure what include file it is in because we do not own source.
Mark
nick_rogers
20th February 2003, 18:24
Use the syntax posted by Cracked Egg except make one change, change the (:stno.4423;1) to (stno.4423;1). Also as Mark noted make sure the correct include is used along with the call to the fucntion that will provide the stno.4423 value.
select tdpur045.*
from tdpur045
where tdpur045._index1 = {:tdpur041.orno, :tdpur041.pono}
and tdpur045.spur = 9
selectdo
| if tdpur045.pmsk(:stno.4423;1) = "e" then
if tdpur045.pmsk(stno.4423;1) = "e" then
osta.del_lines = true
endif
endselect
zardoz
20th February 2003, 18:48
You can try this:
select tdpur045.*
from tdpur045
where tdpur045._index1 = {:tdpur041.orno, :tdpur041.pono}
and tdpur045.spur = 9
and :1 <> "e"
wherebind(1, tdpur045.pmsk(stno.4223;1))
selectdo
osta.del_lines = true
endselect
cracked egg
20th February 2003, 19:31
Sorry for dragging this out (I hate giving up because I know it is likely something simple) but even with the include file 'tdpur0014 Deal with Order Item Line Status' (and tdsls0014 Deal with Order Item Line Status) I still get asked by the compiler to declare 'stno.4423'. I have tried Nick's and Zardoz's scripts. Have I got the wrong include? Should I somehow declare 'stno' or stno.4423 in the script.
Thanks again
nick_rogers
20th February 2003, 19:34
yes you need to declare the var stno' or stno.4423 (whatever you are going to use).
nick_rogers
20th February 2003, 19:45
here you go :)
Include is
#include "itdsls0014" | deal order status
declaration is
domain tcstno stno.4223
call is
tdsls0014.session.status("tdsls4223m000",stno.4223)
and this is a standard Baan select using the pmask:
select tdsls045.*, tdsls040.comp
from tdsls045, tdsls040
where tdsls045._index5 > {"",0}
and tdsls045.pmsk(:stno.4223;1) = "y"
and tdsls045.pmsk(:stno.4404;1) = "e"
and tdsls045.orno refers to tdsls040
selectdo
cracked egg
20th February 2003, 19:48
Nick - I for some reason didn't think I needed to declare stno.4423.
Everything compiles now - Thanks to all