LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database error -2147217865 for Execute Query VI

I am using the Database Connectivity Toolset to access a large Oracle database via complex SQL commands provided to me by a DB developer. It appears that I must use the DB Tools Execute Query VI followed by Fetch Record Set to return these potentially large tables. A very simple test command does work: [select sysdate from dual;]  so I know that my connection is ok.  I can also successfully use the List Tables VI to return all available table names.  However, when I execute an SQL command to read from a table [select count(*) from WO;] I get error -2147217865, saying that the table or view does not exist--but that table (WO) does appear in the array returned by List Tables. Other posts on this error point to connection problems or table name formatting problems, neither of which seem to apply to my situation. Ideas?
Gary Johnson
0 Kudos
Message 1 of 6
(2,753 Views)
Does the user that you are using to connect with have the appropriate permissions on the tables?

I have found this error message quite useless, as it is usually an issue with the SQL statement rather than the labview code.  Are you able to attempt to run your queries on the command line using the same user name to see that the query will in fact work?
0 Kudos
Message 2 of 6
(2,744 Views)

Can you check your query for any typos and also post the screen shot of your conenctions if possible?

See the below example image which works.

 

 

 

0 Kudos
Message 3 of 6
(2,740 Views)

I would also be looking for a permissions problem. Very often a permissions problem will be reported as the table not existing.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 6
(2,731 Views)
Problem solved!  Mike Porter gets the cigar: it was in fact a permissions problem. My database administrator fixed it, and now I'm in business. Thanks, guys.
Gary Johnson
0 Kudos
Message 5 of 6
(2,729 Views)

Actually, ctardi got it right first... I just stood up and said "amen".

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 6 of 6
(2,724 Views)