Skip to Content Skip to Menu

Executing stored procedures in CB

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 3 months ago #267172 by krileon
Replied by krileon on topic Executing stored procedures in CB
Looks like it's executing, but you're trying to substitute in the user id incorrectly so it's not executing for anyone. I've adjusted [id] to correct '[user_id]' (ensure to always quote the substitutions as they're not always typecasted to int). I've also adjusted access to Everybody as that trigger only fires for registered user so the additional check isn't needed.

Please note your site is set as offline. This means to even access your site you must first login. That first login is done using Joomla, not CB. This means CB login trigger will not fire and your action will do nothing. Please be sure to test with offline mode disabled.


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 or Create an account to join the conversation.

  • eciudad
  • eciudad
  • OFFLINE
  • Posts: 209
  • Thanks: 19
  • Karma: 0
9 years 3 months ago #267185 by eciudad
Replied by eciudad on topic Executing stored procedures in CB
Thank you Krileon
Yes. The site is offline for now. I take it offline when I test and put it back off as it is not ready yet and it needs few touches before we put it online. Please let me know If we are doing something wrong by selecting only registered user since these procedures creates a great number of records every time the user logs in. I just ran it for 219 users and generated over 21,000 records. We prefer that only registered users trigger the procedures.

Thank you once again for your help.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 3 months ago #267189 by krileon
Replied by krileon on topic Executing stored procedures in CB
All users are registered users so you access condition was doing nothing except causing CB Auto Actions to do an unnecessary check. If you want it to apply specifically to Registered usergroup you need to select that specific usergroup in Access and not "All Registered Users".

Your action will not work on frontend unless you turn offline mode off. The reason is to get past the offline screen you have to login. That login is using Joomla and not CB. This means the login trigger you're acting on will not fire and the action will not execute. So for testing purposes you need to disable offline mode to make sure the action is working, but I suspect it will as direct access to it functions fine.


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 or Create an account to join the conversation.

  • eciudad
  • eciudad
  • OFFLINE
  • Posts: 209
  • Thanks: 19
  • Karma: 0
9 years 3 months ago #267192 by eciudad
Replied by eciudad on topic Executing stored procedures in CB
Krileon,

It is not triggering every time and it may have to do with what you mentioned about the user_id not being INT all the time. The procedure is looking for an integer. If there anything I could do to make sure that in the Auto Action query is converted into integer if it was not captured that way. Could I use cast(user_id) as unsigned in the Auto Action query?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 3 months ago #267193 by krileon
Replied by krileon on topic Executing stored procedures in CB
Usually it's best to treat all substitutions as strings. However you can try forcing typecasting using the format functions. You'll need to enable them for the action under the Parameters as by default they only parse for conditions. You could then make the below change.

FROM:
Code:
'[user_id]'
TO:
Code:
[cb:parse function="clean" method="int"][user_id][/cb:parse]


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 or Create an account to join the conversation.

  • eciudad
  • eciudad
  • OFFLINE
  • Posts: 209
  • Thanks: 19
  • Karma: 0
9 years 3 months ago #267195 by eciudad
Replied by eciudad on topic Executing stored procedures in CB
Thank you I will try it.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum