Keyword "DEFINE ["DEFINE",<55>,line=1,col=1]" is not implemented yet.

13 posts, 0 answers
  1. Chris
    Chris avatar
    2 posts
    Member since:
    Apr 2008

    Posted 10 Feb 2009 Link to this post

    Hi there

    I'm new to both OA and OQL. Am trying it out for a simple project. Trying a query with the OQL querybrowser I got this error:

    Keyword "DEFINE ["DEFINE",<55>,line=1,col=1]" is not implemented yet.

    This was the OQL

    DEFINE scrap AS
        SELECT * From ScrapbookEntryExtent WHERE _id > 100;
    SELECT * From scrap

    Is the DEFINE statement not available yet?

    Cheers

    C


  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 10 Feb 2009 Link to this post

    Hi Chris,

    I guess that should be

    DEFINE EXTENT scrap FOR ScrapBookEntry;
    SELECT * FROM scrap AS s WHERE s._id > 100
    All the best,
    Thomas
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Chris
    Chris avatar
    2 posts
    Member since:
    Apr 2008

    Posted 10 Feb 2009 Link to this post

    Thanks for reply

    I was just trying to follow the example on pg 495 of the TelerikOpenAccesORM.pdf:

    DEFINE cheapProducts AS
    SELECT *
    FROM ProductExtent AS product
    WHERE product.unitPrice < 1.0;
    SELECT *
    FROM s IN nineties
    WHERE cheapProducts.name LIKE "Bug*"

    This throws a similar error..

    C
  5. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 12 Feb 2009 Link to this post

    Hello Chris,
    Yes you are right, this is a query definition that is not correctly defined in the documentation. It is scheduled for fixing. Thanks for the tip, your Telerik points were updated.

    All the best,
    Dimitar Kapitanov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. James Denning
    James Denning avatar
    24 posts
    Member since:
    Apr 2009

    Posted 25 Feb 2010 Link to this post

    Could you update the docuemntation - I know OQL is going out of fashion but in quite a few instances LINQ just can't do the job (especially dynamically generated queries, dynamic LINQ is not usable either).
    ETA: ANd the origianl response does not make sense - what is the proper syntax for a DEFINE statement?
  7. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 03 Mar 2010 Link to this post

    Hi James Denning,

    Can you please share with us which documentation exactly are you referring? We have revised all the examples in the OQL chapter some months ago and they were all working. Maybe you are looking at an old version of our pdf documentation ?
    The correct syntax for a define statement in OQL would be like this:
    var result = scope.GetOqlQuery("DEFINE EXTENT scrap FOR Employee; SELECT * FROM scrap AS s WHERE s.EmployeeID > 5").Execute();


    Sincerely yours,
    Petar
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. James Denning
    James Denning avatar
    24 posts
    Member since:
    Apr 2009

    Posted 04 Mar 2010 Link to this post

    Hi
    The docuemntation at:
    http://www.telerik.com/help/openaccess-orm/oql-the-define-statement.html

    This is identical to the documentation in the CHM file that comes with the product and the Visual Studio help - the followign statement is totally different from your sample:
    DEFINE cheapProducts AS
      SELECT *
        FROM ProductExtent AS product
          WHERE product.unitPrice < 1.0;
    SELECT *
      FROM s IN nineties
        WHERE cheapProducts.name LIKE "Bug*"

    Your sample seems to simply define a synonym for an Extent or something like that - in fact in your sample is confusing:
    DEFINE EXTENT scrap FOR Employee
    IN this context what ius Employee - a persisted class? Why would I not use EmployeeExtent? And is it possible to actually define a statement e.g "DEFINE EXTENT scrap FOR employee where employee.status = "Retired""

    Regards
    James
  9. James Denning
    James Denning avatar
    24 posts
    Member since:
    Apr 2009

    Posted 10 Mar 2010 Link to this post

    Bump?
  10. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 10 Mar 2010 Link to this post

    Hello James Denning,

    I am sorry for the late response but we were busy with the preparation of the Q1 release.
    The DEFINE EXTENT command is used to define a shorter allies for a fully qualified class name ([namespace].[classname]) for projects where classes with the same name exists in different namespaces. You can see examples of that in all our QSF sampels that are using OQL. Those samples are shipped with the product.

    All the best,
    Petar
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  11. James Denning
    James Denning avatar
    24 posts
    Member since:
    Apr 2009

    Posted 10 Mar 2010 Link to this post

    Ok - thanks, Shall I provide you with a suggested rewrite of the documentation or will the correct documentation be published?

    James
  12. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 15 Mar 2010 Link to this post

    Hello James Denning,

    We are going to release a completely new and restructured documentation. However we have not made any changes in the OQL section of the documentation as we thought it is pretty much completed. That is why we will be happy if we can address any issues you might have found so please share them with us.

    Kind regards,
    Petar
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  13. James Denning
    James Denning avatar
    24 posts
    Member since:
    Apr 2009

    Posted 15 Mar 2010 Link to this post

    The issue is that DEFINE documetnation seems completely wrong - it refers to using DEFINE to write a reuable query but all DEFINE does is create an alias for an extent. The code sample in the documentation or an equivalent rewritten for our own purposes simply does not work.
  14. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 19 Mar 2010 Link to this post

    Hi James Denning,

    We will update the documentation to reflect the information I have provided in this topic. Apart from the Define topic have you found any other inconsistencies that you would like to be changed? We will greatly appreciate any feedback that you might have.

    Regards,
    Petar
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
DevCraft banner