DataStage gives error using partitioned reads to Netezza - netezza

Very often we are unable to use Partitioned reads in Netezza connector.
Example
When partitioned read = Yes and Generated SQL at Runtime = Yes this works:
SELECT "Firma", "KundeNr", "ArtikkelNr"," LagerstedNr"
FROM dwhusr."TI_FT_Salg"
When Generated SQL at Runtime = No and the query is Autogenerated by DataStage (or we write it our selves) the query looks like this:
SELECT "Firma", "KundeNr", "ArtikkelNr"," LagerstedNr"
FROM dwhusr."TI_FT_Salg"
WHERE mod(datasliceid,[[node-count]])=[[node-number]]
It will then throw an error:
DB_TI_FT_Salg: Unexpected ODBC error occurred. Reason: [SQLCODE=42000][Native=27] ERROR: 'SELECT "Firma", "KundeNr", "ArtikkelNr"," LagerstedNr" FROM dwhusr."TI_FT_Salg" where mod(datasliceid,[[node-count]])=[[node-number]] limit 0'
error ^ found "[" (at char 102) expecting an identifier found a keyword (CC_NZMetadataHelper::describeResultSet, file CC_NZMetadataHelper.cpp, line 5 622)
Please help!

Related

PHP PDO Select Format AS Too few parameters

I have the following code:
$extracting = $dbNew->query("SELECT *, Format(Date_Sheet, 'Short Date') AS modifiedDate FROM AccessDB WHERE modifiedDate LIKE '%2021%'");
Having the following error:
Fatal error: Uncaught PDOException: SQLSTATE[07002]: COUNT field incorrect: -3010 [Microsoft Access Driver] Too few parameters. Expected 1.
The problem is the "modifiedDate" because if I replace it with the "Date_Sheet" access field after the database table, I can run the query without issues.
Thank you in advance!

How to find table and column in DB2 with tbspaceid tableid specified in error message

I get following error message when trying to insert an object in the database:
com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException:
DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=2,
TABLEID=19, COLNO=0, DRIVER=4.15.134
How can I retrieve the table/column name for which the error is thrown?
Apparently at the package level, DB2 only works with the IDs and not the names.
You can find them back using the following query:
SELECT C.TABSCHEMA, C.TABNAME, C.COLNAME
FROM SYSCAT.TABLES AS T,
SYSCAT.COLUMNS AS C
WHERE T.TBSPACEID = 2
AND T.TABLEID = 19
AND C.COLNO = 0
AND C.TABSCHEMA = T.TABSCHEMA
AND C.TABNAME = T.TABNAME

!= OR <> OR NOT IN Operators Supports in ODATA?

i have the query for external object named as test__x.
I am writing the query to get the data using OData 4.0 in external data sourse by applying the NOT EQUAL TO logic with != OR <> OR NOT IN operators then facing an error stating as below.
SQL:
select id,status__c from current_year_order_summary__x where status__c NOT IN('C') LIMIT 2000
Error:
"Error received from the external system: 500:
com.informatica.cloud.api.adapter.runtime.exception.ReadException:
java.sql.SQLException: [Teradata Database] [TeraJDBC 15.10.00.14]
[Error 3707] [SQLState 42000] Syntax error, expected something like a
'SUCCEEDS' keyword or a 'MEETS' keyword or a
'PRECEDES' keyword or an 'IN' keyword or a
'CONTAINS' keyword between the word 'status__c ' and
'|'."
In OData 4, the equality and inequality operators are eq and ne.

Netezza DISK_FPGA_ERROR

I'm using Netezza with following information:
Model: N3001-010
NPS Software version: 7.2.0.6-P1
When I try to query with simple statements such as:
select count(*) from table_name;
or
select * from table_name where date_col>='2015-12-01' and date_col<='2015-12-30' limit 1000;
the raised error is:
ERROR [HY000] ERROR: DISK_FPGA_ERROR : Status=0,0x4000
[COMPBADFIELDTYPE1] SPU=1010 Dev=31 Eng=11 LBA=32224515
This error does not occur systematically.
How can I fix this error?
This error can indicate a disk page corruption, or some other fundamental issue, and your administrator should immediately open a support ticket to investigate and resolve this. T

Sybase SQL Anywhere - Unable to export data to file

I am attempting to export a query in Sybase SQl Anywhere but am receiving an error when getting to the OUTPUT TO command. My query looks like this:
SELECT User_Name as 'Remote Database', nDaysBehind as 'Days Behind', Time_Received as 'Last Message Received'
FROM DailySynchRptView
WHERE Time_Received < today() -1 AND nDaysBehind > 0
ORDER BY Time_Received ASC
OUTPUT TO c:\daysbehind.txt format ascii
The information that shows up in ISQL when I leave off the "OUTPUT TO" is the following:
Remote Database,Days Behind,Last Message Received
'Rem00027',23,'2011-02-23 16:10:14.000'
'Rem00085',7,'2011-03-11 04:47:02.000'
'Rem00040',5,'2011-03-13 15:22:15.000'
'Rem00074',4,'2011-03-14 16:01:25.000'
'Rem00087',3,'2011-03-15 06:04:16.000'
However, when the OUTPUT TO command is placed in the query, I receive the following error:
Could not execute statement.
Syntax error near 'OUTPUT' on line 5
SQLCODE=-131, ODBC 3 State="42000"
Line 1, column 1
I am open to any suggestions that might help me be able to export the data from the query. I have ran a similar query that returns a single line of information and it does export without errors.
After a while looking at the code, I found that I was missing a semi-colon ; to separate the two sets of commands. Once I added the semi-colon before the OUTPUT line, I was able to export the information.

Resources