mariadb,spacebars , Change column name in MariaDB

Change column name in MariaDB


Tag: mariadb,spacebars

I have this column in this database with a spacebar included, which I want to change.

ALTER TABLE . CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11); 

After using this line in the command line the output is as following:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11)' at line 1

Yeah, I have no Idea, what I am doing wrong.


If you are using dot (.) instead of table name that is why you have error. You have to specify table name:

ALTER TABLE `table_name` CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11);


sorting via order by and row_number via user variable in mariadb

I've read that any order by Operation is done at the end of the query and therefore sorting cannot be forced in a result before. So what I'm trying to achive is to get only one record from a result with duplicates by using variables which assign row numbers and...

MariaDB / MySQL pre-existing DB's

I was wondering what these three pre-existing Database are for? information_schema mysql performance_schema I am interested to know whether or not I can remove them in a minimalistic environment without worrying about any ramifications....

Meteor Spacebars nested tag equivalent

I have a problem. I have a collection of documents in my database, and I would like to display each document depending on whether a session variable corresponding to that document is set. To illustrate my problem, let me give a simplified example. Meteor.myTemplate.helpers({ stuff: [ {name: 'item1'}, {name: 'item2'}...

How Do I Use a Meteor Template Helper to Edit a Value Passed as a Parameter in Iron-Router?

How do I use a template-helper to edit the value of the parameter I passed into a route created using the pathFor method of iron-router??? I have this template-helper: Template.registerHelper('slugify', function(obj){ return _.slugify(obj); }); in my .html file I have this: {{#each menuItemsFromDB}} {{#each arrayOfMenuItems}} <a class="item category" href=""> {{this}}...

How to pass multiple arguments to Spacebars helper from Meteor template?

I haven't been able to find a solid example out there. Template.registerHelper("itemLookup", function(sku, property){ return Items.findOne({sku: sku})[property]; }); How do I call this on the template? I want to do something like: {{ itemLookup sku="i3_4030U" property="title" }} It should output "Intel Core i3 4030U" ...

How to animate enter and leave of MeteorJS {{#if}} block?

The title really says it all. Given a template: {{#if selection}} <div class="something"> <p>To Animate</p> </div> {{/if}} how do I control enter and exit animations of .something? Thanks....

Check if comma exists inside tag

I want to list all rows that contain a certain tag with multiple attributes. Eg.: [TAG=XX, YYY]ljasdljaslkdj[/TAG] (space is optional) I've tried this, but it doesn't return any rows: select * from oldtexts old WHERE old.content REGEXP "^\\[TAG=[A-Za-z][,][A-Za-z]\]" LIMIT 10 I only it to return tags with a comma inside...

php/SQL returns NULL

I'll be the first to admit I'm an idiot, but is there any reason for why this query returns NULL? The connection to the DB is working just fine and I'm able to POST to it. <?php $servername = "server"; $username = "user"; $password = "pass"; $dbname = "db-name"; //...

How can I reverse the ordering of spacebars #each block

A helper sentencesList is an array of objects containing an element text. HTML: {{#each sentencesList}} {{text}} {{/each}} CLIENT.JS sentencesList: function() { return Session.get(SENTENCES) } How can I reverse the ordering, i.e the highest index number is shows at the top and the element at index position 0 is at the...

Is there a limit on the number of rows I can update via an IN clause of a MySQL query? [duplicate]

This question already has an answer here: MySQL number of items within “in clause” 4 answers Is there a limit on the number of rows that I can update in a single query using an IN clause? For example: mysql_query("UPDATE `table` SET `row`=1 WHERE `id` IN(1,2,3,4,5,6,7,8....5000)"); Could I update...

Passing a parameter into Meteor Template Helper

I am trying to pass a parameter to a template helper. The parameter seems to be passed but then I can't use it as I would like to. I pass the parameter like this: {{#if unitFieldExists 'profile'}} {{profile}} {{/}} Helper in /client/lib/helpers.js Template.registerHelper('unitFieldExists', function(unitField) { var doc = Units.findOne({_id: this._id...

Different ResultSet in MySQL and MariaDB Using GROUP BY and ORDER BY

I have a table: voj_submission with following structure: CREATE TABLE IF NOT EXISTS `voj_submissions` ( `submission_id` bigint(20) NOT NULL, `problem_id` bigint(20) NOT NULL, `uid` bigint(20) NOT NULL, `submission_judge_result` varchar(8) DEFAULT NULL, ) ENGINE=InnoDB AUTO_INCREMENT=1004 DEFAULT CHARSET=utf8; And the data in the table may like this: SubmissionID ProblemID UserID JudgeResult 1000...

Join SQL confusion?

I was just wondering, can you have 2 ON statments in a join? I have something like: SELECT table1.col1, table2.col2 FROM table1 JOIN table2 ON table1.col1 = table2.col1 ON table1.col2 >= table2.col2; ...

How to make closable tabs with Meteor? My solution, your feedback

Note: as I wrote this question, I solved it. Since I think it would be useful for both others and me to have feedback on my approach, I finished explaining the different steps. Feel free to comment/answer. Hello, I want to dynamically load/unload tabs using a dropdown for loading and...

Meteor - templates. Building simple catalogue

I am Meteor newbie, so please, don't blame me too much for stupid question! I am fairly trying to find answer in Google and, but my foolishness is stronger than me at now. I am trying to build simple Catalog of Products from two Collection. Catalogs = new Mongo.collection('catalogs');...

MariaDB, Workbench, and ON DELETE SET DEFAULT

I have a non-nullable foreign key that I need to be set to default on a delete of the other table. I'm using MariaDB, and exporting the SQL script from a model in MySQL Workbench. MariaDB supports ON DELETE SET DEFAULT according to MySQL documentation says that while it's...

How to choose indexes

I'm trying to execute several times the following query : SELECT st2.stop_id AS to_stop_id, TIME_TO_SEC( ADDTIME(TIMEDIFF(MIN(st1.time), %time), TIMEDIFF(st2.time, st2.time))) AS duration FROM stop_times st1, stop_times st2, trips tr, calendar cal WHERE tr.service_id = cal.service_id AND tr.trip_id = st1.trip_id AND st1.trip_id = st2.trip_id AND st1.stop_id = %sid AND st1.stop_seq +1 =...

Meteor - Register multiple helpers at once

In my Meteor app (v1.1.0.2) I have 10 global helpers: Template.registerHelper("getUser", function(id) { return Meteor.users.findOne({ _id: id }); }); Template.registerHelper("getPublication", function(id) { return Publications.findOne({ _id: id }); }); Template.registerHelper("getCategory", function(id) { return Categories.findOne(new Mongo.ObjectID(id)); }); Template.registerHelper("getAge", function(id) { return Ages.findOne(new Mongo.ObjectID(id)); }); Template.registerHelper("getPhoto", function(id) { return new...

Meteor Helper Check equality

Is there a way to check the value of a string in meteor helper? Lets say i have this helper Template.example.helpers({ typeOfVideo:function(videoType){ var videoLink = GS.Gems.Collections.Gems.findOne({_id:this._id}).videoLink; if(videoLink.match(/youtube\.com/)){ return "youtube"; }else if(videoLink.match(/vimeo\.com/)){ return "vimeo"; }else{ return "undefined" } } }) Now i want to check if the video is equal to...

Order by COUNT(something) vs order by #column (sqlzoo example)

I was trying to solve problem 15 under I don't understand why my query is wrong, even though my output is like it's supposed to be. Here's my query: SELECT movie.title, COUNT(actorid) FROM movie JOIN casting on WHERE yr='1978' GROUP BY casting.movieid ORDER BY COUNT(casting.actorid) DESC And the...

Laravel 5 application can't connect MariaDB engine in docker container

I create a new Laravel 5 application in a docker container. I can access the home url and get the welcome message. I try create new routes and they are working too. Then I run a MariaDB docker container to link to the Laravel 5 application. Here is where the...

Open source Windows GUI for MariaDB

Is there any open source client GUI for windows operation system to manage MariaDB databases?

Does Maria DB support ANSI-89 join syntax

Does Maria DB support ansi-89 join syntax? SELECT sites.site_id, sites.site_name, pages.page_id, pages.page_title FROM sites, pages WHERE sites.site_id = pages.site_id; or only ansi-92 syntax? SELECT sites.site_id, sites.site_name, pages.page_id, pages.page_title FROM sites INNER JOIN pages ON sites.site_id = pages.site_id; ...

MariaDB/MySQL: Get checksum of InnoDB table

How do I get a reliable checksum on an InnoDB table? I want something like the CHECKSUM TABLE foo QUICK; that MyISAM has, and it needs to be fast. I'm developing a tool to reliably monitor and swiftly react to changes in my database. InnoDB tables don't update UPDATE_TIME in...

How to check if an object is empty in Meteor template?

I have a template data context like this: data = { "attribute1": { "attribute2": {} } } And in the meteor template I am doing something like this: {{#with attribute1}} {{#if attribute2}} show some content {{/if}} {{/with}} I don't want to show anything if attribute2 is an empty object. However...

Maria DB (mysql) installation on Red Hat . How do I start service after installation

I have installed mysql (maria db) on redhat. My question is - how do I start and stop the server? STEPS I ran the command $sudo yum install mysql It gave long messages in the console while installing and and at the end said Installed: mariadb.x86_64 1:5.5.41-2.el7_0 Dependency Installed: perl.x86_64...

MySQL: ERROR 1064 (42000) on trigger

Could someone help me with this trigger please to find out what I am doing wrong. BTW sometime I didn't have this error... CREATE DEFINER = CURRENT_USER TRIGGER `domitik_db`.`disp_hdw_BEFORE_INSERT` BEFORE INSERT ON `disp_hdw` FOR EACH ROW BEGIN declare boxId int UNSIGNED; declare unitId VARCHAR; SET unitId=(SELECT homeunit FROM t_cpl WHERE...

Unable to connect to mariadb database server with qt 4.8.5 and Ubuntu 12.04

I use the following code to connect to a MySQL server database. QSqlDatabase db_Server = QSqlDatabase::database("Test"); //find mysql driver db_Server = QSqlDatabase::addDatabase("QMYSQL","Test"); db_Server.setHostName("188.**.***.***"); db_Server.setPort(3306); db_Server.setDatabaseName("Test"); db_Server.setUserName("Test"); db_Server.setPassword("*********"); bool ret =; if(ret) qDebug() << "Database open" else qDebug() << db_Server.lastError().text(); Lately they changed the server to mariadb and I assumed...

Determine tables that takes a part in the query result?

I use libmariadb to communicate with mysql server. mysql_real_query - to execute queries mysql_store_result - to fetch result Is there a way to figure out from MYSQL_RES (or else), what tables takes a part in the query result? For example, for query SELECT name, number FROM person INNER JOIN phone...

mysqli_fetch_array($link, $query) is not outputting the expected result when querying database directly

I am trying to create an array of the table comments per column_name, where column_name is the key. I go to my mysql database (Maria DB) and enter the query SELECT column_name, column_comment FROM information_schema.columns WHERE table_name='apple_checklists' and it returns two columns of information: when I use the phpcode: $columnCommentQuery...

Is it possible to query an index in a MySQL/MariaDB database?

I know that you can tell if an index exists in MySQL with a statement like SHOW INDEX FROM table1; but is it possible to actually query the index to check the state of the index, e.g. something along the lines of SELECT * FROM <index_name> And get a result...

Using a helper with arguments AS a helper argument in Spacebars

So I am trying use a helper as an argument of another helper in Spacebars. In the example below, 'getResultInfo' is a helper that gets data specific to the arguments passed, and 'formatResult' is a helper that formats its result and the results of other helpers. <template name="example"> {{#each collectionResults}}...

Query performance - 'Left join is null' vs 'Not exists select'

I have a question about a query that I want to execute, but I dont know what is the best qua performance. I need to get all the words exclude the words that have a relation with the table wordfilter. The output of the queries is right, but maybe there...

Delete all foreign keys in mysql database

I can see that there are some questions [1,2] that already ask for this, but where the solution didn't contain a complete SQL script to do this task. I have a situation where it would be very helpful to delete all foreign keys using SQL only. Currently I'm trying to...

Meteor/Spacebars Display Placeholder Text When No Documents Match User

I have a script that runs through a collection of photo documents, checks if they match the current user ID, and then renders the template. <ul id="settings-photos"> {{#each photos}} {{#if person}} {{> photo}} {{/if}} {{/each}} </ul> If no photos exist for a user, I would like to display a "Click...

Innacurate query with LIKE statement

Language is PHP, Database ORM is RedBean if(isset($get['last']) || isset($get['first'])){ $query = ''; $search_params = []; if(isset($get['first']) && !isset($get['last'])){ //search only with first name $query .= ' AND name LIKE :first '; $search_params[':first'] = '%'.$get['first'].'%'; $args['first'] = $get['first']; } else if(!isset($get['first']) && isset($get['last'])){ //search only with last name $query .=...

MariaDB Dynamic Column Nesting

I have been searching for this for a couple of hours. I have setup a MariaDB server and am implementing Dynamic Columns, which I know how to do, but I can't seem to find out how to go more than one level deep. INSERT INTO Invoices (Invoice) VALUES ( COLUMN_CREATE...

MariaDB convert_tz maketime

When I run this query select convert_tz( concat( (`last_mailing` + interval 1 day), ' ', maketime(`email_delivery_hour`,0,0) ), 'EST','GMT') FROM `member_subscriptions` the date - time stamps returned include fractions of a second, such as 2014-07-01 05:00:00.000000 I need the date - time to return in the format YYYY-MM-DD HH:II:SS last_mailing is...

How to use MariaDB's REGEXP_REPLACE?

I have read the docs for MariaDB's REGEX_REPLACE but cannot get my query to work. I am storing links in a column, link and want to change the end of the link: From<code> to<code> where <code> is some hexidecimal hash, e.g. 55770abb384c06ee00e0c579. What I am trying is: SELECT...

MariaDB formatting view code

When i save view on mariadb on debian(6) I lose comments and formatting of code. What is this feature of mariadb? How turn if off? On windows instance all comments and formats are stored. Both instances is MariaDB 10.0.17. Managed with Heidi 9.1 from Windows. Edit 1. Semi solved. LOAD_FILE...

MySQL / MariaDB unique BLOB of fixed length

I need a 16-byte binary data column to be unique. Why can't a BLOB(16) be unique in MySQL and MariaDB, when it supports unique VARCHAR? That this is supported but not a fixed-length set of bytes seems nuts. Also, it's not acceptable to waste space by storing a binary value...

Meteor: use dynamic parameters in a template call

In my Meteor app i have the TAPi18n package and aldeed:autoform. Im trying to make a form validation using i18n for the placeholder field but i don't know how to do it. So, I was wondering if it is possible to pass a dynamic parameter (that's how I call it)...

How can I pass parameters to an helper?

I want to pass some parameters from my HTML to my meteor helper. Can I do something like this? -> {{myHelper "customText"}} or {{myHelper context="customText"}} If so, how do I get back the string "customText"? Is it something like this? -> "myHelper": function(context){ return this.dataset[context]?"success":"danger" }, thanks!...

PHP loop - poor SQL performance

I'm looping through 40 associative arrays: array( 'key0' => value, 'url0' => value, 'tit0' => value, 'cdn0' => value, 'cdn1' => value, 'cdn2' => value, ) and I am performing multiple select and one possible insert queries. I tried to optimize the performance by reducing the amount of queries. foreach($buf){...

Can't find FULLTEXT index while using IN BOOLEAN MODE

I'm trying to filter some data with an MATCH ... AGAINST WHERE clause. But I get the following error: Can't find FULLTEXT index matching the column list This is an query I execute: SELECT PAR.idPartij, PAR.Partijnaam, PRO.Productnaam, PER.Perceel, R.Ras, PAR.TagNR FROM Partij AS PAR LEFT OUTER JOIN Product AS PRO...

Disallow NULL parameters to stored procedures in MySQL/MariaDB

I can specify that table columns are NOT NULL, but how do I make a stored procedure or function only be compatible with non-null arguments? Adding NOT NULL after the argument name doesn't work.

Can't connect to MySQL/MariaDB database from vibed app

All work fine if I use custom main ( void main() instead of shared static this() ). With default main I am getting "Access Violation" error. It's look like MySQL not allow connecting to it from localhost, but in my.ini I added string: bind-address = code, if it's help:...

Convert Subquery SQL to Laravel possible?

Is this possible to change this SQL to let it work on Laravel? SELECT name, event,m.season_id, tm.played_pugs, active, m.created_at, datediff(now(),m.created_at) FROM matchs m LEFT OUTER JOIN seasons ON = m.season_id JOIN ( SELECT season_id, max(matchs.created_at) as MaxDate, count(season_id) as played_pugs FROM matchs GROUP BY season_id) tm on m.season_id =...

Meteor collection - count same values

I need to count all products in descending order and display them with spacebars. How would I do that? Result should be: book : 2 tv : 1 // My Collection Records = new Mongo.Collection('records'); // My database Records.insert({ name: "a", product: "book" }); Records.insert({ name: "b", product: "tv" });...

Error when configuring MariaDB driver on Wildfly server

I am trying to configure a MariaDB datasource on Wildfly. This seems like it should be a simple operation, but I can't seem to get the datasource module to load properly. I have added the maria-java-client-1.1.8.jar archive and a module.xml file to the wildfly-8.2.0.Final/modules/com/mariadb/main directory. The module.xml file is as...