Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with UPDATE QUERY please

Status
Not open for further replies.

foxup

Programmer
Dec 14, 2010
328
CA
UPDATE QSource FROM q1 SET QSource.duration = q1.max_dur WHERE QSource.usoc = 'HOST' AND QSource.groupid = q1.groupid


unrecongnixed command phrase?


Please help
 
Can't see anything wrong with your syntax. Are you sure you pasted it exactly as it was in your code?

Also, I don't recognise that error message. The nearest valid message is "Unrecognized command verb" - which suggest that the first word of the command is wrong ("update" in this example). But that doesn't seem to be the case here.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
yes, positive. and it is verb not phrase, but I don't see the err either??

 
Are you sending that update to a remote data source using SQLExec()?

"Verb" is not a Foxpro concept.
 
VFP does not give a syntax error, at least VFP9.
SQL Server expects FROM after SET, so try

Code:
UPDATE QSource SET QSource.duration = q1.max_dur FROM q1 WHERE QSource.usoc = 'HOST' AND QSource.groupid = q1.groupid

AFAIR this is not working in VFP6 and 7, can't say about 8. Correlated updates (updates of one table with data from another one) came rather late into the vfp sql engine, as simple as it seems.

Bye, Olaf.
 
Hi,

unrecongnized command verb = error(16) - Advise to copy and paste command which causes this error once more and now complete. My 10 dollars this is case of a typo.

Jockey(2)

 
Error 16 can also occur on a multiline sql, if a semikolon is missing. This ends up in interpreting from the line after the missing semikolon to be taken as the begin of a new statement, eg if that occurs in the FROM line you get such an errror.

Bye, Olaf.
 
Hi All,

FYI, this is how I fixed this "freaking' bug:

UPDATE QSource FROM q1 SET QSource.duration = TRANSFORM(q1.max_dur) WHERE QSource.usoc = 'HOST' AND QSource.groupid = q1.groupid


TRANSFORM!! F&*% TRANSFORM!!

I thank you all for your time though! Many thanks to all who tried. Star for all of you!

Thanks,
Foxup!
 
What's the type of Qsource.dration and q1.max_dur?

Even if they differ, that should not lead to "unrecognized command phrase", but a type error.

Nevertheless, if it's a type difference, there's nothing to curse about, but a misleading error.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top