Discussion:
Open CDS without queires executing
(too old to reply)
Preston
2008-02-07 14:45:48 UTC
Permalink
I have a master CDS with several detail cds.

In order to create a new master and detail I set the sql to select some non existent value and then open the cds. This of course executes the query against the database and returns an empty result set.

What I’d like to do is open the cds without the queries firing. The form that’s using this is for insert only, so it’s just a waste of time to execute the query just to get an empty result set.
Marc Rohloff [TeamB]
2008-02-07 16:24:07 UTC
Permalink
Post by Preston
What I’d like to do is open the cds without the queries firing. The
form that’s using this is for insert only, so it’s just a waste of
time to execute the query just to get an empty result set.
Have you tried the CreateDataSet method?
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
Preston
2008-02-07 15:42:46 UTC
Permalink
Post by Marc Rohloff [TeamB]
Have you tried the CreateDataSet method?
Hi Marc,

I haven't yet. Have you done this before? I've used createDataSet but I've always used it when I'm not persisting anything.

I'll run through it an let everyone know.

Preston
Preston
2008-02-08 21:38:44 UTC
Permalink
Post by Marc Rohloff [TeamB]
Have you tried the CreateDataSet method?
Ok, I tried the CreateDataSet method. It does work... kinda. When you specify a Master Detail relationship using queries you do something like

select * where id = :masterid

This association seems to get lost, which makes sense since it's contained at the query level which we're not using anymore (CreateDataSet)

I think I need to set it up somehow on the cds itself. Any ideas?
Bill Todd [TeamB]
2008-02-08 21:47:32 UTC
Permalink
Post by Preston
I think I need to set it up somehow on the cds itself. Any ideas?
The MasterSource and MasterFields properties.
--
Bill Todd (TeamB)
Preston
2008-02-09 00:02:54 UTC
Permalink
Post by Bill Todd [TeamB]
Post by Preston
I think I need to set it up somehow on the cds itself. Any ideas?
The MasterSource and MasterFields properties.
--
Bill Todd (TeamB)
Trying to set those will not work with a nested dataset.
Bill Todd [TeamB]
2008-02-09 00:40:17 UTC
Permalink
Post by Preston
Trying to set those will not work with a nested dataset.
Are you saying that you are trying to create a nested dataset without
being connected to a DSP? It may be possible but why? If you are
working with a database just use a SQL statement that returns no
records. What you are trying to do will be a lot of work with no
benefit (which is probably why no one else has done it.<g>).
--
Bill Todd (TeamB)
Marc Rohloff [TeamB]
2008-02-09 04:06:29 UTC
Permalink
Post by Bill Todd [TeamB]
Are you saying that you are trying to create a nested dataset without
being connected to a DSP? It may be possible but why? If you are
working with a database just use a SQL statement that returns no
records. What you are trying to do will be a lot of work with no
benefit (which is probably why no one else has done it.<g>).
Why execute a SQL statement? It shouldn't be necessary to hit the
database to create an empty dataset.
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
Bill Todd [TeamB]
2008-02-09 13:32:09 UTC
Permalink
Post by Marc Rohloff [TeamB]
Why execute a SQL statement? It shouldn't be necessary to hit the
database to create an empty dataset.
How?
--
Bill Todd (TeamB)
Marc Rohloff [TeamB]
2008-02-09 19:58:05 UTC
Permalink
Post by Marc Rohloff [TeamB]
Why execute a SQL statement? It shouldn't be necessary to hit the
database to create an empty dataset.
How?
I didn't say that I knew how, I just said it shouldn't be necessary :)
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
Preston
2008-02-11 13:34:22 UTC
Permalink
Post by Marc Rohloff [TeamB]
Why execute a SQL statement? It shouldn't be necessary to hit the
database to create an empty dataset.
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
I think Marc has summed up my position quite nicely. Even if everything is indexed, it takes time to run the 5 - 6 queries. That time seems rather unnecessary.
vavan
2008-02-11 07:24:40 UTC
Permalink
What I?d like to do is open the cds without the queries firing. The form that?s using this is for insert only, so it?s just a waste of time to execute the query just to get an empty result set.
see for example
http://groups.google.com/group/borland.public.delphi.database.multi-tier/msg/84d33c65c71a32ff
--
Vladimir Ulchenko aka vavan
Preston
2008-02-11 14:17:52 UTC
Permalink
Post by vavan
see for example
http://groups.google.com/group/borland.public.delphi.database.multi-tier/msg/84d33c65c71a32ff
--
Vladimir Ulchenko aka vavan
Hi Vladimir

What's the FBN in
(cdsMaster->FBN("NestedDatasetNameOnASSide"));
Preston
2008-02-11 14:21:28 UTC
Permalink
Post by Preston
Hi Vladimir
What's the FBN in
(cdsMaster->FBN("NestedDatasetNameOnASSide"));
I got it as soon as I posted it it ;)

FieldByName

Loading...