VB get cursor that returns a function in postgresql

0

I am using postgresql and vb, and I want to obtner in vb the result of a function that returns a cursor, but I have only been able to make it return the name of the cursor, and I do not want that, but the cursor data.

This is the code:

Sub BUSQUEDA(ByRef OBJ As Object, ByVal STR_VALOR As String, ByVal INT_TIPO As Integer, ByVal STR_OPERACION As String)
Dim CONECTION As New OdbcConnection
        Try

            CONECTION.ConnectionString = ConfigurationManager.ConnectionStrings("SEAU.My.MySettings.FARMACIA_ISABEL_DBConnectionString_64").ConnectionString + ";pwd=xxxxx"

            Dim COMMAND As OdbcCommand = New OdbcCommand(" SELECT SP_BUSQUEDA_DGV('" + STR_VALOR + "'," + CStr(INT_TIPO) + ",'" + STR_OPERACION + "','CURSOR_BUSQ'); " +
                                                         " FETCH ALL IN ""CURSOR_BUSQ"";", CONECTION)

Dim DA As New OdbcDataAdapter
            Dim DT As New DataTable

            CONECTION.Open()

            DA.SelectCommand = COMMAND
            DA.Fill(DT)

            OBJ = DT
            CONECTION.Close()
        Catch ex As Exception
            If (CONECTION.State = ConnectionState.Open) Then
                CONECTION.Close()
            End If

            Throw ex
        End Try
End Sub
    
asked by nasck 08.11.2017 в 00:52
source

0 answers