dbTalk Databases Forums  

Query - insertTable

comp.databases.paradox comp.databases.paradox


Discuss Query - insertTable in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Bertil Isberg
 
Posts: n/a

Default Re: Query - insertTable - 08-13-2006 , 01:04 PM






Anthony

As I said in my previous reply:
If you still can't get it to run properly, I would recommend to get rid of
the
underscores in the column names.


--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"MA" <a@a.com> skrev i meddelandet news:44df2a57 (AT) pnews (DOT) thedbcommunity.com...
Quote:
Bertil,

Yes, I did use the alias in the setCriteria as well.

When I do:
si = qVar.insertTable("A0006.DB", ":myAlias:ADA00.DB")
msgInfo("",si)
or

si = qVar.insertTable(":myAlias:A0006.DB", ":myAlias:ADA00.DB")
msgInfo("",si)

the value shown is always zero, which indicates that the table wasn't
inserted. Is it that insertTable only works under certain circumstances ?

Thank you,
Anthony






Reply With Quote
  #12  
Old   
Bertil Isberg
 
Posts: n/a

Default Re: Query - insertTable - 08-13-2006 , 01:37 PM






Anthony

Try with AppendTable instead of insertTable.



--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"MA" <a@a.com> skrev i meddelandet news:44df2a57 (AT) pnews (DOT) thedbcommunity.com...
Quote:
Bertil,

Yes, I did use the alias in the setCriteria as well.

When I do:
si = qVar.insertTable("A0006.DB", ":myAlias:ADA00.DB")
msgInfo("",si)
or

si = qVar.insertTable(":myAlias:A0006.DB", ":myAlias:ADA00.DB")
msgInfo("",si)

the value shown is always zero, which indicates that the table wasn't
inserted. Is it that insertTable only works under certain circumstances ?

Thank you,
Anthony






Reply With Quote
  #13  
Old   
Bertil Isberg
 
Posts: n/a

Default Re: Query - insertTable - 08-13-2006 , 02:44 PM



This is a third reply

After having done some tests with your setup, I have found this:

InsertTable() does work when the QBE file read using readfromfile() only
contains a single table. When the file already contains joined tables, you
can't read it that way and then change it using insertTable(). You have to
use appendtable().


--
Bertil Isberg - CTECH
Paradox buglist:
online: http://hem.bredband.net/bertilisberg/

"MA" <a@a.com> skrev i meddelandet news:44df2a57 (AT) pnews (DOT) thedbcommunity.com...
Quote:
Bertil,

Yes, I did use the alias in the setCriteria as well.

When I do:
si = qVar.insertTable("A0006.DB", ":myAlias:ADA00.DB")
msgInfo("",si)
or

si = qVar.insertTable(":myAlias:A0006.DB", ":myAlias:ADA00.DB")
msgInfo("",si)

the value shown is always zero, which indicates that the table wasn't
inserted. Is it that insertTable only works under certain circumstances ?

Thank you,
Anthony






Reply With Quote
  #14  
Old   
MA
 
Posts: n/a

Default Re: Query - insertTable - 08-13-2006 , 08:18 PM



Bertil,
<<
InsertTable() does work when the QBE file read using readfromfile() only
contains a single table. When the file already contains joined tables, you
can't read it that way and then change it using insertTable().
Quote:
That was what I just happened to prove myself, anyway I did manage
to do it as detailed in my 5th post.

Many thanks to you,
Anthony




Reply With Quote
  #15  
Old   
Bertil Isberg
 
Posts: n/a

Default Re: Query - insertTable - 08-14-2006 , 01:53 AM



Anthony

The code with appendTable() is ver similar to your original code


qvar.readfromfile("ADA00.qbe")

qVar.setCriteria("ADA00.DB", "NM_ADA00", "_JoinX")
qVar.appendTable("A0006.DB")
qVar.setCriteria("A0006.DB", "NM_Pointer", "_JoinX")
qVar.setCriteria("A0006.DB", "atDate", "Today")

A lot easier than the code you showed in your workaround.


--
Bertil Isberg
CTECH
Paradox Buglist: http://hem.bredband.net/bertilisberg/

remove spamfilter (reversed) to reply

Reply With Quote
  #16  
Old   
MA
 
Posts: n/a

Default Re: Query - insertTable - 08-14-2006 , 10:04 PM



Bertil,

I would like to get A0006.db as the first (master) of any saved
query at anytime since it would only have about 10 recs or so
& thus the query would be much faster.

I don't think appendTable() would put the table above the first
table in the query.

Thank you,
Anthony



Reply With Quote
  #17  
Old   
Tony McGuire
 
Posts: n/a

Default Re: Query - insertTable - 08-15-2006 , 12:47 AM




Open the saved query.

Create the text of the added table/query; stored in a string variable.

Open a textstream on a new .qbe file.

Write the new text you created.

Add the saved query string.

Close the textstream.

You then have the whole thing.

And just so you know, you don't need every field in the table referenced in
the .qbe file. Only those fields you are going to set criteria for or link.


Not as elegant as using query function to set it up. But it doesn't take
weeks wrangling around with, either.


---------------------------------------------------------
Tony McGuire



Reply With Quote
  #18  
Old   
Bertil Isberg
 
Posts: n/a

Default Re: Query - insertTable - 08-15-2006 , 02:41 AM



Anthony
<<
I would like to get A0006.db as the first (master) of any saved
query at anytime since it would only have about 10 recs or so
& thus the query would be much faster.
Quote:
I ran a test. Table 1 has 55 000 rows, table 16. When table A is first,
it takes 1750 ms, when table B is first it takes 1850 ms. Table A is
keyed and has a secondary index on the join column. Table B is unkeyed.

When changing Table A to a 95 000 rows table, where the join column is
the primary key, the query takes 30 ms, no matter which table is the first.

In both cases two rows are returned.

I cannot verify your statement.


--
Bertil Isberg
CTECH
Paradox Buglist: http://hem.bredband.net/bertilisberg/

remove spamfilter (reversed) to reply


Reply With Quote
  #19  
Old   
MA
 
Posts: n/a

Default Re: Query - insertTable - 08-15-2006 , 06:54 PM



Tony - thanks for the input about textStreams, very powerfull.

Bertil - thank you too for your time, I now have things under control.

Regards to you all,
Anthony



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.