I have created a database link from my 10g database to 12c database. When I am trying to access table using 10g database it works fine. But when we try to execute the procedure from 10g database, it popups following error
SQL> exec popcust#abcd;
BEGIN popcust#abcd; END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'POPCUST#ABCD' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
When we describe a procedure from 10g DB. it comes with like this.
SQL> desc popcust#abcd;
PROCEDURE st#abcd
Please can somebody help me
Related
I am trying to copy my PostgreSQL query result set into an excel file since Tableau Public does not connect to PostgreSQL.
I am unsure how to get my result set into excel. I've been watching countless YouTube vids and read numerous stack overflow & postgresql threads to no avail. I am using postgresql 14 on pgadmin on a Mac. Appreciate any response!
The code below is what I tried and I get this error message:
copy (select * from emp) to '/Users/my_name/Desktop/sql_query.csv' with csv
ERROR: could not open file "/Users/my_name/Desktop/sql_query.csv" for writing: Permission denied
HINT: COPY TO instructs the PostgreSQL server process to write a file. You may want a client-side facility such as psql's \copy.
SQL state: 42501
I also tried \copy and got this error message:
ERROR: syntax error at or near "\"
LINE 1: \copy (select * from emp) to '/Users/my_name/Desktop/sq...
^
SQL state: 42601
Character: 1
I'm trying to convert Oracle to PostgreSQL. I'm getting error like ERROR: syntax error at or near "UPDATE_USER_PWD_INVALID1" while creating procedure
CALL PROCEDURE UPDATE_USER_PWD_INVALID1 IS
-- PRAGMA AUTONOMOUS_TRANSACTION;
V_INVALID_COUNT USERSMPININVALID.INVALID_COUNT%TYPE;
I have an error while restoring DB from dump. What does it mean?
ERROR: syntax error at or near "FUNCTION"
LINE 1: ...LETE ON public.currency_rate FOR EACH ROW EXECUTE FUNCTION p...
--
-- Name: currency_rate currency_rate_bt_delete; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER currency_rate_bt_delete
INSTEAD OF DELETE ON public.currency_rate
FOR EACH ROW
EXECUTE FUNCTION public.currency_rate_bt_delete();
The problem of your dump/restore is that your create dump with PostgreSQL v13 It generates dump you have shown.
But then you try to restore this dump on PostgreSQL v10 which does not understand that dump
You have to use PROCEDURE instead of FUNCTION before public.currency_rate_bt_delete()
Your trigger query should be like below:
CREATE TRIGGER currency_rate_bt_delete
INSTEAD OF DELETE ON public.currency_rate
FOR EACH ROW
EXECUTE PROCEDURE public.currency_rate_bt_delete();
NOTE : - This answer is limited to the error mentioned in the question.
I am using flyway for a deployment and the tables built as a result of flyway are all fine.
The issue I have is with the schema_version table. I am unable to query an individual column in the table. I am only able to perform a select *.
The error message I am getting is:
10:35:49 [SELECT - 0 row(s), 0.000 secs] 1) [Error Code: -206, SQL State: 42703] DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=SCRIPT, DRIVER=4.13.127. 2) [Error Code: -727, SQL State: 56098] DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-206;42703;SCRIPT, DRIVER=4.13.127
Try enclosing the column name in double quotes:
select "SCRIPT" from flyway.schema_version
This might help.
Flyway Schema table is designed to be in lower case.
You can change the table name using below config property.
flyway.table=SCHEMA_VERSION
For more details you can check this
https://flywaydb.org/documentation/faq#case-sensitive
Try to make your query like this:
SELECT "version", "installed_on" FROM "schema_version";
When you run a query in db2 commandline tool you get explanations like:
db2 => select * from sysibm.systables where owner = 'SAM' and type = 'T';
SQL0206N "OWNER" is not valid in the context where it is used.
SQLSTATE=42703
However, when ran in SQL tab in SquirrelSQL you get only:
Error: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=OWNER, DRIVER=4.13.127
SQLState: 42703
ErrorCode: -206
Does anybody know of a way of making SquirrelSQL display explanation for the error code like db2 cmd line?
OS: Win 7 x64, db2 10.1
There's a bug in DB2 plugin, I have managed to fix it and posted solution at http://sourceforge.net/p/squirrel-sql/bugs/1073/