Teradata: tdload error - teradata

I get the following error for the following command:
tdload -f ./file.csv -t t1 -u u1 -p -d ',' --TargetWorkingDatabase db1 -h host1
file.csv is quite small (around 50k lines).
Error:
Teradata Load Utility Version 14.00.00.08
Password: **********
Teradata Parallel Transporter Version 14.00.00.08
TPT_INFRA: TPT04039: Error: TPT Job script source 'Generated SQL INSERT Stmt for DBS Table 'D_TBL001'' is empty.
Job script preprocessing failed.
Job terminated with status 8.
How do I go about debugging/fixing this?

Related

sql select statement over adb

I would like to have a batch file that runs a select statement over adb and returns the found rows.
This is the command that I use in my batch file:
adb shell "su -c sqlite3 /data/user_de/0/com.android.providers.telephony/databases/mmssms.db 'select * from sms;'"
The problem I have is, that my command produces an error:
Error: incomplete input
What I don’t understand is that the fallowing command works just fine:
adb shell "su -c sqlite3 /data/user_de/0/com.android.providers.telephony/databases/mmssms.db '.tables'"
This returns the tables from the database, as expected.
My guess is, that I need to escape some characters, the “;” maybe, but escaping it with \ or with ^ both did not work.
Any help would be greatly appreciated.
I guess you are using powershell, then escape the ;:
adb shell "su -c sqlite3 /data/user_de/0/com.android.providers.telephony/databases/mmssms.db 'select * from sms`;'"

Why am I getting a syntax error when trying to use -v flag for variables in psql command?

I'm trying to use the following psql command in a zsh shell to send a query to a database:
psql -Atx $mydburl -v myvar=1 -c "SELECT :myvar"
And I'm getting the following error:
ERROR: syntax error at or near ":"
LINE 1: SELECT :myvar
^
However, when I use a pipe, this works just fine:
echo "SELECT :myvar" | psql -Atx $mydburl -v myvar=1
And it produces the expected result of:
?column?|1
What is going on here?
That's as documented:
-c command
[...]
command must be either a command string that is completely parsable by the server (i.e., it contains no psql-specific features), or a single backslash command.

IIB v10.19 to Oracle DB through Windows 10 with JDBC throwing error

This is the code inside ESQL Compute node:
CREATE COMPUTE MODULE CalculatorMessageFlow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
--DECLARE var REFERENCE TO Environment.Variables;
DECLARE var1 INTEGER;
SET var1 = 2;
--SET var.profile[]=SELECT T.COLUMN1 FROM Database.AGCST.IIB AS T WHERE T.COLUMN1='test';
--SET OutputRoot.XMLNSC.ns:Result.ns:AddedValue=var.profile.COLUMN1;
INSERT INTO Database.AGCST.IIB (COLUMN2) VALUES (var1);
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
You can see SELECT queries are commented out. But dramatically, here select queries are working, insert queries are throwing below error:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>BIP3113E: Exception detected in message flow Calculator.CalculatorMessageFlow.SOAP Input (integration node TESTNODE_hghatak)</faultstring>
<detail>
<Text>BIP2230E: Error detected whilst processing a message in node 'Calculator.CalculatorMessageFlow.Calculator_msService.Extract'.
The integration node detected an error whilst processing a message in node 'Calculator.CalculatorMessageFlow.Calculator_msService.Extract'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error. : F:\build\slot3\S1000_P\src\DataFlowEngine\PluginInterface\ImbJniNode.cpp: 1269: ImbJniNode::evaluate: ComIbmSOAPExtractNode: Calculator/CalculatorMessageFlow#FCMComposite_1_2.gen/Calculator/Calculator_msService_CalculatorMessageFlow#FCMComposite_1_1
BIP2230E: Error detected whilst processing a message in node 'Calculator.CalculatorMessageFlow.Compute'.
The integration node detected an error whilst processing a message in node 'Calculator.CalculatorMessageFlow.Compute'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error. : F:\build\slot3\S1000_P\src\DataFlowEngine\SQLNodeLibrary\ImbComputeNode.cpp: 515: ImbComputeNode::evaluate: ComIbmComputeNode: Calculator/CalculatorMessageFlow#FCMComposite_1_7
BIP2488E: ('Calculator.CalculatorMessageFlow_Compute.Main', '10.3') Error detected whilst executing the SQL statement ''INSERT INTO Database.AGCST.IIB (COLUMN2) VALUES(var1);''.
The integration node detected an error whilst executing the given statement. An exception has been thrown to cut short the SQL program.
See the following messages for details of the error. : F:\build\slot3\S1000_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp: 767: SqlStatementGroup::execute: :
BIP2321E: Database error: ODBC return code '-1' using ODBC driver manager ''odbc32.dll''.
The integration node encountered an error when processing a database operation. The ODBC return code was '-1'. See the following messages for information obtained from the database concerning this error.
Use the following messages to determine the cause of the error. Typical problems are an incorrect datasource or table names. Correct either the database or integration node configuration. : F:\build\slot3\S1000_P\src\DataFlowEngine\MessageServices\ImbOdbc.cpp: 3817: ImbOdbcStatement::checkRcInner: :
BIP2322E: Database error: SQL State ''IM001''; Native Error Code '0'; Error Text ''[Microsoft][ODBC Driver Manager] Driver does not support this function''.
The error has the following diagnostic information: SQL State ''IM001'' SQL Native Error Code '0' SQL Error Text ''[Microsoft][ODBC Driver Manager] Driver does not support this function''
This message may be accompanied by other messages describing the effect on the integration node itself. Use the reason identified in this message with the accompanying messages to determine the cause of the error. Use the mqsicvp command to test connectivity to this database. : F:\build\slot3\S1000_P\src\DataFlowEngine\MessageServices\ImbOdbc.cpp: 4038: ImbOdbcStatement::checkRcInner: :</Text>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Configured ODBC first, later deleted that and configured jdbc. Same error "Driver does not support this function":
ODBC Commands---
mqsisetdbparms TESTNODE_hghatak -n ADACDev -u AGCST -p pEpsico6
mqsireload TESTNODE_hghatak
mqsicvp TESTNODE_hghatak -n ADACDev
JDBC Commands---
--SET BROKERNAME=TESTNODE_hghatak
--SET PROVIDERNAME=ADACDev
MQSIDELETECONFIGURABLESERVICE TESTNODE_hghatak -c JDBCProviders -o ADACDev
mqsicreateconfigurableservice TESTNODE_hghatak -c JDBCProviders -o ADACDev -n connectionUrlFormat,connectionUrlFormatAttr1,databaseName,databaseType,databaseVersion,jarsURL,portNumber,securityIdentity,serverName,type4DatasourceClassName,type4DriverClassName -v "jdbc:oracle:thin:[user]/[password]#[serverName]:[portNumber]:[connectionUrlFormatAttr1],"AGDEV1","8","Oracle","11.2","C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib","1522","mySecurityIdentity",10.6.5.10,"oracle.jdbc.xa.client.OracleXADataSource","oracle.jdbc.OracleDriver"
MQSISETDBPARMS TESTNODE_hghatak -n jdbc::mySecurityIdentity -u AGCST -p pEpsico6
MQSISETDBPARMS TESTNODE_hghatak -n odbc::ADACDev -u AGCST -p pEpsico6
mqsichangeproperties TESTNODE_hghatak -c JDBCProviders -o ADACDev -n securityIdentity -v mySecurityIdentity
mqsireportproperties TESTNODE_hghatak -o ADACDev -c JDBCProviders -r
mqsireload TESTNODE_hghatak
mqsicvp TESTNODE_hghatak -n ADACDev
Commands Used for Deleting before Recreation 4 ODBC+JDBC---
mqsisetdbparms TESTNODE_hghatak -n ADACDev -d
mqsisetdbparms TESTNODE_hghatak -n jdbc::mySecurityIdentity -d
mqsisetdbparms TESTNODE_hghatak -n odbc::ADACDev -d
What can be the issue?
Thanks buddies...Problem I could identify.."EnableSQLDescribeParam" I had to switch on in the ODBC 64 connection...it resolved the issue.

get teradata tpt job name after script execution

I am executing tpt jobs in script 24/7 from powershell with this command
cmd /c tbuild.exe -f $tptfile -v $configFile -j $jobname >> $logFile
When I check TPT folder for logs it adds job sequence number at the end of my jobname variable so I cannot work with that job. Is there any way how to disable adding job sequence number, or how to get exact job name after execution?

UNIX script able to run manually but not via crontab

I have created unix script to connect to Oracle Database and pull some data. When i run the script manually, it works perfectly fine but when it runs the cron, it is throwing SQL error.
Cron entry:
05 14 * * mon-fri /home/test.sh >& /home/test.log
Script:
#!/bin/ksh
. /home/common_profile
log_Path="/home/Logs"
SQLfile1="/home/Sql/Query.sql"
database=$ORA_SVR
user=$ORA_ID
passwd=$ORA_PWD
echo "---------------------"
echo "Connecting to Database : $database"
echo "spool $log_Path/SQL_Output.log
select count(*) from table where lbd='20180221';
spool off
quit" > $SQLfile1
$ORACLE_HOME/bin/sqlplus -S -L $user/$passwd#$database #$SQLfile1
cat $log_Path/SQL_Output.log
The problem is $log_Path/SQL_Output.log is not getting updated and instead shows the some SQL errors.
I have checked ORACLE_HOME as well and its pointing correctly. Please advise

Resources