Home > Archive > Getting Started with dBASE > October 2006 > SQL Update mystery ...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SQL Update mystery ...
John Marshall

2006-10-25, 7:23 am

I have had a perplexing issue recently in 'building' SQL statements. In this case used them to build SQL update. I have these working elsewhere in the code sucessfully in several program areas, but recently I cannot seem to get one to go (below). I kee
p getting a "token" not found error. Any thoughts?


SQLEdit = "Descr = '" + rtrim(form.entryfield2.value) + "', srt = " + form.entryfield3.value ;
+ ", strt = '" + form.entryfield4.value + "', stp = '" + form.entryfield5.value + "' " ;
+ "WHERE MPCode = '" + form.entryfield1.value + "'"

UPDATE :PRTIP:MP SET &SQLEdit

Thanks,

JM
Todd Kreuter [dBVIPS]

2006-10-25, 7:23 am

"John Marshall" <john. marshall@mainstreetp
rinceton.com> wrote in message
news:Dt2yUFo3GHA.1820@news-server...
> I have had a perplexing issue recently in 'building' SQL statements. In

this case used them to build SQL update. I have these working elsewhere in
the code sucessfully in several program areas, but recently I cannot seem to
get one to go (below). I keep getting a "token" not found error. Any
thoughts?
> UPDATE :PRTIP:MP SET &SQLEdit


Try ? sqlEdit and see if it look right.

Todd Kreuter [dBVIPS]


Roland Wingerter

2006-10-25, 7:23 am

John Marshall wrote

> I have had a perplexing issue recently in 'building' SQL statements. In
> this case used them to build SQL update. I have these working elsewhere
> in the code sucessfully in several program areas, but recently I cannot
> seem to get one to go (below). I keep getting a "token" not found error.
> Any thoughts?
>
>
> SQLEdit = "Descr = '" + rtrim(form.entryfield2.value) + "', srt = " +
> form.entryfield3.value ;
> + ", strt = '" + form.entryfield4.value + "', stp = '" +
> form.entryfield5.value + "' " ;
> + "WHERE MPCode = '" + form.entryfield1.value + "'"
>
> UPDATE :PRTIP:MP SET &SQLEdit

-------
Perhaps a null value in one of the entryfields?

Roland


john marshall

2006-10-25, 7:23 am

Todd:

It does look right ... in fact if I literally take its results and place it into the sql statement, it works just fine. Funny thing is that I have used this type of method many times over without any issues!.

JM


Todd Kreuter [dBVIPS] Wrote:

> "John Marshall" <john. marshall@mainstreetp
rinceton.com> wrote in message
> news:Dt2yUFo3GHA.1820@news-server...
> this case used them to build SQL update. I have these working elsewhere in
> the code sucessfully in several program areas, but recently I cannot seem to
> get one to go (below). I keep getting a "token" not found error. Any
> thoughts?
>
> Try ? sqlEdit and see if it look right.
>
> Todd Kreuter [dBVIPS]
>
>


john marshall

2006-10-25, 7:23 am

Todd / Roland:

I just got it to work ... you'll never guess what it was. I had defined the SQLEdit and SQLUpdate variables as "Local". As soon as I got rid of the definition, everything worked as it should! Any reason for this behavior?

john marshall Wrote:

> Todd:
>
> It does look right ... in fact if I literally take its results and place it into the sql statement, it works just fine. Funny thing is that I have used this type of method many times over without any issues!.
>
> JM
>
>
> Todd Kreuter [dBVIPS] Wrote:
>
>


Roland Wingerter

2006-10-25, 7:23 am

john marshall wrote

>
> I just got it to work ... you'll never guess what it was. I had defined
> the SQLEdit and SQLUpdate variables as "Local". As soon as I got rid of
> the definition, everything worked as it should! Any reason for this
> behavior?

------
Glad you solved it.

A local variable cannot be used in a macro substitution, only private (or
public) variables. If a variable is not declared it is a private variable by
default.

Roland



Todd Kreuter [dBVIPS]

2006-10-25, 7:23 am

"john marshall" <john. marshall@mainstreetp
rinceton.com> wrote in message
news:3c1ATpw3GHA.1156@news-server...
>
> I just got it to work ... you'll never guess what it was. I had

defined the SQLEdit and SQLUpdate variables as "Local". As soon as I got
rid of the definition, everything worked as it should! Any reason for this
behavior?

Glad you caught that. Kind of an odd ball error message for that ....

Todd Kreuter [dBVIPS]


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com