views

Danny Lewkin daniel.lewkin at cognosis.be
Mon Aug 6 05:23:50 CDT 2007


Hey Ivan, List,

could you try this :

Create a table tbl_test, with field fld_A, fld_B,...
Then create a view vw_test  "SELECT fld_A, fld_B FROM tbl_test.
Then, try to run this query:
'SELECT * FROM vw_test ORDER BY fld_A'
When I try this, I get an VException :

12:17:15: Error: Identifier "fld_A" is not found.
12:17:15: Error: Kernel error: 0x51500
12:17:15: Error: Identifier "fld_A" is not found.

But when I try this :

'SELECT fld_A, fld_B FROM vw_test ORDER BY fld_A',
then it works fine...
So, why does the first query work on a regular table, but not on a view?
Should I put this into mantis?

Greetz,

Danny




Op 6-aug-07, om 11:32 heeft Ivan Smahin het volgende geschreven:

> Hello Danny,
>
> Monday, August 6, 2007, 12:01:41 PM, you wrote:
>
>> Hey Ruslan,
>
>> am I right when I say that records of a view don't have a RecID?
> Yes, correct.
>
>> I created a view
>
>> CREATE OR REPLACE VIEW vw_project_languages AS
>> SELECT mm_project_languages.RecID,
>> mm_project_languages.project_displayname,
>> tbl_input_languages.language_name
>> FROM tbl_input_languages INNER JOIN mm_project_languages ON
>> mm_project_languages.objptr_language_id = tbl_input_languages.RecID;
>
>> When I query this view like this 'SELECT ** FROM
>> vw_project_languages" then I don't have a RecID-column (except the
>> one I requested for in the view-select-statement), and no OID-column?
>
> I would say that "view" could be considered as "virtual table" as
> first approach only. In deep it is "named query".
> So  you  can not expect to get any extra fields - their are matter of
> "material"  tables  only.  The  only  fields  defined  in the view are
> available to be selected in the outer query.
>
> BTW, why do you need to get view's RecID?
>
>
> -- 
> Best regards,
> Ivan Smahin
> Senior Software Engineer
> Paradigma Software, Inc
> Valentina - The Ultra-Fast Database
> http://www.valentina-db.com
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list