Re: CursorAdapter, MySQL - View definition has been changed.
- From: "Anders Altberg" <anders.altberg>
- Date: Tue, 19 Jun 2007 16:48:24 +0200
CAST ('Static comment' AS Text) AS comment
Perhaps CAST(comment AS Char(254)) As comment
if this wouldn't mean loss of data.
-Anders
"Dan" <dan@xxxxxxxxxx> wrote in message
news:%23wI7oJnsHHA.4880@xxxxxxxxxxxxxxxxxxxxxxx
I have found the code that is causing the problem but I am not sure how to
fix it. Here is what I am doing.
I am doing a union of 2 tables where not all of the fields are common
between the tables. For the fields in the table that aren't common I
select some static text as a field name. For example:
SELECT
Action,
Approval,
Comment ;
FROM
Table1
UNION ALL
SELECT
"N" AS Action,
CAST("Yes" AS CHAR(3)) AS Approval,
"Static Comment" AS Comment ;
FROM
Table2
I can fix the fixed length fields by casting the static text to a fixed
field length but I have a problem with the Comment field. In my FoxPro
database the Comment field is a Memo. In my MySQL database the Comment
field is a TEXT field. I have not found a way to use the CAST function
with the TEXT field nor can I use any padding functions since the TEXT
field could be of variable lenght.
Do you see any other way of fixing this other than adding permanent fields
for the static data from Table1 to Table2?
"Anders Altberg" <anders.altberg> wrote in message
news:uxFiApfsHHA.1416@xxxxxxxxxxxxxxxxxxxxxxx
This can be caused by using TRIM() or NVL() on a field. It causes the
field to change size when the view is requeried, depending on what the
first row of data contains - it determines the size of the column. Use
PADR() or a more specific replacement for nulls so that the column stays
the same width.
-Anders
"Dan" <dan@xxxxxxxxxx> wrote in message
news:ODbZkuesHHA.1164@xxxxxxxxxxxxxxxxxxxxxxx
I have created my first program using CursorAdapters and a native VFP9
database and it works great. I am now trying to convert it to use MySQL.
I keep getting the message "View definition has changed" when refreshing
my CursorAdapters.
I am not sure what is causing this error. Can anybody shed some light
on this error message?
Thanks.
.
- Follow-Ups:
- References:
- Prev by Date: Microsoft Visual FoxPro 9.0 Service Pack 2 and "Sedna" - Beta
- Next by Date: VFP remote views to sequel 2005 tables
- Previous by thread: Re: CursorAdapter, MySQL - View definition has been changed.
- Next by thread: Re: CursorAdapter, MySQL - View definition has been changed.
- Index(es):
Relevant Pages
|