Syntax error when trying ALTER TABLE - db2

I'm using Db2 version 11.2.
I just need to align the format of this new table PORTFOLIO_USER exact as PORTFOLIO_USER_OLD
I have written this code
reorg table CA_CAMPAIGN.DM0032_PORTFOLIO_USER
ALTER TABLE CA_CAMPAIGN.DM0032_PORTFOLIO_user ALTER COLUMN ACH_FLG SET DATA TYPE SMALLINT ;
it is throwing error
Lookup Error - DB2 Database Error: ERROR [42601] [IBM][DB2/LINUXX8664] SQL0104N An unexpected token "ALTER" was found following "". Expected tokens may include: "RECLAIM".
Can anyone help ?

Related

Npgsql.PostgresException (0x80004005): 42703: column {schema} of relation {table} does not exist

I am trying to update a table in postgresql from C# .NET. getting error column {schema} of relation {table} does not exist, but at the same time I can able to select the table.
the user given the access other than super user. could you please help here?
I tried , direct execute of update in pgadmin tool for the same table and it is successful

Deadlock detected on Alter table add column is postgresql

I am trying to add a column through Hasura cloud.
Running the SQL
alter table "public"."clinic_rosters" add column "with_user_id" uuid null default '';
But it is giving
SQL EXECUTION FAILED, DEADLOCK DETECTED.
Please help somebody how can I add column avoiding the deadlock error.

How to set table to LOGGED in postgresql 9.2?

I'm using PostgreSQL 9.2. I created a bunch of UNLOGGED tables, loaded data into there, and created primary keys. Now I'd like to set them back to LOGGED status.
I tried the command:
ALTER TABLE table_name SET LOGGED;
However, I get this error:
ERROR: syntax error at or near "LOGGED"
What is the proper syntax for this?

Configuration of PostgreSQL error messages

I have a question concerning the error messages in PostgreSQL.
I noticed that in case of some failure PostgreSQL make a report in the form of text message but it does not contain error code id.
For instance:
ERROR: Relation "mytable" already exists or
ERROR: duplicate key value violates unique constraint "id"
Could you please suggest a way to make PostgreSQL including native error code id to messages for instance as follows:
42P07 ERROR: Relation "mytable" already exists or
23505 ERROR: duplicate key value violates unique constraint "id"
.
Is it possible ?
Thanks in advance.
You can change the parameter log_error_verbosity in postgresql.conf file to change the amount of information being logged during errors. By default, its value is default. You can change it to verbose to include more information about the errors.

ERROR: syntax error at or near "timestamp" when adding column

I am trying to add a column to a table and the following is my command:
alter table history add column start type timestamp;
I get the following error:
syntax error at or near "timestamp"
How is this command incorrect?
Remove the word type, it should be:
alter table history add column start timestamp
Also, start is a non-reserved keyword in PG (but reserved in the SQL99 standard) and as such might not be a good column name.