Den 13.02.2017 20:40, skrev Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support]:
>     Hello, All.
>
>     If I use prepared statement like this "update table set field1=?, 
> field2=? where
> field3=?" for performance reasons, is there a way to update only some fields 
> and leave
> other untouched without overhead of building separate queries on the fly or 
> selecting old
> values with different query?

I'm more of a SELECT than UPDATE guy (and haven't tried my suggestion), 
but wouldn't

update table set field1=coalesce(?, field1), field2=coalesce(?, field2) where
field3=?

get the right result (well, unless you could have instructions like "Set 
field2 to <null>;")? Theoretically, I would of course expect such a 
statement to "change" the value to the existing value rather than 
leaving it untouched when the parameter is <null>.

HTH,

Set



------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-dig...@yahoogroups.com 
    firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

  • [firebird-supp... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
    • RE: [fire... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
      • Re: [... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
        • R... 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
    • Re: [fire... setysvar setys...@gmail.com [firebird-support]

Reply via email to