SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Netezza odbc driver suddenly disconnects

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Netezza odbc driver suddenly disconnects
Author Message
GeneW



Joined: 10 Apr 2012
Posts: 19
Country: United States

Post Netezza odbc driver suddenly disconnects Reply with quote
I have been using sql assistant 9.0.162 Professional and was testing some Netezza queries - suddenly started getting an error like this:
Quote:
Prepare: ODBC Error (46): SQLPrepareW
Client: Release 7.2.1.2 [Build 47843]
Server: 07.02.0001 Release 7.2.1.2 [Build 47843]
SQL State: HY000
ERROR: Permission denied on "_T_USER".;

select distinct u.usename as schemaname, 'SC' as schematype, u.usesysid as schemaid
from _t_object AS o
join _t_user AS u
on u.usesysid = o.objowner
join _t_object_classes AS c
on c.objclass = o.objclass
where o.objdb in (SELECT 0::OID as objid
UNION ALL
SELECT d.oid
FROM _t_database AS d
WHERE d.datname = ? )
and c.classname IN ('TABLE',
'VIEW',
'MATERIALIZED VIEW',
'SEQUENCE',
'EXTERNAL TABLE',
'PROCEDURE',
'TRIGGER',
'FUNCTION',
'SYNONYM',
'SYSTEM TABLE',
'SYSTEM VIEW',
'SYSTEM SEQ',
'SYSTEM MVIEW',
'MANAGEMENT TABLE' )
and o.objclass > 0


I also have Aginity installed and I am not getting these connection errors with it. Normally I can run both side-by-side, both using odbc driver to connect to the Netezza box. In SQL Assistant the error pops up when I click on any of the databases in the object explorer tree. I have tried closing the SQL Editor and using the context menu in the notification panel to exit sql assistant completely - then restarting it, but it still throws the error.
Fri Oct 14, 2016 6:48 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
This error says ERROR: Permission denied on "_T_USER".;

The _t_user is referenced in the query

Quote:
select distinct u.usename as schemaname, 'SC' as schematype, u.usesysid as schemaid
from _t_object AS o
join _t_user AS u
on u.usesysid = o.objowner

join _t_object_classes AS c
on c.objclass = o.objclass
where o.objdb in (SELECT 0::OID as objid
UNION ALL
SELECT d.oid
FROM _t_database AS d
WHERE d.datname = ? )
and c.classname IN ('TABLE',
'VIEW',
'MATERIALIZED VIEW',
'SEQUENCE',
'EXTERNAL TABLE',
'PROCEDURE',
'TRIGGER',
'FUNCTION',
'SYNONYM',
'SYSTEM TABLE',
'SYSTEM VIEW',
'SYSTEM SEQ',
'SYSTEM MVIEW',
'MANAGEMENT TABLE' )
and o.objclass > 0



I noticed you work with NZ 7.2. the query above is for 7.0 only. Please verify you use factory default SQL Assistant settings. The equivalent query in SQL Assistant settings for NZ version 7.1 and 7.2 is below

Code:
select distinct o.objname as schemaname, 'SC' as schematype, objid as schemaid
from _t_object as o
      join _t_object_classes as c
         on c.objclass = o.objclass
where c.classname = 'SCHEMA'
  and o.objdb in (SELECT 0::OID as objid
               UNION ALL
               SELECT d.oid
               FROM _t_database AS d
               WHERE d.datname = :DB_NAME)


As you can see, it does not refer to _t_user
Sat Oct 15, 2016 12:24 pm View user's profile Send private message
GeneW



Joined: 10 Apr 2012
Posts: 19
Country: United States

Post Reply with quote
That seems to have fixed it. Thanks!
Sat Oct 15, 2016 2:49 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.