STRUCT TYPE ORACLE - Usando STRUCT para alterar dados da uma tabela

2 respostas
S

Olá
pessoal estou executando esse update, porem ele me dar um erro de runtime:

Oracle Error: 17074 - padrão de nome inválido: OBJ_TYPE_CITY

Obs:
Eu sou obrigado a trabalhar com esse tipo de objeto: oracle.sql.STRUCT

Alguem saberia me dizer o que esta rolando?

Grato

silva

======================alterando os dados =============

Object objArray[] = new Object[4];  
     objArray[0] = "SILVA";  
     objArray[1] = "SP";  
     objArray[2] = "1";  
     objArray[3] = "STRONG";

  // Create the StructDescriptor from the connection
     StructDescriptor colStructDesc =  StructDescriptor.createDescriptor("OBJ_TYPE_CITY", conn);      

    // Construct the Struct from the StructDescriptor and objects  
     oracle.sql.STRUCT colStruct = new STRUCT(colStructDesc,   conn, objArray);

    // Prepare the update statement using Prepared statement call 
     OraclePreparedStatement ps =       (OraclePreparedStatement)conn.prepareStatement("UPDATE TABLE_CITY_OBJ a SET a.OBJCITY = ? " +       "WHERE a.OBJCITY.CITY_CODE = ?");        

  // Bind the Object STRUCT and CITY CODE  to preparedstatement  
     ps.setSTRUCT(1, colStruct);  
     ps.setString(2, "1");  
     ps.executeUpdate();    // Execute the update statement

2 Respostas

C

Descobriu a causa deste erro?
Estou com o mesmo problema.
Obrigado.

magnus

Tb estou com o mesmo erro.
Silva, conseguiu resolver?

Criado 8 de agosto de 2007
Ultima resposta 3 de mar. de 2008
Respostas 2
Participantes 3