OID queries

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Jun 9 03:02:14 CDT 2008


On 6/9/08 10:45 AM, "Bart Pietercil" <bart.pietercil at cognosis.be> wrote:

Hi Bart,

> why does this query not work:
> select ** where OID = 176093659137
> 
> gives unexpected token (wants to see FROM I guess)

Right, should be

SELECT **
FROM T
WHERE OID = 176093659137


> But since an OID is unique in the database and as I understand the
> first part of the ID refers to the table, shouldn't Valentina be able
> to resolve this.

Correction.

VALUE of OID field is unique, right.
    but OID, like any other field, belongs to some table.

 
> I find this rather important since it spares me the addition of adding
> a field to a table that identifies the table the id is coming from.

> Just to make it clear I do not want to use an objectpointer because an
> objectpointer is limited to pointing to a predefined table.

Right, also note that

    sizeof(ObjectPtr) == sizeof(ULONG)  == sizeof(ReCID) == 4

But 
    sizeof(OID) == 8

So to have kind of POINTER ON OID, you need to use in some table ULLONG
field. 


> In the design I need I need to be able to store a pointer to any
> table. Normally I solve this by using 2 fields (ID (long) and
> Tablename(varchar)).
> However this functionality seems to be in the OID but not implement in
> the SQL parser.


I wonder, if you have see this page

<http://www.valentina-db.com/dokuwiki/doku.php?id=paradigma:public:en:docume
ntation:vkernel:vfield:oid&s=oid>

It give example of simple function which allow by OID value found table and
record.

Let me know if this is not enough


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list