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 8853173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:35:10+00:00 2026-06-14T13:35:10+00:00

I am creating a database for a collection of servers for minecraft, and the

  • 0

I am creating a database for a collection of servers for minecraft, and the way I have it set up, I want a table to be created for each server as it is added. At the moment, I have everything working except for the fact that i cannot get the tables that are being created to contain the IP address. I want the table to be something like [IP]_Players where the [IP] is replaced by the actual IP address, which will be send through the function that it is being created through. Here is what I have so far:

DELIMITER $$

CREATE PROCEDURE `minecraft`.`AddServer` (ip Text)
BEGIN
DECLARE play TEXT;
DECLARE tran TEXT;
SET play = ip + '_Players';
SET tran = ip + '_Transactions';
INSERT INTO `minecraft`.`Server_Data` (`Server_IP`) VALUES (ip);
CREATE TABLE `minecraft`.play (
  `Player` TEXT NOT NULL ,
  `Balance` DOUBLE NOT NULL DEFAULT 100 ,
  `Warnings` INT NOT NULL DEFAULT 0 ,
  `Offences` INT NOT NULL DEFAULT 0 ,
  UNIQUE INDEX `Player_UNIQUE` (`Player` ASC) );
CREATE  TABLE `minecraft`.tran (
  `Time` TIMESTAMP NOT NULL ,
  `Player` TEXT NOT NULL ,
  `Destination` TEXT NOT NULL ,
  `Amount` DOUBLE NOT NULL ,
  `Description` TEXT NOT NULL ,
  PRIMARY KEY (`Time`) );
END

Instead of creating it as 192.168.001.107_Players when
CALL minecraft.AddServer('192.168.001.107');
is preformed, it creates a table called play.
What am I doing wrong?

  • 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-14T13:35:12+00:00Added an answer on June 14, 2026 at 1:35 pm

    I was playing around and got this to work. Note that you cannot have periods in a table name. So you may want to use the REPLACE function to replace the periods with underscores for example.

    DELIMITER $$
    
    CREATE PROCEDURE `minecraft`.`AddServer` (ip Text)
    BEGIN
    DECLARE play varchar(500);
    DECLARE STMT varchar(500);
    SET play = CONCAT(ip, '_Players');
    SET @sql_stmt = CONCAT('CREATE TABLE minecraft.', play, ' (
      `Player` VARCHAR(50) NOT NULL ,
      `Balance` DOUBLE NOT NULL DEFAULT 100 ,
      `Warnings` INT NOT NULL DEFAULT 0 ,
      `Offences` INT NOT NULL DEFAULT 0 ,
      UNIQUE INDEX `Player_UNIQUE` (`Player` ASC) );');
    PREPARE STMT FROM @sql_stmt;
    EXECUTE STMT;
    END$$
    
    Delimiter ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a database table and I don't have a logical primary key assigned
I am creating database at runtime and I want to create the tables in
I am creating a database table with the following sql: CREATE TABLE `cs3_ds1` (
I'm creating a database application using ASP.NET and I want to make a Windows
I am creating a database in SQL Server 2005 and cannot remember the CREATE
I am creating a database that will help keep track of which employees have
I'm creating a database using SQL Server Management Objects . I wrote the following
The way I usually create my applications is by creating the database first and
I want to create a global connection class from Sql server database to vb.net
Creating a client server application i have managed to get the server to link

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.