Column not found: 1054 Unknown column 'revision_uid' - drupal

I updated D-8.3.9 to D-8.7.1 and while updating db drush updb I am getting
Performing paragraphs_update_8016
Failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'revision_uid' in 'where clause': SELECT 1 AS expression
FROM
{paragraphs_item_field_data} t
WHERE revision_uid IS NOT NULL
LIMIT 1 OFFSET 0; Array()
Any help is appreciated

Related

SQL Error: ORA-00904: : invalid identifier in line 4

I was working in sql command line and got this error ORA-00904 when i queried to create a table
I tried various inputs and got the same error in line 4.
Help me out.
If you create a table
Then this would work :
CREATE TABLE DATA
(
ID INT NOT NULL,
NAME VARCHAR2(10) NOT NULL
);
But this would raise an ORA-00904 :
CREATE TABLE DATA
(
ID INT NOT NULL,
NAME VARCHAR2(10) NOT NULL,
);
The difference?
After that last comma, something more is expected.
Yet, all it finds is a round bracket.
Hence, the error.

How to fetch data in nested record in PL/SQL?

I was trying to work on nested record example.
Please have a look at declaration section.
DECLARE
TYPE r_emp IS RECORD (
name VARCHAR2(50),
dept_rec departments%ROWTYPE
);
r_emp_row r_emp;
BEGIN
SELECT emp.first_name||' '||emp.last_name,dept.*
INTO r_emp_row
FROM employees emp,departments dept
WHERE emp.department_id = dept.department_id
AND emp.employee_id = 100;
DBMS_OUTPUT.PUT_LINE('Name:'||r_emp_row.name);
DBMS_OUTPUT.PUT_LINE('Department ID:'||r_emp_row.dept_rec.department_id);
DBMS_OUTPUT.PUT_LINE('Department Name:'||r_emp_row.dept_rec.department_name);
EXCEPTION
when others then
null;
END;
I am trying to run above block but getting error as below:
Error report -
ORA-06550: line 10, column 8:
PLS-00597: expression 'R_EMP_ROW' in the INTO list is of wrong type
ORA-06550: line 11, column 3:
PL/SQL: ORA-00904: : invalid identifier
ORA-06550: line 9, column 3:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
Help appreciated.
Your record type r_emp is a composite of one scalar attribute and one record, so you will need to reflect that in the select into. Something like:
select emp.first_name||' '||emp.last_name, dept.*
into r_emp_row.name, r_emp_row.deptrec.dempno, r_emp_row.deptrec.dname ...
btw unrelated to the problem, when others then null is a famously dangerous construction:
What is bad in "When Others Then Null" in PL/SQL?
http://www.orafaq.com/wiki/WHEN_OTHERS
http://tkyte.blogspot.co.uk/2008/06/when-others-then-null-redux.html
What if there is no employee 100? Fine, it does nothing - perhaps that's OK. What if there is an employee 100 but there is a corrupt block in the index causing the query to fail with ORA-01578: ORACLE data block corrupted, or not, depending on the execution plan? It does nothing and doesn't tell you, and you'll think there's no employee 100.

PL/SQL compilation error

What is wrong with the following statement:
DECLARE
int_exists INTEGER;
BEGIN
SELECT COUNT(ItemKey)
INTO int_exists
FROM BIR_TabsForDashboard
WHERE ItemKey = 'Position';
IF( int_exists = 0 ) THEN --doesnt exist
EXECUTE IMMEDIATE 'ALTER TABLE BIR_TabsForDashboard ADD Position int NULL';
END IF;
END;
I get this report error:
ORA-06550: line 7, column 9:
PL/SQL: ORA-00904: "ITEMKEY": invalid identifier
ORA-06550: line 4, column 3:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
What could be wrong? It seems to work when I use it on another table but for some reason it comes up with this error when I do it to this specific table?
The table BIR_TabsForDashboard does not have a column named ItemKey.
Make sure the procedure which you are using is should properly declared in the place which you are using it. For an example if it is under an another user and in an another package then it should be in that same order. The username, package and procedure name.

ORA-00932: inconsistent datatypes: expected CHAR got NUMBER

SELECT CASE WHEN no > 1 THEN name ELSE 3 END FROM test
ORA-00932: inconsistent datatypes: expected CHAR got NUMBER
I am getting the above error. How can I use a varchar column in this case?
Put the number in quotes to make it a varchar:
SELECT CASE WHEN no > 1 THEN name ELSE '3' END
FROM test

Updating organic groups module in Drupal

I've taken over a Drupal website. I'm trying to update the og module. It is currently version 1. I tried to upgrade it to the latest version but when I ran update.php it failed. So I thought I'd just try updating it to version 1.4. However, when I did this I then got the following errors when I ran update.php:
# user warning: Table 'og_ancestry' already exists query: CREATE TABLE og_ancestry ( nid int(11) NOT NULL, group_nid int(11) NOT NULL, is_public int(1) NULL, KEY (nid), KEY (group_nid) ) /*!40100 DEFAULT CHARACTER SET utf8 */; in /homepages/0/d309344694/htdocs/openup6/sites/default/modules/ogr/og.install on line 218.
# user warning: Unknown column 'is_public' in 'field list' query: INSERT INTO og_ancestry (nid, group_nid, is_public) SELECT nid, gid, is_public FROM og_migrate in /homepages/0/d309344694/htdocs/openup6/sites/default/modules/ogr/og.install on line 239.
# warning: array_merge() [function.array-merge]: Argument #2 is not an array in /homepages/0/d309344694/htdocs/openup6/update.php on line 174.
# user warning: Duplicate entry 'openup-og_views-1' for key 2 query: UPDATE blocks SET module = 'og_views', delta = '1' WHERE module = 'og' AND delta = '5' in /homepages/0/d309344694/htdocs/openup6/sites/default/modules/ogr/og.install on line 377.
# user warning: Unknown column 'selective' in 'og' query: ALTER TABLE og CHANGE `selective` `og_selective` INT NOT NULL DEFAULT 0 in /homepages/0/d309344694/htdocs/openup6/includes/database.mysql-common.inc on line 520.
# user warning: Unknown column 'register' in 'og' query: ALTER TABLE og CHANGE `register` `og_register` TINYINT NOT NULL DEFAULT 0 in /homepages/0/d309344694/htdocs/openup6/includes/database.mysql-common.inc on line 520.
# user warning: Unknown column 'theme' in 'og' query: ALTER TABLE og CHANGE `theme` `og_theme` VARCHAR(255) DEFAULT NULL in /homepages/0/d309344694/htdocs/openup6/includes/database.mysql-common.inc on line 520.
# user warning: Unknown column 'directory' in 'og' query: ALTER TABLE og CHANGE `directory` `og_directory` TINYINT NOT NULL DEFAULT 0 in /homepages/0/d309344694/htdocs/openup6/includes/database.mysql-common.inc on line 520.
# user warning: Unknown column 'description' in 'og' query: ALTER TABLE og CHANGE `description` `og_description` VARCHAR(255) DEFAULT NULL in /homepages/0/d309344694/htdocs/openup6/includes/database.mysql-common.inc on line 520.
# user warning: Unknown column 'notification' in 'og' query: ALTER TABLE og CHANGE `notification` `og_notification` TINYINT NOT NULL DEFAULT 0 in /homepages/0/d309344694/htdocs/openup6/includes/database.mysql-common.inc on line 520.
# user warning: Unknown column 'language' in 'og' query: ALTER TABLE og CHANGE `language` `og_language` VARCHAR(12) NOT NULL DEFAULT '' in /homepages/0/d309344694/htdocs/openup6/includes/database.mysql-common.inc on line 520.
# user warning: Duplicate column name 'og_private' query: ALTER TABLE og CHANGE `private` `og_private` TINYINT NOT NULL DEFAULT 0 in /homepages/0/d309344694/htdocs/openup6/includes/database.mysql-common.inc on line 520.
# warning: Missing argument 1 for og_notifications_menu() in /homepages/0/d309344694/htdocs/openup6/sites/default/modules/ogr/og_notifications/og_notifications.module on line 15.
and
Update #6002
* Failed: ALTER TABLE {og} CHANGE `selective` `og_selective` INT NOT NULL DEFAULT 0
* Failed: ALTER TABLE {og} CHANGE `register` `og_register` TINYINT NOT NULL DEFAULT 0
* Failed: ALTER TABLE {og} CHANGE `theme` `og_theme` VARCHAR(255) DEFAULT NULL
* Failed: ALTER TABLE {og} CHANGE `directory` `og_directory` TINYINT NOT NULL DEFAULT 0
* Failed: ALTER TABLE {og} CHANGE `description` `og_description` VARCHAR(255) DEFAULT NULL
* Failed: ALTER TABLE {og} CHANGE `notification` `og_notification` TINYINT NOT NULL DEFAULT 0
* Failed: ALTER TABLE {og} CHANGE `language` `og_language` VARCHAR(12) NOT NULL DEFAULT ''
* Failed: ALTER TABLE {og} CHANGE `private` `og_private` TINYINT NOT NULL DEFAULT 0
Can anyone help?
If I understand you correctly:
You were running OG version 1
You tried to update it to the latest version i.e. version 2.1 -- that update failed
So now you tried to update it to version 1.4 -- That has failed too.
Unfortunately, what has happened is that the database tables have been changed to correspond to the "schema" for version 2.1. That upgrade did not succeed completely for an unknown reason (difficult to say.. could be so many things).
Now you cannot upgrade to 1.4. Actually that would mean "downgrading". Thats not possible in Drupal.
You should always take a database dump before performing an upgrade. So many things can go wrong.

Resources