![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
pdx7.0.5.57 (compatibility NT4 SP5), bde 5.2.0.2, wXP. This code ran for some years (maybe with w2000): |
#3
| |||
| |||
|
|
pdx7.0.5.57 (compatibility NT4 SP5), bde 5.2.0.2, wXP. This code ran for some years (maybe with w2000): But for this comment, that it had run once, I would've said your problem was with your use of a tilde in the table name (~contratto). |
|
Is this a new XP install of the app that doesn't work? |
|
Perhaps it is a folder permissions thing, or a path to the PRIV too long issue. Change the priv on that machine to something like C:\PDX\PDOXPRIV and try it again. |
#4
| |||
| |||
|
|
pdx7.0.5.57 (compatibility NT4 SP5), bde 5.2.0.2, wXP. This code ran for some years (maybe with w2000): ... if not sq.executeSQL(db," riv:~contratto.db") thenerrorshow() endif sq=sql /* ALIAS: priv */ alter table "~contratto" add ttax NUMERIC(10,2) endsql if not sq.executeSQL(db) then errorshow() endif ---------------------------------------------- now ran once and then gave "An error was trig...table does not exist" (but it does exists). Changing the query to alter table " riv:~contratto" add ttax NUMERIC(10,2)it comes:"..alias is not currently open". If create a new query (not embedded in opal)"alter table "~contratto" add ttax NUMERIC(10,2)" it runs fine. thank you for your suggestions marco |
#5
| |||
| |||
|
|
If create a new query (not embedded in opal)"alter table "~contratto" add ttax NUMERIC(10,2)" it runs fine. Which databse is selected in the alias control when you run this? WORK or PRIV? |
#6
| |||
| |||
|
|
If create a new query (not embedded in opal)"alter table "~contratto" add ttax NUMERIC(10,2)" it runs fine. Which databse is selected in the alias control when you run this? WORK or PRIV? PRIV (from the menu SQL/select alias...) |
#7
| |||
| |||
|
|
This code works for me. P11 build 410. BDE 5.2 var db database sqlhandle sql endvar db.open(":PRIV:") sqlHandle=Sql alter table "~contratto" add ttax NUMERIC(10,2) Endsql ... |
riv:~contratto"
riv:bof.db")
#8
| |||
| |||
|
riv:answer.db")|
Bertil Isberg wrote: This code works for me. P11 build 410. BDE 5.2 var db database sqlhandle sql endvar db.open(":PRIV:") sqlHandle=Sql alter table "~contratto" add ttax NUMERIC(10,2) Endsql ... For me too, with pdx7 + bde 5.2 (and WXP). The other code, with alias defined inside "sql endsql", continues to work with pdx,w2000, bde 5.1. This code works with bde 5.2 and 5.1: db.open("another_alias") sq=sql select * from " riv:~contratto"endsql sq.executeSQL(db," riv:bof.db")My conclusion would be that BDE 5.1 handle alias differently than 5.2 for DDL (Data Definition Language). BDE 5.1 does not care at all what DB is open (for DB tables). BDE 5.2 care only for DDL and does not want alias inside sq endsql. thank you marco |
#9
| |||
| |||
|
|
marco BDE 5.2 care only for DDL and does not want alias inside sq endsql. This code works for me using P11 build 410 and Bde 5.2 and it contradicts your statement var db database sqlhandle sql endvar db.open(":WORK:") sqlhandle=sql SELECT DISTINCT ":Sample:customer.db"."Customer No", Name FROM ":Sample:customer.db" ORDER BY ":Sample:customer.db"."Customer No", Name endsql sqlhandle.executeSQL(db," riv:answer.db") |
|
If you open the database on PRIV, you should never reference PRIV in the sql statement |
#10
| |||
| |||
|
|
Bertil Isberg wrote: marco BDE 5.2 care only for DDL and does not want alias inside sq endsql. This code works for me using P11 build 410 and Bde 5.2 and it contradicts your statement var db database sqlhandle sql endvar db.open(":WORK:") sqlhandle=sql SELECT DISTINCT ":Sample:customer.db"."Customer No", Name FROM ":Sample:customer.db" ORDER BY ":Sample:customer.db"."Customer No", Name endsql sqlhandle.executeSQL(db," riv:answer.db")but this SQL code is not DDL, it is DML If you open the database on PRIV, you should never reference PRIV in the sql statement my original code (not working with pdx7 bde5.2)was ------------------------------------------------- db.open("albe") ; and not db.open("PRIV") ... sq=sql /* ALIAS: priv */ alter table "~contratto" add ttax NUMERIC(10,2) ---------------------------------------------------- but using SELECT ((DML)) instead of ALTER ((DDL))works fine also with db.open("PRIV")...SELECT * FROM ":PRIV I always wandered why pdx 7 asks to open a DB if then it does not care which one it is. My conclusion was that it was for using other database like interbase. |
![]() |
| Thread Tools | |
| Display Modes | |
| |