Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9184199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:59:11+00:00 2026-06-17T18:59:11+00:00

I have been working on a Ruby web app using MySQL for the database.

  • 0

I have been working on a Ruby web app using MySQL for the database. I heard from a friend that the mysql gem did not work well with stored procedures, so I decided to use the mysql2 gem along with the seqel gem.

I have a stored procedure in MySQL called AddUser(Username, Password). It works fine from MySQL. I want to access it using the gems for security reasons.

The sqeuel doc here only really covers how to access databases made with the sequel gem. My first-draft code looked something like this, but doesn’t actually run the procedure

# Connect to the database
db = Sequel.mysql2(
    :host => '127.0.0.1', 
    :database => database, 
    :username => username, 
    :password => password)

# Call the sproc
db["User"]
db.call_sproc(:insert, "AddUser", [name, pass])

The error message is:

Sequel::DatabaseError

Mysql2::Error: Query was empty

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:59:13+00:00Added an answer on June 17, 2026 at 6:59 pm

    I’m unsure whether a PreparedStatement is actually capable of calling a stored procedure. Certainly in JDBC you’d have to use a CallableStatement to do this.

    Since you’re using Sequel, have you had a look at Sequel::DataSet::StoredProcedures (http://sequel.rubyforge.org/rdoc-adapters/classes/Sequel/Dataset/StoredProcedures.html) ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to use the ruby-git gem to make commits etc from
I have been working on a Ruby Script that enters in data into a
I'm working with a Ruby project for school, and have sadly not been able
I have been working on this app for at least 3-4 months and just
I have been working on updating my gem (whm_xml at https://github.com/ivanoats/whm_xml_api_ruby ) to make
I'm new to Ruby, and have been working my way through Mr Neighborly's Humble
I have been working with Ruby on Rails for over a year now and
I have been working with Ruby on Rails for a while. It has a
So I have been working on a multi-step form in ruby on rails (1.9.3)
I have been working on my Ruby. When trying to execute this simple example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.