ORA-00942 TABLE DOES NOT EXIST error occurring in System.Data.Oracleclient. VB.NET

Asked

Viewed 1,549 times

0

I have an application in using .Net Framework 2.0.

Below is an excerpt from my application code:

strComando = "SELECT CD_LOCALIDADE, NO_LOCALIDADE FROM COPAGIS_GDB.MUB_LOCALIDADES WHERE FL_IMPLANTADO='S' ORDER BY NO_LOCALIDADE"
fsOarquivo.WriteLine(strComando)
pComando = _controleAcessoDados.ProxyBD.MontarComando(strComando)
fsOarquivo.WriteLine(pComando.CommandText)
dataAdapter = New OracleDataAdapter(pComando)
fsOarquivo.WriteLine(dataAdapter.SelectCommand.CommandText)
dataAdapter.Fill(tblTabelas)
fsOarquivo.WriteLine(tblTabelas)

The execution of this part of the code produces the error

ORA-00942: Table or view does not exist

in charge

dataAdapter.Fill(tblTabelas)

I used sqlnet to generate a trace to show what the oracle client is receiving from the application. Follow the trace snippet below.

imagem do trace do sqlnet

Note in the attached sqlnet trace image that the SQL code is modified in the trace file. The number '5' has been included in the table name.

Can anyone tell me why this is happening? I’m using System.Data.OracleClient microsoft.

  • 1

    Do two checks: First Is there really a Table? Second, check pWith if the string was not changed before entering Oracledataadapter... I don’t think it is the Adapter that is changing your query... it may be likely that the Montarcomando is doing this, but just check to be sure

  • Thanks for the return.

  • Thanks for the feedback. I already did this conference. I attached an image of the trace file produced by SQLNET where it shows the modified SQL command.

  • Another interesting fact related to this problem. Its running the application from within the visual studio works without error. Your run out of visual studio error occurs.

  • You are running out of vs in the same machine and environment, or different machine/environments?

  • On the same machine.

Show 1 more comment

1 answer

1

Also see if the user who logged in to the BD is the OWNER of the table, not being and not wanting to change the select to something of the type

select * from owner.tabela

Also see if the login user has the slect grant of this table/view.

  • The user who logged in is Owner, consequently has Grant.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.