CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 How do I add a literal to provide a function to my query?

Print topic Send  topic

Author Message
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.
View profile  Send private message
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.
View profile  Send private message
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/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.