[V4MD] recId, Insert and Cursor question
Ruslan Zasukhin
sunshine at public.kherson.ua
Wed Mar 10 23:26:55 CST 2004
On 3/10/04 10:54 PM, "X Y" <xyzabc1010 at yahoo.com> wrote:
> Hi All,
> I am trying to optimize my query and was wondering if
> this was the correct way to do insertions with object
> ptrs that refer to another table. Lets say I have an
> Employee, Department table where each Employee in the
> Employee table has a department. (deptObjPtr).
> During insert I need to insert the recId of the
> Department into deptObjPtr. The way I do this is to
> thru a query "SELECT recID FROM Department WHERE
> deptName = 'FOO'" and then I do the insertion.
>
> Is there another way I can do an insert with one
> query? instead of 2 (1 being getting the recId, and 2
> being the actual insert)
You should use 2 query for now.
In Valentina 2.0 it will be possible to use subquery
INSERT INTO T (f1, ptr)
VALUES ( 'aaa',
(SELECT recID FROM Department WHERE deptName = 'FOO') )
Although I am not sure this syntax will works.
Ivan?
It seems this is not by standard.
Although looks to be comfortable for above task...
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list