'42S02', 'Invalid object name 'oh'.'; '42000', 'Must declare the scalar variable "@TABLENAME_header"

Document ID : KB000090450
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
'42S02', 'Invalid object name 'oh'.'; '42000', 'Must declare the scalar variable "@TABLENAME_header"
Resolution:
Detailed Description and Symptoms

When running the Automic DB.Load against a SQL Server database for the first time, the load abends and the following errors appear in the log file:

 

 

Deleted the db, and reran the load. The log is attached.
U0003590 DB error: 'SQLExecDirect', 'ERROR ', '42000', 'Must declare the scalar variable "@TABLENAME_header".'
U0038082 insert into oh (oh_client, oh_otype, oh_name, oh_idnr) VALUES (0,'CLNT','0000', 79)
U0029108 SQL_ERROR Database handles DB-HENV: 6524660 DB-HDBC: 6525330
U0003591 DB error info: Opc: 'SQLExecDirect' Return code: 'ERROR'
U0003592 Status: '42S02' Native error: '208' Msg: 'Invalid object name 'oh'.'
U0003594 UCUDB Ret: '3590' OpCode: 'EXEC' SQL Stmnt: 'insert into oh (oh_client, oh_otype, oh_name, oh_idnr) VALUES (0,'CLNT','0000', 79)'
U0003590 DB error: 'SQLExecDirect', 'ERROR ', '42S02', 'Invalid object name 'oh'.'

Investigation

?Run the following query against the SQL Server database:

 

SELECT CASE WHEN 'A' = 'a' THEN 'NOT CASE SENSITIVE' ELSE 'CASE SENSITIVE' END

 

This will return the results: "CASE SENSITIVE" or "NOT CASE SENSITIVE" 

 

 

 


Solution

?If the result to the query from the Investigation section is "CASE SENSITIVE," a DBA will need to correct this on the database and make the database not case sensitive.