×

Error

Please login first

[SOLVED] onCPayAfterPaymentStatusUpdateEvent and var3

8 years 1 month ago #280510 by lousyfool
Replied by lousyfool on topic onCPayAfterPaymentStatusUpdateEvent and var3

krileon wrote: Can you provide an example of your exact usage that caused it to fail?


See screenshot of syntax error message here:



Note the underlined field name, which in the query code was correctly
`cb_paa_paid`
but got scrambled by Auto Action (so to speak) to
`cb_paa_'
Also note the single closing quote instead of `. Trust me I've been through a lot of variations of this, all of which - with the exception of this screenshot - I deleted after I figured that CASE WHEN THEN ELSE END works instead.
Attachments:

Please Log in to join the conversation.

8 years 1 month ago #280540 by krileon
Replied by krileon on topic onCPayAfterPaymentStatusUpdateEvent and var3
It's failing at the IF syntax. The column name being cut off is just because it only shows a specific length of characters for an SQL error. If you look after the error through it shows you the fully query where the column name is fine. See the below MYSQL documentation regarding the IF syntax as it does not appear valid or at least that usage isn't familiar to me.

dev.mysql.com/doc/refman/5.6/en/control-flow-functions.html#function_if

Regardless CASE is the proper usage for your needs. I was unable to confirm your issue.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

8 years 1 month ago #280544 by lousyfool
Replied by lousyfool on topic onCPayAfterPaymentStatusUpdateEvent and var3
Thanks as always, Kyle.

Two different IF functions exist for MySQL. See here: dev.mysql.com/doc/refman/5.5/en/if.html - the blue "Note" box early on underlines the fact. Or google "mysql if then" and get a lot more on this other function.

However, I am familiar with the one you're referring to, had also tried it (did work in a very simple format), but when there were nested conditions, other than it getting hard to read it then failed in the same fashion... and I had paid really careful attention to getting the syntax right.

Anyway, we agree it works perfectly fine with CASE, no problem, and that's what matters. :)

Thanks and cheers!
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.259 seconds

Facebook Twitter LinkedIn