This is a migrated thread and some comments may be shown as answers.

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

12 Answers 63 Views
OQL (OQL specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 10 Feb 2009, 02:48 PM
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


12 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 10 Feb 2009, 04:30 PM
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.
0
Chris
Top achievements
Rank 1
answered on 10 Feb 2009, 04:36 PM
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
0
Dimitar Kapitanov
Telerik team
answered on 12 Feb 2009, 01:21 PM
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.
0
James Denning
Top achievements
Rank 1
answered on 25 Feb 2010, 07:12 PM
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?
0
PetarP
Telerik team
answered on 03 Mar 2010, 07:22 PM
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.
0
James Denning
Top achievements
Rank 1
answered on 04 Mar 2010, 10:17 AM
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
0
James Denning
Top achievements
Rank 1
answered on 10 Mar 2010, 10:58 AM
Bump?
0
PetarP
Telerik team
answered on 10 Mar 2010, 07:00 PM
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.
0
James Denning
Top achievements
Rank 1
answered on 10 Mar 2010, 07:08 PM
Ok - thanks, Shall I provide you with a suggested rewrite of the documentation or will the correct documentation be published?

James
0
PetarP
Telerik team
answered on 15 Mar 2010, 05:37 PM
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.
0
James Denning
Top achievements
Rank 1
answered on 15 Mar 2010, 05:50 PM
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.
0
PetarP
Telerik team
answered on 19 Mar 2010, 03:20 PM
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.
Tags
OQL (OQL specific questions)
Asked by
Chris
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Chris
Top achievements
Rank 1
Dimitar Kapitanov
Telerik team
James Denning
Top achievements
Rank 1
PetarP
Telerik team
Share this question
or