Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update - SQL (Error 1806)
Message
De
24/07/2001 06:56:24
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/07/2001 00:03:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00534232
Message ID:
00534279
Vues:
19
This message has been marked as a message which has helped to the initial question of the thread.
>Hi all,
>
>I get this error when I try to use WITH-ENDWITH in an Update-SQL command.
>
SQL: Column "field | variable" is not found (Error 1806), the field or variable you specified cannot be found.
>
>To reproduce the error:
>
create cursor test (fld1 c(10), fld2 c(10), fld3 i)
>x=createobject('doTest')
>with x
>  .xfld1 = 'Hello'
>  .xfld2 = 'World'
>  .xfld3 = 1
>  *-- work fine
>  insert into test values (.xfld1, .xfld2, .xfld3)
>  browse
>  *-- no problem here
>  m.fld1 = .xfld1
>  m.fld2 = .xfld2
>  m.fld3 = .xfld3
>  update test set fld1 = m.fld1, fld2 = m.fld2, fld3 = m.fld3 where fld3 = 1
>  browse
>  *-- explicitly including the object prefix; still no problem here!
>  update test set fld1 = x.xfld1, fld2 = x.xfld2, fld3 = x.xfld3 where fld3 = 1
>  browse
>  *-- now, using the .property inside the WITH-ENDWITH construct. Error 1806!
>  update test set fld1 = .xfld1, fld2 = .xfld2, fld3 = .xfld3 where fld3 = 1
>  browse
>endwith
>
>define class doTest as session
>  xfld1 = ''
>  xfld2 = ''
>  xfld3 = 0
>enddefine
>
>Does anyone know of this problem? I can't find an entry in the Apr 2001 MSDN DVD using keywords: VFP AND Update AND SQL or Foxpro AND Update AND SQL.

Ramil,
This is a known behaviour of update-sql. It always expects in alias.field notation ( alias.field or just field ). Not a problem of with..endwith because it doesn't expect object ref. x.fld1 works because there it seems it excepts x as alias.

This wouldn't work too :
update myTable set fld = thisform.myText.Value

But this works :
thisform.SomeProperty = 'Hello'
update myTable set fld = thisform.Someproperty

Though thisform is an obj.ref it accepts it as an alias:)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform