Informatica cannot call siebel.s_sequence_pkg.get_next_rowid function - informatica

I am using informatica to extract data using a simple query:
SELECT ' ' as ACTIVE_CTI_CFG_ID, siebel.s_sequence_pkg.get_next_rowid AS ACTIVE_TELESET_ID from dual.
I am able to run this query using Toad.
siebel.s_sequence_pkg.get_next_rowid is a siebel ROW_ID function which I am calling in my SQL query. There is no syntax issue in the query because I can run this SQL on Toad. I am using same user credentials in Toad and informatica.
Unfortunately, informatica is throwing an error during run:
[‎5/‎5/‎2015 3:46 PM] Reddy, Kishore:
Severity Timestamp Node Thread Message Code Message
ERROR 5/5/2015 3:41:35 PM node01_MOCODEVINF01 READER_1_1_1 RR_4035 SQL Error [
ORA-00904: : invalid identifier
Database driver error...
Function Name : Execute
SQL Stmt : SELECT ' ' as ACTIVE_CTI_CFG_ID, siebel.s_sequence_pkg.get_next_rowid AS ACTIVE_TELESET_ID from dual
Oracle Fatal Error
Database driver error...
Function Name : Execute
SQL Stmt : SELECT ' ' as ACTIVE_CTI_CFG_ID, siebel.s_sequence_pkg.get_next_rowid AS ACTIVE_TELESET_ID from dual
Oracle Fatal Error].
I understand this is an oracle SQL error but why I can run this query in Toad but not in informatica?

I would first check that you are connecting to the same database as the same user in both cases.

Related

Unable to connect snowflake query to power bi - Syntax

I have this query in snowflake. The query works fine in snowflake, but when i am trying to connect it to Power Bi, I get the Native error query. The error usually pops up when there's a syntax error. I can't find any syntax error here.
Any help would be appreciated as why there's an error.
Error: Native Queries aren't supported by this value.
WITH POLICIES AS(
SELECT DISTINCT a.POLICY_NUMBER
,c.DST
,d.DOB
,b.ENROLLED_RPM
,b.RATED_STATE
,a.EVENT_TIMESTAMP
FROM PD_PRESENTATION.CUSTOMER.REQUEST_FLOW_EDGE_MOBILE_TIER as a
LEFT JOIN PD_ANALYTICS.SVOC.POLICY as b
ON a.POLICY_NUMBER = b.POLICY_NUMBER
LEFT JOIN PD_ANALYTICS.SVOC.POLICY_HAS_POLICYHOLDER_PERSON as c
ON b.ID = c.SRC
LEFT JOIN PD_ANALYTICS.SVOC.PERSON as d
ON d.ID = c.DST
WHERE a.USER_GROUP = 'Customer'
AND b.STATUS = 'InForce'
),
MaximumTime AS(
SELECT a.POLICY_NUMBER
,MAX(a.EVENT_TIMESTAMP) as MAXDATED
FROM POLICIES as a
GROUP BY a.POLICY_NUMBER
)
SELECT DISTINCT a.*
,b.DOB
,b.ENROLLED_RPM
,b.RATED_STATE
,c.PAPERLESSPOLICYSTATUS
,c.PARTIALPAPERLESSSTATUS
,c.PAYPLAN
,MAX(c.TENUREPOLICYYEARS) as TENURE
FROM MaximumTime as a
LEFT JOIN POLICIES as b
ON a.POLICY_NUMBER = b.POLICY_NUMBER
LEFT JOIN PD_POLICY_CONFORMED.PEAK.POLICY as c
ON a.POLICY_NUMBER = c.POLICY_NUMBER
GROUP BY a.POLICY_NUMBER
,a.MAXDATED
,b.DOB, b.ENROLLED_RPM
,b.RATED_STATE
,c.PAPERLESSPOLICYSTATUS
,c.PARTIALPAPERLESSSTATUS
,c.PAYPLAN
Based on googling I suspect that this is caused by the driver you are using (odbc).
If SQL is running fine in snowflake it means it's syntax is correct and there must be an error somewhere between powerbi and snowflake, rather than in your code.
You can try to execute your query and look at the query history in snowflake to check what is actually being executed on snowflake.
https://docs.snowflake.com/en/sql-reference/functions/query_history.html
SnowFlake & PowerBI "native queries aren't support by this value"
Maybe it is lowercase / uppercase issue as explained here:
https://community.powerbi.com/t5/Issues/Unable-to-query-case-sensitive-Snowflake-tables/idi-p/2028900
In debugging process I would advise you to pinpoint which part of query causes the error. It could be quotes you are using in first CTE, non uppercase table names, * character.

{InternalError}ERROR: Assert false - Invalid type: 705

based on https://pygresql.readthedocs.io/en/latest/contents/pg/adaptation.html
sql = "SELECT * FROM user_table WHERE login = %s AND passwd = %s"
db.query_formatted(sql, (login, passwd)).getresult()[0]
I reused this snippet of code to try to use the library SQL replacement as shown in this example:
import pg
pg.DB(*credentials)
sql = "select %s, %s from my.table limit 10"
c.query_formatted(sql, ("id", "event_time")).getresult()[0]
and trying to query a Redshift table.
Unfortunately I get this error message
{InternalError}ERROR: Assert
DETAIL:
-----------------------------------------------
error: Assert
code: 1000
context: false - Invalid type: 705
query: 9876543
location: tbl_trans.hpp:923
process: padbmaster [pid=6543]
-----------------------------------------------
which I really have no idea how to interpret.
I also tried to query with another client
select *
from stl_error
where pid = 6543;
but all I get is:
userid,process,recordtime,pid,errcode,file,linenum,context,error
100,padbmaster,2021-03-01 12:00:00,6543,1000,/home/ec2-user/padb/src/sys/tbl_trans.hpp,923,Assert,false - Invalid type: 705
Anyone knows what's the problem here? Any other suggestion?
Two problems here:
PyGreSQL does not officially support Redshift.
Though it may work, PyGreSQL was made for PostgreSQL only.
It doesn't contain any special provisions for Redshift and is only tested with PostgreSQL (the current version requires PostgreSQL 9 or newer).
The select list must be specified as literals specifying the columns: select id, event_time from ... Query parameters are only used to insert values into queries.

Informatica Database driver error with SQL stmt Select

Facing below error while executing the job in informatica TDM.
SQL error Table or view does not exist
Database driver error
Function name : Execute
SQL stmt : select t0.col name1 as "col name1", t0.col name2 as "col name2" from tablename t0
Oracle fatal error
Prepare failed
Rolling back all the targets due to fatal session error
There is an option in session > mapping > target. Edit session, go to 'Mapping' tab. Then select the target, go to properties section on right pane. scroll down and find 'table name prefix'. Mention your schema name there.

Django with Oracle database 11g

I am new to the python language and django. I need to connect the django to the oracle database 11g, I have imported the cx_oracle library and using the instant client for connecting oracle with django, but when i run the command manage inspectdb > models.py. I get error as Invalid column identifier in the models.py. How could i solve it. I have only 2 tables in that schema i am connecting?
"Invalid column" suggests that you specified column name that doesn't exist in any of those tables, or you misspelled its name.
For example:
SQL> desc dept
Name
-----------------------------------------
DEPTNO
DNAME
LOC
SQL> select ndame from dept; --> misspelled column name
select ndame from dept
*
ERROR at line 1:
ORA-00904: "NDAME": invalid identifier
SQL> select imaginary_column from dept; --> non-existent column name
select imaginary_column from dept
*
ERROR at line 1:
ORA-00904: "IMAGINARY_COLUMN": invalid identifier
SQL>
Also, pay attention to letter case, especially if you created tables/columns using mixed case and enclosed those names into double quotes (if so, I'd suggest you to drop tables and recreate them, without double quotes. If you can't do that, you'll have to reference them using double quotes and exactly the same letter case).
So - check column names and compare them to your query. If you still can't make it work, post some more information - table description and your code.
I've faced the same problem. The problem is that Django expects your table have primary key (ID), so when your table is without key, it returns Invalid columns identifier.
https://docs.djangoproject.com/en/2.1/topics/db/models/#automatic-primary-key-fields

SQL Error ORA-01002 not autocommit and loop

I'm using pro c/c++ in a unix environment. Inside a c function I create a simple select statement which is not inside a loop and autocommit is disabled.
This is the dynamic sql;
char sql_statement[200];
int num1, num2;
...
snprintf(sql_statement, sizeof(sql_sattement), "select column1, column2 from '%s' where num = '%d' and code_cfg = '%d'", "customer", 0, 0);
exec sql prepare instruction_to_execute from :sql_statement;
exec sql declare crs cursor for instruction_to_execute;
exec sql open crs;
exec sql fetch crs into :num1, :num2;
...
Executing this code gives me ORA-01002 error. As I said before, this code is not inside a loop and autocommit is off.
But if I write this code statically, works fine. Below the code:
EXEC SQL
SELECT column1, column2
INTO :num1, :num2
FROM CUSTOMER
where num = 0
AND code_cfg = 0;
SQL instruction is simple. For my understanding this code should be executed fine.
In SO I found some answers:
ORA-01002: fetch out of sequence C++
ORA-01002: fetch out of sequence
Hibernate error “ORA-01002” when persisting entity with custom Sequence Generator
ORA-01002: fetch out of sequence
java.sql.SQLException: ORA-01002: fetch out of sequence