Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7949825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:05:17+00:00 2026-06-04T02:05:17+00:00

I have a function in VB.NET that runs a query from an MS SQL

  • 0

I have a function in VB.NET that runs a query from an MS SQL DB, puts the results into temporary variables, then updates an Oracle DB. My question is, if the string in the MS SQL contains a single quote ( ‘ ), how do I update the Oracle DB for something that has that single quote?

For example: Jim’s request

Will produce the following error: ORA-01756: quoted string not properly terminated

The ueio_tmpALM_Comments (coming from MS SQL) is the culprit that may or may not contain the single quote.

update_oracle =
"update Schema.Table set ISSUE_ADDED_TO_ALM = '1'," & _
"ISSUE_COMMENTS = '" & ueio_tmpALM_Comments & "'," & _
"where ISSUE_SUMMARY = '" & ueio_tmpALM_Summary & "' "
Dim or_cmd_2 = New NetOracle.OracleCommand(update_oracle, OracleConn)
or_cmd_2.ExecuteNonQuery()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:05:18+00:00Added an answer on June 4, 2026 at 2:05 am

    From your question it’s clear that you are building the update query using string concatenation.
    Something like this

    Dim myStringVar as string = "Jim's request"
    Dim sqlText as String = "UPDATE MYTABLE SET MYNAME = '" + myStringVar + "' WHERE ID = 1"
    

    this is a cardinal sin in the SQL world. Your code will fail for the single quote problem, but the most important thing is that this code is subject to Sql Injection Attacks.

    You should change to something like this

    Dim cmd As OraclCommand = new OracleCommand()
    cmd.Connection = GetConnection()
    cmd.CommandText = "UPDATE MYTABLE SET MYNAME = :myName WHERE ID = 1"
    cmd.CommandType = CommandType.Text
    cmd.Parameters.AddWithValue(":myName", myStringVar)
    cmd.ExecuteNonQuery()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application in vb.net that starts with a sub function do some
In .NET, the Generics Lists have a sort function that accepts IComparer or Comparison
Does .NET have some type of built in function that allows filtering on Gridviews?
We have a web application that runs on IIS using .NET 2.0 developed and
I have an application that runs on an English-US ASP.NET server (English installation of
I have a very simple asp.net mvc3 app that uses jquery::getJSON to call into
I have a function in the code behind of an ASP.NET webpage that creates
I have .NET and C++ implementations of a perf test function that does 854,750
I have a function that gets response over http. It runs some tests. Lately
I am using visual studio 2008, asp.net.vb I have various functions; 1 that calculates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.