Same thing occurs in 6.1a
Ben Petersen
On 25 Sep 2001, at 17:02, J.M. GRATIAS wrote:
>
> Hi all,
>
>
> RBW versions older than 6.5++ had some problems when accessing to system
> tables (with SELECT, CHOOSE ...).
>
> Some problems are supposed to be fixed in 6.5++
>
> But one (at least) is still there ....
>
> This view is used to collect columns in tables COMMANDE and LIGNE that have
> a comment associated :
>
> CREATE VIEW vtstat AS SELECT +
> T1.Sys_Table_Name, +
> T2.Sys_Column_Name, +
> T2.Sys_Comment +
> FROM Sys_Tables T1, Sys_Columns T2 +
> WHERE (T1.Sys_Table_ID = T2.Sys_Table_ID) AND +
> T1.Sys_Table_Name IN ('commande','ligne') AND +
> T2.Sys_Comment IS NOT NULL
>
> No problem to build the view or to read it :
> SELECT all FROM vtstat
> works OK
>
> But problem to know how many records the view contains :
> SELECT COUNT(*) FROM vtstat
> works at R>
> works also if on the last line of a CMD file,
> but fail when enclosed in a CMD file if followed by any other command :
> 'Error - Column or variable vnumcde not found (2515)'
>
> Example :
> R>SELECT COUNT(*) FROM vtstat ; show var vINT
> works OK
> but
> SELECT COUNT(*) FROM vtstat ; show var
> don't works in a CMD file ...
>
> Strange, is not it ???
>
> vnumcde is a variable used to define other dynamic views, such as :
> CREATE VIEW vligne (vnbligne, vmtfact) AS SELECT COUNT(numcde), SUM(mtfact)
> FROM ligne +
> WHERE (numcde = .vnumcde)
>
> If I want
> SELECT COUNT(*) FROM vtstat
> to work, I have to define all dynamic variables used in all views prior to
> this command ....
>
> Did anybody noticed this problem before ?
> Is it reported to RDCC ?
>
> TIA and Best regards,
>
>
> J.M. GRATIAS, Logimatique, France
>