Go Premium for a chance to win a PS4. Enter to Win

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

syntax read help

I am reading the code for this vb app and I came across this line..

 stSQL = "{native 'CALL WINS_SET_PARMS CurrentDate=" & cboMonth.Text & "/" & cboDay.Text & "/" & cboYear.Text & "'}"
 RunSQL(stSQL, stConn)

can someone interpret what the native call mean...?
  • 2
  • 2
  • 2
1 Solution
>>stSQL = "{native 'CALL WINS_SET_PARMS CurrentDate=" & cboMonth.Text & "/" & cboDay.Text & "/" & cboYear.Text & "'}"

is a sql statement of some sort

 >>RunSQL(stSQL, stConn)

RunSQL is obviously some kind of function that takes two parameters: sql statement and database connection string and then executes sql statement against the database
RunSQL could be implemented something like that in VB.NET:

Sub RunSQL(ByVal strConn As String, ByVal query As String)
        Dim conn as SqlConnection

            conn = New SqlConnection(strConn)
            Dim cmd As SqlCommand = New SqlCommand(query, conn)
        Catch ex As SqlException
            Console.Write("SQL ERROR: " & ex.Message)
        Catch ex As Exception
            Console.Write("ERROR: " & ex.Message)
        End Try
    End Sub

Jeff CertainCommented:
If I had to guess, I'd say it's a convoluted way of making a system call from the database to set the system date/time.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

zachvaldezAuthor Commented:
Thanks, I understand the RUNSQL function, but what I dont get is the

"{native 'CALL WINS_SET_PARMS ....

This ia my first time to see this type use in a string
Jeff CertainCommented:
Again, it's probably a call to the system to set the date and time.
zachvaldezAuthor Commented:
Is there  a need to use it or rather can a VB code handle it?

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now