Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Esmeralda Matos
  Where is Esmeralda Matos?
 Santo Domingo
 Dominican Republic
 Esmeralda Matos
 Tags
Subject: RE: Update Table From a sql view
Thread ID: 189426 Message ID: 189430 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, August 14, 2008 11:02:56 PM         
   


> Hi everybody!!!. It's been a while.
> I'm having problems updating a table from a sql view at runtime, I'll explain myself.
> I have this table called renotas where I have student's grades, what I want is to calculate some grades and then update the table, the table is really big and the process is kind of slow, so that's why I thought on using a sql view, and the calculation is really fast. This is the code
>
> SET SAFETY OFF
> CREATE SQL VIEW xvrenotas as select * from Xtudia!renotas
> USE xvrenotas
> DBSETPROP('xvrenotas.id_reg','Field','KeyField',.T.)
> DBSETPROP('xvrenotas.id_reg','Field','UpdateName','renotas.id_reg')
> DBSETPROP('xvrenotas','View','SendUpdates',.T.)
> index on ALLTRIM(calumano)+ALLTRIM(ccodfam)+ALLTRIM(calumsec);
> +ALLTRIM(cperiodo)+ALLTRIM(csemestre)+ALLTRIM(ccodcurso)+;
> ALLTRIM(casignaid)+ALLTRIM(ccodeval) tag xregistro ascending
> SET SAFETY ON
>
> My problem is when I use the command tableupdate(). I see that in my view everything's ok, but the update is not accomplished, here's the code
>
> select xvrenotas
>
> ok = tableupdate(.t., .t.)
> if ok
> =requery()
> WAIT WINDOW "Proceso concluido exitosamente!" TIMEOUT 1
> WAIT CLEAR
> endif
> DELETE VIEW xvrenotas
>
>
> That's all guys. I hope you can help me on this. Bye

Your dbsetprop() series is incomplete. Create your view in designer and get the code using home()+'tools\gendbc\gendbc' to see what is missing.

Cetin Basoz

ENTIRE THREAD

Update Table From a sql view Posted by Esmeralda Matos @ 8/14/2008 10:20:43 PM
RE: Update Table From a sql view Posted by Cetin Basoz @ 8/14/2008 11:02:56 PM
RE: Update Table From a sql view Posted by Anders Altberg @ 8/15/2008 12:20:34 AM
RE: Update Table From a sql view Posted by Andy Kramek @ 8/15/2008 11:43:58 AM
RE: Update Table From a sql view Posted by Esmeralda Matos @ 8/15/2008 3:20:33 PM