Discussion:
Creating a Field
(too old to reply)
Ilidio Pedrosa
2007-10-18 17:05:04 UTC
Permalink
Hi,

I need to create a field in a table. I use this:
alter table table1 add column campo n(10) not null Error: Function is
not supported on remote tables.

How can I resolve this?

Thanks,
Ilidio.
Alan Pengelly
2007-10-19 07:39:00 UTC
Permalink
Function is not supported on remote tables.
How can I resolve this?
Doesn't answer your question properly, but a workaround may be:

select field1, field2, 0000000.00 AS campo ;
from remotetable ;
into tableORcursor newTable ;
etc etc

HTH.

regards
Alan
Stefan Wuebbe
2007-10-19 08:50:54 UTC
Permalink
Post by Ilidio Pedrosa
Hi,
alter table table1 add column campo n(10) not null Error: Function is
not supported on remote tables.
When you want to create a field in a remote table on a Client/Server
backend, you'd need to send your Alter Table command via
SQLExec() (and use the syntax of the backend, i.e. Oracle, MySQL
or whatever you have, as opposed to VFP syntax).


hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Ilidio Pedrosa
2007-10-23 13:59:21 UTC
Permalink
Hi,

This app that I working on create cursors, this is not a SQL table, is a
cursor. Ohters cursors created in the same app I make changes, but in this I
can't. The app as a foxpro dbc and it's possible that this cursor are in
that dbc. It's possible the same error in this case? Can I resolve this?

Thanks,
Ilidio.
Post by Stefan Wuebbe
Post by Ilidio Pedrosa
Hi,
alter table table1 add column campo n(10) not null Error: Function is
not supported on remote tables.
When you want to create a field in a remote table on a Client/Server
backend, you'd need to send your Alter Table command via
SQLExec() (and use the syntax of the backend, i.e. Oracle, MySQL
or whatever you have, as opposed to VFP syntax).
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Anders Altberg
2007-10-23 17:22:28 UTC
Permalink
Cursors are temporary tables, in memory or stored in your Temp directory.
The files are deleted when the cursor is closed or the application ends.
Cursors that represent a remote table cannot have there structure modified.
If you want to add a column to the cursor you have to add it to the query
that creates the cursor:
sqlexec(nconn6,[select CAST(0 as int)as newcol, * from
Humanresources.Employee],"crsEmp")
or send the ALTER TABLE command to the backend with SQLEXEC().

-Anders
Post by Ilidio Pedrosa
Hi,
This app that I working on create cursors, this is not a SQL table, is a
cursor. Ohters cursors created in the same app I make changes, but in this I
can't. The app as a foxpro dbc and it's possible that this cursor are in
that dbc. It's possible the same error in this case? Can I resolve this?
Thanks,
Ilidio.
Post by Stefan Wuebbe
Post by Ilidio Pedrosa
Hi,
alter table table1 add column campo n(10) not null Error: Function
is
Post by Stefan Wuebbe
Post by Ilidio Pedrosa
not supported on remote tables.
When you want to create a field in a remote table on a Client/Server
backend, you'd need to send your Alter Table command via
SQLExec() (and use the syntax of the backend, i.e. Oracle, MySQL
or whatever you have, as opposed to VFP syntax).
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Stefan Wuebbe
2007-10-24 15:40:04 UTC
Permalink
Post by Ilidio Pedrosa
Hi,
This app that I working on create cursors, this is not a SQL table, is a
cursor. Ohters cursors created in the same app I make changes, but in this I
can't. The app as a foxpro dbc and it's possible that this cursor are in
that dbc. It's possible the same error in this case? Can I resolve this?
Hola Ilidio,

In addition to Anders' comment - personally I have never seen the
error you described with actual local cursors - do you use the
"Create Cursor" command to create them?
Do you get error number 1525 or is it 1504?


-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Ilidio Pedrosa
2007-10-25 16:30:44 UTC
Permalink
Hi,

The app is not mine, but I can work in the app with xbase code. In another
cursor I create a field with the same code. In this cursor appear this
error. The error number is 1525

Thanks.
Ilidio
Post by Stefan Wuebbe
Post by Ilidio Pedrosa
Hi,
This app that I working on create cursors, this is not a SQL table, is a
cursor. Ohters cursors created in the same app I make changes, but in
this
Post by Stefan Wuebbe
Post by Ilidio Pedrosa
I
can't. The app as a foxpro dbc and it's possible that this cursor are in
that dbc. It's possible the same error in this case? Can I resolve this?
Hola Ilidio,
In addition to Anders' comment - personally I have never seen the
error you described with actual local cursors - do you use the
"Create Cursor" command to create them?
Do you get error number 1525 or is it 1504?
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Stefan Wuebbe
2007-10-25 17:34:48 UTC
Permalink
Post by Ilidio Pedrosa
Hi,
The app is not mine, but I can work in the app with xbase code. In another
cursor I create a field with the same code. In this cursor appear this
error. The error number is 1525
Then I'd suggest to follow Anders' hint and checkout if the cursor
is something like the result of a SQLExec() statement and made
updatable using CursorSetProp() commands.
And if so, add your desired fields in advance as "calculated columns"
in the server SQL statement that creates the cursor.


hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Olaf Doschke
2007-11-16 22:55:14 UTC
Permalink
Hi Ilidio,
Post by Ilidio Pedrosa
alter table table1 add column campo n(10) not null
Error: Function is not supported on remote tables.
It's a REMOTE table, if you really want to
change that table, change it within that
remote database it's part of.

Seems to me you try to alter a remote view.

You would simply redefine it with
CREATE SQL VIEW..

To get at the view definition you would open it,
eg with

use remoteview

then determine several properties eg
cursorgetprop("SQL", "remoteeview")

modify the sql as you like, then create a new
view based on that modified sql.

Bye, Olaf.

Loading...