Parse Server issue viewing relations - parse-platform

I'm running parse-server version 4.4.0 and I'm trying to create a new _Role object using parse-dashboard and PostgreSQL. I can successfully create the _Role object but I cannot view the users relations. When I click on the button "View relation" in the users column I get a blank screen.
I've dug into the PostgreSQL logs and I'm seeing this:
SELECT * FROM "_Join:users:_Role" WHERE "owningId" = 'I2GKNd41kM';
SELECT * FROM "_User" WHERE "objectId" IS NULL ORDER BY "name" ASC LIMIT 200;
ERROR: column "name" does not exist at character 250
And this is a valid error, the "name" column does not exist on the _User table.
However, viewing the roles relation works as expected and the logs look like this:
SELECT * FROM "_Join:roles:_Role" WHERE "owningId" = 'I2GKNd41kM';
SELECT count(*) FROM "_Role" WHERE "objectId" IN ('FOOwXF4Rxa');
I cannot figure out how parse-server is generating that SQL in the error case above. I'm at a complete loss and would appreciate any pointers or other places to look. I clearly have something misconfigured but I can't seem to find it anywhere.

Related

Insert Into from another table causing Can't update 'table' in stored function/trigger because it is already used by statement which invoked

I'm pretty new to SQL so if you can keep it as as simple as possible that would be appreciated.
Currently trying to add all the contact IDs from the contact table (civicrm_contacts) to a new custom field table which is a button to show/hide a contact from the main website. At the moment whenever I run my query I get back the following:
"SQL Error [1442] [HY000]: Can't update table 'civicrm_contact' in stored function/trigger because it is already used by statement which invoked this stored function/trigger."
My query is going something like this:
INSERT INTO civicrm_value_appears_on_we_69 (entity_id)
SELECT cc.id
FROM civicrm_contact cc
WHERE contact_type='Organization'
There are 3 columns in total for the 'civicrm_value_appears_on_we_69': 'ID', 'entity_id', and 'appears_on_website_45' which is a 0 or 1 for the button value. All I want is to insert the contact IDs for all the Organisation contacts, I don't mind about nulls for now as long as it makes the rows.
I've looked up a bit about the error and I'm unsure why it's happening. As far as I can gather this errors happpens when you're using a trigger that using the same table as you're inserting into/from. I'm not using a trigger at the moment, or perhaps I have this wrong.
Any suggestions?

How to Create a VIEW in oracle

So I'm supposed to create a view product_view that presents the information about how many products of a particular type are in each warehouse: product ID, product name, category_id, warehouse id, total quantity on hand for this warehouse.
So I used this query and tried to change it so many times but I keep getting errors
CREATE OR REPLACE VIEW PRODUCT_VIEW AS
SELECT p.product_id, p.product_name,
COUNT(p.product_id), SUM(i.quantity_on_hand)
FROM oe.product_information p JOIN oe.inventories i
ON p.product_id=i.product_id
ORDER BY i.warehouse_id;
ERROR at line 2:
ORA-00928: missing SELECT keyword
Please help... Thanks
Image showing the Tables in the OE schema
Image showing the error that occurs
When I get errors creating a view, I firstly drop the CREATE ... AS line and fix the query until it works. Then you need to name all the columns, for instance COUNT(p.product_id) won't work, you'll need to write something like COUNT(p.product_id) AS product_count or specify a list of aliases, like so
I'm not sure what the output of your query should look like. You'll get better answers quicker on stackexchange if you type a minimal example including the CREATE statments, some input data and your desired output, leaving out columns that are not essential.

Error creating DB2 View: specification ORDER BY, OFFSET, or FETCH clause is invalid

I am attempting what I thought was a very simple view. It contains one table, and just does an "ORDER BY" so I can sort the output.
I created the view on DB2 LUW using IBM Data Studio. I used the following statement:
FROM TCIS.JRGS
ORDER BY JRGSORT ASC, JRGNAME ASC;
When I attempt to execute this, I get the following error:
The specification ORDER BY, OFFSET, or FETCH clause is invalid.. SQLCODE=-20211, SQLSTATE=428FJ, DRIVER=3.69.56
Is anyone with DB2 experience able to tell me what I'm doing wrong? How do I order a view?
CREATE VIEW uses fullselect.
The SQLSTATE you get is described at the latter link. Read it carefully.
Despite the fact, that you can create a view like below, it doesn't guarantee the order of rows, if you use this view without the order by clause.
CREATE VIEW MYVIEW AS
SELECT *
FROM
(
SELECT *
FROM TCIS.JRGS
ORDER BY JRGSORT ASC, JRGNAME ASC
);

Getting "ORA-01482: unsupported character set" when using WHERE IN pattern

I have a table with the following structure in Oracle database:
CREATE TABLE PASSENGERS
(ID VARCHAR2(6),
PASSPORTNO VARCHAR2(14));
I want to get the IDs of the passengers who have been registered more than once. For that I run the following query.
SELECT ID FROM PASSENGERS WHERE PASSPORTNO IN
(SELECT PASSPORTNO FROM PASSENGERS
GROUP BY PASSPORTNO
HAVING COUNT(*)>1);
But I get "unsuported character set" error. What's the point I'm missing?
Since all queries related with PASSPORTNO are running fine you have at least two more things to do:
Run SELECT ID FROM PASSENGERS and check for errors, if the error cames up, then it may be releated with content stored in your table
Try another SQL tool to execute your queries, your client OS may be using a system enconding which the database can't understand both when processing your query of to display the returning rows.
Since both ID and PASSPORTNO are varchar fields, there's a big change to one of then have data in a enconding which oracle can't decode properly.
Mostly seems like a data issue. Try checking the exact data row which is causing the issue.
Use : DML Error Logging - http://www.oracle-base.com/articles/10g/dml-error-logging-10gr2.php
Btw, you are doing GROUP BY passportno .Is that correct? (This implies multiple passports can have same passport number). I guess it should be GROUP BY id

Firebird queries using chars/varchar

I am using SQLManager Lite for firebird and it was impossible so far to write a query which would do an operation on char/varchar columns. Character set is win1252.
A query like
select * from Person where name = 'John'
won't return any results despite the fact that the record exists in the database. A similar query on a numerical column works just fine.
AM I am missing anything here?
Also, this query runs fine from my application. The only issue is that I would like to be able to run it within SQLManager Lite too. As a side note, values for char and varchar columns are not displayed properly within the same SQLManager Lite.
change to like
select * from Person where name like 'John'

Resources