dbTalk Databases Forums  

sql :table does not exist or alias is not currently open

comp.databases.paradox comp.databases.paradox


Discuss sql :table does not exist or alias is not currently open in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
marco
 
Posts: n/a

Default sql :table does not exist or alias is not currently open - 04-05-2007 , 08:51 AM






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") then
errorshow()
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

Reply With Quote
  #2  
Old   
Larry DiGiovanni
 
Posts: n/a

Default Re: sql :table does not exist or alias is not currently open - 04-05-2007 , 10:11 AM






marco wrote:

Quote:
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.

--
Larry DiGiovanni




Reply With Quote
  #3  
Old   
marco
 
Posts: n/a

Default Re: sql :table does not exist or alias is not currently open - 04-05-2007 , 10:51 AM





Quote:
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).
neither without tilde.


Quote:
Is this a new XP install of the app that doesn't work?

it's not a new install. It eventually possible that i never used this
form with this PC. My second PC with XP gives the same error. User using
this form much more frequently than me dont complain.

Quote:
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.
here is c:\temp. I'am working with administrative rights (and can alter
the table with paradox (without opal)

thanks

marco




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

Default Re: sql :table does not exist or alias is not currently open - 04-05-2007 , 12:32 PM



marco
<<
If create a new query (not embedded in opal)"alter table "~contratto"
add ttax NUMERIC(10,2)" it runs fine.
Quote:
Which databse is selected in the alias control when you run this? WORK or
PRIV?



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

"marco" <rem_no_s.ppam.marco.foglia (AT) tucsoft (DOT) com> skrev i meddelandet
news:4614fed3_6 (AT) news (DOT) bluewin.ch...
Quote:
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") then
errorshow()
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



Reply With Quote
  #5  
Old   
marco
 
Posts: n/a

Default Re: sql :table does not exist or alias is not currently open - 04-06-2007 , 08:47 AM




Quote:
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...)


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

Default Re: sql :table does not exist or alias is not currently open - 04-06-2007 , 09:32 AM



marco

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

try
sqlHandle.executesql(db)
onfail
errorshow()
endtry

db.close()

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

"marco" <n_sp_hum_marco.foglia (AT) tucsoft (DOT) com> skrev i meddelandet
news:46164f69$1_1 (AT) news (DOT) bluewin.ch...
Quote:
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...)



Reply With Quote
  #7  
Old   
marco
 
Posts: n/a

Default Re: sql :table does not exist or alias is not currently open - 04-09-2007 , 05:04 AM



Bertil Isberg wrote:

Quote:
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


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

Default Re: sql :table does not exist or alias is not currently open - 04-09-2007 , 12:19 PM



marco

<<
BDE 5.2 care only for DDL and does not want alias inside sq endsql.
Quote:
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")

db.close()

If you open the database on PRIV, you should never reference PRIV in the sql
statement

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

"marco" <n_sp_hum_marco.foglia (AT) tucsoft (DOT) com> skrev i meddelandet
news:461a0fa0$1_2 (AT) news (DOT) bluewin.ch...
Quote:
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



Reply With Quote
  #9  
Old   
marco
 
Posts: n/a

Default Re: sql :table does not exist or alias is not currently open - 04-09-2007 , 02:09 PM



Bertil Isberg wrote:
Quote:
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

Quote:
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.






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

Default Re: sql :table does not exist or alias is not currently open - 04-09-2007 , 02:45 PM



marco

<<
db.open("albe") ; and not db.open("PRIV")
....
sq=sql

/*
ALIAS: priv
*/
Quote:
Opening albe and specifying :PRIV: inside the SQL comment should make
Paradox totally confused. The comment was once needed if you wanted to get
the answer table in an in-memory cursor , but then it had to be the same
alias as the opened database-variable.

Specifying a different database in the SQL-comment has never come to my
mind.

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

"marco" <n_sp_hum_marco.foglia (AT) tucsoft (DOT) com> skrev i meddelandet
news:461a8f7f$1_2 (AT) news (DOT) bluewin.ch...
Quote:
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.







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.