Visual Basic - sentencia FOR UPDATE NOWAIT

Life is soft - evento anual de software empresarial
 
Vista:

sentencia FOR UPDATE NOWAIT

Publicado por Iñigo (4 intervenciones) el 19/10/2001 08:53:15
El Problema es que desde Vb no consigo mandar la select... for update, por algun motivo el “for update” se borra de la sentancia sql al pasarlo a oracle. La funcion de visual basic es la siguiente:

Public Function EjecutaSQLConBloqueo(ByVal vSentencia As String, Optional vRs As Variant) As EErrConexion

Dim RdoQy As rdoQuery
Dim lIndice As Integer
Dim InstruccionSql As String
Dim m_bloqueado As Boolean
Dim StrBloqueo As String
Dim strError As String
Dim MiError As String

On Error GoTo EjecutaSQLConBloqueoErr

gConexion.BaseDeDatos.BeginTrans

EjecutaSQLConBloqueo = SQL_ENCONTRADO

If mbWaitCursor Then Screen.MousePointer = 11

'Sentencia de bloqueo
StrBloqueo = " FOR UPDATE NOWAIT"

If IsMissing(vRs) = True Then
'Estamos ejecutando una sentencia de insercion, borrado, o modificacion
'no se le añade la sentencia "FOR UPDATE" ya que las sentencias de inserción,
'borrado o modificación bloquean automaticamente los registros

mBasedeDatos.Execute vSentencia, rdExecDirect

On Error GoTo 0
If mbWaitCursor Then Screen.MousePointer = 0
Exit Function
Else
'Estamos ejecutano una consulta

Set RdoQy = New rdoQuery
With RdoQy
Set .ActiveConnection = mBasedeDatos
.SQL = UCase(vSentencia & StrBloqueo)
.LockType = rdConcurReadOnly
.CursorType = rdOpenForwardOnly
End With
Set vRs = RdoQy.OpenResultset()
Set RdoQy = Nothing

'Comprobar si la consulta devuelve algun registro
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:sentencia FOR UPDATE NOWAIT

Publicado por Iban Atxutegi (1 intervención) el 19/10/2001 15:16:28
prueba con la conexion del lado del servidor, y el cursor en modo pesimista.
ejemplo:
tipo de conexion:
mBasedeDatos.CursorDriver = rdUseServer
sql:
'Estamos ejecutano una consulta

Set RdoQy = New rdoQuery
With RdoQy
Set .ActiveConnection = mBasedeDatos
.SQL = UCase(vSentencia & StrBloqueo)
.LockType = rdConcurLock
.CursorType = rdOpenForwardOnly
End With
Set vRs = RdoQy.OpenResultset()
Set RdoQy = Nothing

suerte.

Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar