![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Group, If I'm creating a new View in Pervasive SQL Control Centre (v8.6) I enter my new view as (for example) SELECT OracleCount.Id, OracleCount.ProductId, Products.Description, AgreementToSupply.Description, Units.Name FROM OracleCount,AgreementToSupply ,Products ,Units WHERE OracleCount.ProductId = Products.Id AND OracleCount.ProductId = AgreementToSupply.ProductId AND OracleCount.BranchId = AgreementToSupply.UnitId AND Units.UnitId = OracleCount.BranchId Which is hopefully quite clear and easy to read. Pervasive 'helpfully' converts this into: SELECT "T1" ."Id" ,"T1" ."ProductId" ,"T3" ."Description" ,"T2" ."Description" ,"T4" ."Name" FROM "OracleCount" "T1" ,"AgreementToSupply" "T2" ,"Products" "T3" ,"Units" "T4" WHERE "T1" ."ProductId" = "T3" ."Id" AND "T1" ."ProductId" = "T2" ."ProductId" AND "T1" ."BranchId" = "T2" ."UnitId" AND "T4" ."UnitId" = "T1" ."BranchId" Which is logically the same, but a bleedin' nightmare to follow. Anyone know if there is a way to keep my version and stop Pervasive from changing it (If I promise not to put spaces in my table/field names...) Yours frustratedly, ChrisM. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. |
#3
| |||
| |||
|
|
What you are looking at is the internal representation of the VIEW.DDF structure. To keep your original query, simply keep your original query -- i.e. the keep the SQL query in a text file. Goldstar Software Inc. Building on Btrieve(R) for the Future(SM) Bill Bach BillBach (AT) goldstarsoftware (DOT) com http://www.goldstarsoftware.com *** Pervasive.SQL Service & Support Classes *** Chicago: August, 2004: See our web site for details! ChrisM wrote: Hi Group, If I'm creating a new View in Pervasive SQL Control Centre (v8.6) I enter my new view as (for example) SELECT OracleCount.Id, OracleCount.ProductId, Products.Description, AgreementToSupply.Description, Units.Name FROM OracleCount,AgreementToSupply ,Products ,Units WHERE OracleCount.ProductId = Products.Id AND OracleCount.ProductId = AgreementToSupply.ProductId AND OracleCount.BranchId = AgreementToSupply.UnitId AND Units.UnitId = OracleCount.BranchId Which is hopefully quite clear and easy to read. Pervasive 'helpfully' converts this into: SELECT "T1" ."Id" ,"T1" ."ProductId" ,"T3" ."Description" ,"T2" ."Description" ,"T4" ."Name" FROM "OracleCount" "T1" ,"AgreementToSupply" "T2" ,"Products" "T3" ,"Units" "T4" WHERE "T1" ."ProductId" = "T3" ."Id" AND "T1" ."ProductId" = "T2" ."ProductId" AND "T1" ."BranchId" = "T2" ."UnitId" AND "T4" ."UnitId" = "T1" ."BranchId" Which is logically the same, but a bleedin' nightmare to follow. Anyone know if there is a way to keep my version and stop Pervasive from changing it (If I promise not to put spaces in my table/field names...) Yours frustratedly, ChrisM. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. |
#4
| |||
| |||
|
|
Hi Bill, Thanks for your reply. So you're saying that I should save a text file for each View that I create (separate from the SQL that Pervasive saves internally). Then if I want to change my view, I load my SQL file up and re-run it, hmmm OK, if that's the way it works then fair enough I guess... btw, if I forget to save the SQL file before I click OK to create the view (and hence lose my formatting) Then 'tough'. If I want my formatted query I have to re-construct it...? Kind regards, Chris. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. "Bill Bach" <bbach (AT) cncdsl (DOT) com> wrote in message news:41389814.67DD5DFC (AT) cncdsl (DOT) com... What you are looking at is the internal representation of the VIEW.DDF structure. To keep your original query, simply keep your original query -- i.e. the keep the SQL query in a text file. Goldstar Software Inc. Building on Btrieve(R) for the Future(SM) Bill Bach BillBach (AT) goldstarsoftware (DOT) com http://www.goldstarsoftware.com *** Pervasive.SQL Service & Support Classes *** Chicago: August, 2004: See our web site for details! ChrisM wrote: Hi Group, If I'm creating a new View in Pervasive SQL Control Centre (v8.6) I enter my new view as (for example) SELECT OracleCount.Id, OracleCount.ProductId, Products.Description, AgreementToSupply.Description, Units.Name FROM OracleCount,AgreementToSupply ,Products ,Units WHERE OracleCount.ProductId = Products.Id AND OracleCount.ProductId = AgreementToSupply.ProductId AND OracleCount.BranchId = AgreementToSupply.UnitId AND Units.UnitId = OracleCount.BranchId Which is hopefully quite clear and easy to read. Pervasive 'helpfully' converts this into: SELECT "T1" ."Id" ,"T1" ."ProductId" ,"T3" ."Description" ,"T2" ."Description" ,"T4" ."Name" FROM "OracleCount" "T1" ,"AgreementToSupply" "T2" ,"Products" "T3" ,"Units" "T4" WHERE "T1" ."ProductId" = "T3" ."Id" AND "T1" ."ProductId" = "T2" ."ProductId" AND "T1" ."BranchId" = "T2" ."UnitId" AND "T4" ."UnitId" = "T1" ."BranchId" Which is logically the same, but a bleedin' nightmare to follow. Anyone know if there is a way to keep my version and stop Pervasive from changing it (If I promise not to put spaces in my table/field names...) Yours frustratedly, ChrisM. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. |
#5
| |||
| |||
|
|
That would be correct. Yet another reason to NOT use the user interface for building things like queries, tables, users, etc. While the UI is nice for the uninitiated, having a SQL script is the only way to go for real administrators. Of course, this also allows you to add extensive comments to the files as well, further improving readability. Goldstar Software Inc. Building on Btrieve(R) for the Future(SM) Bill Bach BillBach (AT) goldstarsoftware (DOT) com http://www.goldstarsoftware.com *** Pervasive.SQL Service & Support Classes *** Chicago: August, 2004: See our web site for details! ChrisM wrote: Hi Bill, Thanks for your reply. So you're saying that I should save a text file for each View that I create (separate from the SQL that Pervasive saves internally). Then if I want to change my view, I load my SQL file up and re-run it, hmmm OK, if that's the way it works then fair enough I guess... btw, if I forget to save the SQL file before I click OK to create the view (and hence lose my formatting) Then 'tough'. If I want my formatted query I have to re-construct it...? Kind regards, Chris. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. "Bill Bach" <bbach (AT) cncdsl (DOT) com> wrote in message news:41389814.67DD5DFC (AT) cncdsl (DOT) com... What you are looking at is the internal representation of the VIEW.DDF structure. To keep your original query, simply keep your original query -- i.e. the keep the SQL query in a text file. Goldstar Software Inc. Building on Btrieve(R) for the Future(SM) Bill Bach BillBach (AT) goldstarsoftware (DOT) com http://www.goldstarsoftware.com *** Pervasive.SQL Service & Support Classes *** Chicago: August, 2004: See our web site for details! ChrisM wrote: Hi Group, If I'm creating a new View in Pervasive SQL Control Centre (v8.6) I enter my new view as (for example) SELECT OracleCount.Id, OracleCount.ProductId, Products.Description, AgreementToSupply.Description, Units.Name FROM OracleCount,AgreementToSupply ,Products ,Units WHERE OracleCount.ProductId = Products.Id AND OracleCount.ProductId = AgreementToSupply.ProductId AND OracleCount.BranchId = AgreementToSupply.UnitId AND Units.UnitId = OracleCount.BranchId Which is hopefully quite clear and easy to read. Pervasive 'helpfully' converts this into: SELECT "T1" ."Id" ,"T1" ."ProductId" ,"T3" ."Description" ,"T2" ."Description" ,"T4" ."Name" FROM "OracleCount" "T1" ,"AgreementToSupply" "T2" ,"Products" "T3" ,"Units" "T4" WHERE "T1" ."ProductId" = "T3" ."Id" AND "T1" ."ProductId" = "T2" ."ProductId" AND "T1" ."BranchId" = "T2" ."UnitId" AND "T4" ."UnitId" = "T1" ."BranchId" Which is logically the same, but a bleedin' nightmare to follow. Anyone know if there is a way to keep my version and stop Pervasive from changing it (If I promise not to put spaces in my table/field names...) Yours frustratedly, ChrisM. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. |
#6
| |||
| |||
|
|
Bill, Sorry if this is a dumb question When you say you don't recommend using the UI, what exactly should I use? Is there a command prompt type interface somewhere? Or should I just use the 'SQL Data Manager' screen and load/run various SQL scripts to acomplish my tasks... Thanks, Chris. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. "Bill Bach" <bbach (AT) cncdsl (DOT) com> wrote in message news:413DA32D.DE457057 (AT) cncdsl (DOT) com... That would be correct. Yet another reason to NOT use the user interface for building things like queries, tables, users, etc. While the UI is nice for the uninitiated, having a SQL script is the only way to go for real administrators. Of course, this also allows you to add extensive comments to the files as well, further improving readability. Goldstar Software Inc. Building on Btrieve(R) for the Future(SM) Bill Bach BillBach (AT) goldstarsoftware (DOT) com http://www.goldstarsoftware.com *** Pervasive.SQL Service & Support Classes *** Chicago: August, 2004: See our web site for details! ChrisM wrote: Hi Bill, Thanks for your reply. So you're saying that I should save a text file for each View that I create (separate from the SQL that Pervasive saves internally). Then if I want to change my view, I load my SQL file up and re-run it, hmmm OK, if that's the way it works then fair enough I guess... btw, if I forget to save the SQL file before I click OK to create the view (and hence lose my formatting) Then 'tough'. If I want my formatted query I have to re-construct it...? Kind regards, Chris. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. "Bill Bach" <bbach (AT) cncdsl (DOT) com> wrote in message news:41389814.67DD5DFC (AT) cncdsl (DOT) com... What you are looking at is the internal representation of the VIEW.DDF structure. To keep your original query, simply keep your original query -- i.e. the keep the SQL query in a text file. Goldstar Software Inc. Building on Btrieve(R) for the Future(SM) Bill Bach BillBach (AT) goldstarsoftware (DOT) com http://www.goldstarsoftware.com *** Pervasive.SQL Service & Support Classes *** Chicago: August, 2004: See our web site for details! ChrisM wrote: Hi Group, If I'm creating a new View in Pervasive SQL Control Centre (v8.6) I enter my new view as (for example) SELECT OracleCount.Id, OracleCount.ProductId, Products.Description, AgreementToSupply.Description, Units.Name FROM OracleCount,AgreementToSupply ,Products ,Units WHERE OracleCount.ProductId = Products.Id AND OracleCount.ProductId = AgreementToSupply.ProductId AND OracleCount.BranchId = AgreementToSupply.UnitId AND Units.UnitId = OracleCount.BranchId Which is hopefully quite clear and easy to read. Pervasive 'helpfully' converts this into: SELECT "T1" ."Id" ,"T1" ."ProductId" ,"T3" ."Description" ,"T2" ."Description" ,"T4" ."Name" FROM "OracleCount" "T1" ,"AgreementToSupply" "T2" ,"Products" "T3" ,"Units" "T4" WHERE "T1" ."ProductId" = "T3" ."Id" AND "T1" ."ProductId" = "T2" ."ProductId" AND "T1" ."BranchId" = "T2" ."UnitId" AND "T4" ."UnitId" = "T1" ."BranchId" Which is logically the same, but a bleedin' nightmare to follow. Anyone know if there is a way to keep my version and stop Pervasive from changing it (If I promise not to put spaces in my table/field names...) Yours frustratedly, ChrisM. -- Please remove shoes to reply But what ... is it good for? - Engineer at the Advanced Computing Systems Division of IBM, 1968, commenting on the microchip. |
#7
| |||
| |||
|
|
The latter -- load your scripts into the SQLDM window & run them there. BB |
![]() |
| Thread Tools | |
| Display Modes | |
| |