Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have 2 tables and I try to get statuses from table
status
and add to each status info about an author from a
user
table. I created the same database on my laptop and everything works fine. But I've got an error when published the database on Heroku using ClearDB:
[42000][1305] FUNCTION heroku_1ecaeb2cbfaf113.JSON_OBJECT does not exist
Without JSON_OBJECT
query works fine. What's going on? Where I made a mistake?
My tables:
CREATE TABLE IF NOT EXISTS user (
login VARCHAR(15) NOT NULL PRIMARY KEY,
name VARCHAR(15),
avatar VARCHAR(150),
ts INT,
hash BINARY(60)
CREATE TABLE IF NOT EXISTS status (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
note VARCHAR(300),
author VARCHAR(15),
ts INT,
replyTo INT UNSIGNED
My query:
SELECT
status.id,
status.note,
status.ts,
JSON_OBJECT(
'login', statusAuthor.login,
'name', statusAuthor.name
user,
user statusAuthor
INNER JOIN status ON statusAuthor.login = status.author
WHERE
user.login = 'some_user' AND status.replyTo IS NULL
ORDER BY status.id
LIMIT 11;
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.