Postgres syntax error at or near "VALUESNSERT" - postgresql

We are trying to load the data from one postgres table to another postgres table in the same database using informatica. And we are having the following issue -
The error message is as follows:
Message Code: WRT_8229
Message: Database errors occurred:
FnName: Execute -- [Informatica][ODBC PostgreSQL Wire Protocol driver][PostgreSQL]ERROR: VERROR; syntax error at or near "VALUESNSERT"(Position 135; File scan.l; Line 1134; Routine scanner_yyerror; ) Error in parameter 6.
FnName: Execute -- [Informatica][ODBC PostgreSQL Wire Protocol driver][PostgreSQL]Failed transaction. The current transaction rolled back. Error in parameter 6.
FnName: Execute -- [DataDirect][ODBC lib] Function sequence error
It is working fine if we are not loading one of the string column which is of 3000 bytes. Can anyone please shed some light on this issue -
Note: There are no reserved/keywords in our table structure

if you have already identified the error-causing column then, you can follow below steps to find the root cause -
1. You can check the data type of the column in informatica - if it is matching to the target in DB in terms of length and data type.
2. Make sure you import the target from database. Creating target from other process or adding column to existing target can lead to such error.
3. run in verbose mode or debug to see where exactly its causing issue. Check if its reading, transforming, and loading data properly etc.
4. remove postgres target and attach a flat file - if this works then there is issue in database table. Check for index, constraints etc. which can lead to this issue.
5. Check ODBC version as well which may have lots of limitations like data type, length handling. ODBC is also not good at generating errors so you may have to do some guesswork etc to find out.

Thanks everyone. My issue got resolved after implementing Informatica PDO.

Related

How to remove Routine Group error from workbench?

I'm using MySQL Workbench and I am trying to create a routine. However, At the time of creating routine some error comes,then i deleted that routine. Now I synchronize the model with the existing database, the Routine group error is coming, though i remove that routine group. Can anyone help me how to remove this error from Model?
The _SYNTAX_ERROR suffix is added by MySQL Workbench to indicate that it found a syntax error in your routine code. Once you fixed that the name will change back to what you gave it. And then you can also synchronize your model.
I faced the same issue, cause i copy&pasted some c# code into a routine group, and it immediately became invisible by workbench. Synchronization now always reporte errors, even after deleting the whole routine group. The faulty code was stuck somewhere, inaccessible through the Workbench UI.
Just found a solution atm:
Do a regular synchronization and tell Workbench to change the sync-direction on the error entries. This will remove the faulty lines of code, even if they are not accessible through the Workbench UI.

ODBC: Export from Microsoft Access to Postgres fails

I have a large database that I am currently exporting from Microsoft Access (Version 2006 Build 13001.20384) to PostgreSQL 10.12 (Ubuntu 10.12-0ubuntu0.18.04.1). So far this worked very well, but I have problems with one particular table. When I start the export, I get the following error message:
ERROR: syntax error at or near '/';
Error while executing the query (#1)
Unfortunately I do not know how to deal with this error message and I have not found any information about this message on the Internet. Maybe someone here can help me.
[I copy my previous comment, since it contains useful content for the solution, so this question can appear as solved... and it contains also suggestions for someone in the future with the same problem.]
You say "with one particular table"... maybe the name of that table or a column name of that table is a keyword for postgresql and not for access (it seems the name contain a '/').
Try to split the import if you don't know the table to isolate the problem. E.g. divide the query in 2 halves, then do the same for the half that give the syntax error. If you update your question with the table definition that gives error we can help you find the exact problem if you can't figure it out.

Cached plan must not change result type

Our service team is getting the error Cached plan must not change result type sometimes when I modify the length of a column or add a new column in the table.
I tried solutions mentioned on Stack Overflow like Postgres: "ERROR: cached plan must not change result type"
I have tried autosave=conservative to resolve this issue but still, I am able to reproduce this issue. I used below JDBC connection string
jdbc-url: jdbc:postgresql://172.16.244.10:5432/testdb?autosave=conservative
why is this property not working in my case?
Also, I tested with prepareThreshold=0 and its working fine. But I think it will impact performance because it will never use client-side prepared statements.
I just want to know the best solution to avoid this error.

db2 ? lookup error db2 error code

I don’t know which is the shortest way to look at the error descriptions like “ERRORCODE=-4463, SQLSTATE=42601”
Generally I google such kind of error descriptions and I can get the result somewhat anyways.
But this turns out to be very inefficient, sometimes it is just difficult to get description regarding the error code and sql state.
I know the db2 built in command like : db2 ? SQL0443N will provide information about specific SQLCODE
But when encountered error description like that above , how do I turn that into a SQLCODE, so that I can lookup it quickly using db2 ?
what #Clockwork-Muse commented is definitely correct.
and I am now referring to these documents for the SQL codes and states. hmm neat
SQL ERROR CODE LOOKUP
SQL STATE CODE LOOKUP
Here is the link with different DB2 error codes https://urssanj00.wordpress.com/2008/03/04/db2-sql-error-code-and-description/
This saved me tons of hours!

When does SQL SELECT statements throw exceptions?

TSQL here. Specifically Server 2008(literally just upgraded)
Concerning stored procedures: Try/Catch
I was trying to make a list of cases when a Select Statement will throw an exception. The ones I can think of are syntax related(includes null variables) and divide by zero. I'm only guessing there are just a whole boat load of them for Insert/Alter and Create/Truncate.
If you happen to know of a good source link, that would be great.
This question came up when I was reading this exhaustive blog post about error handling for SQL server. It's titled for SQL Server 2000, but I think most of it still applies.
edit
Sorry, I meant to link this earlier. . .
http://msdn.microsoft.com/en-us/library/aa175920(v=sql.80).aspx
Outside for compile ("didnt' run") errors, you have at least these runtime errors
arithmetic errors
These change based on various SET statement
Example: get sql server to warn about truncation / rounding
overflow errors
example: one of the rows overflows smallint in some calculation
CAST errors
eg you try ISNUMERIC in a WHERE or CASE and try to cast 'bob^' or 1.23 to int
See Why use Select Top 100 Percent?
However, you'd always want to use TRY/CATCH though, surely...?
Adding to gbn's post, you can also get locking errors like lock wait timeouts and deadlocks.
If you are referencing #Temp tables, you can get "Invalid object name '#Temp'" errors, because these are unbound until the statement executes.
If you are in READ UNCOMMITTED or WITH (NOLOCK), you can get error: 601 - "Could not continue scan with NOLOCK due to data movement."
If your code runs .NET code, you would probably get exceptions from there.
If your code selects from a remote server, you could a whole different set of errors about connections.