What version of ejabberd are you using?
18.06
What operating system (version) are you using?
Ubuntu 16.04
How did you install ejabberd (source, package, distribution)?
Source
What did not work as expected? Are there error messages in the log? What
was the unexpected behavior? What was the expected result?
I need help regarding DB Macros like ?SQL_UPSERT_MARK , ?SQL_INSERT, ?SQL_UPSERT
Can you share me a link of some blog ?
in my custom mule I have to update if id already exist or I have to Insert if does not exist.
Use ?SQL_UPSERT macro: grep sources, there are plenty of examples.
@zinid Thanks for quick reply .. just a small help will play a big role
In following example I am assuming !username and !server_hos fieds to be matched ?? and xml to be inserted or updated ??
?SQL_UPSERT_T(
"motd",
["!username=%(U)s",
"!server_host=%(LServer)s",
"xml=''"])
username and server_host are used inside where clause, while xml is updated, yes. If the row doesn't exist, all columns are inserted.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
usernameandserver_hostare used insidewhereclause, whilexmlis updated, yes. If the row doesn't exist, all columns are inserted.