cgosbee
Posts: 23
|
| Posted: 10/15/2007, 11:16 AM |
|
I have an update query that the automatic generation does just about perfectly. What I want to do is turn this:
UPDATE my_table
SET
fld1 = autogen1,
fld2 = autogen2,
fld3 = autogen3
Into this:
UPDATE my_table
SET
fld1 = autogen1,
fld2 = autogen2,
fld3 = autogen3,
fld4 = GetUTCDate()
I have tried what I thought would work (so many different things now that I can't remember which does what). The closest I got was this:
UPDATE my_table
SET
fld1 = autogen1,
fld2 = autogen2,
fld3 = autogen3,
fld4 = 'GetUTCDate()'
but that attempts to insert a string, resulting in a syntax error. I really just need the literal 'GetUTCDate()' populated to the update query string before it is submitted to the database. I have been using Custom Updates to accomplish this, since I thought that would be the easiest way to go, but maybe I need to replace the entire query another way?
I would certainly appreciate some advice. I am using PHP if that matters to the solution.
|
 |
 |
cgosbee
Posts: 23
|
| Posted: 10/15/2007, 11:23 AM |
|
Scrap that... I had tried it so many times on INSERT I assumed that it would fail on UPDATE just the same. Just switched to SQL mode and added the relevant string directly into the pre-generated SQL, and that worked like a charm.
Sorry for posting something I was going to figure out so quickly.
|
 |
 |
wkempees
|
| Posted: 10/15/2007, 2:57 PM |
|
well done!
"cgosbee" <cgosbee@forum.codecharge> schreef in bericht
news:24713b0050b8e9@news.codecharge.com...
> Scrap that... I had tried it so many times on INSERT I assumed that it
> would
> fail on UPDATE just the same. Just switched to SQL mode and added the
> relevant
> string directly into the pre-generated SQL, and that worked like a charm.
>
> Sorry for posting something I was going to figure out so quickly.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|