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 7792321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:08:56+00:00 2026-06-01T22:08:56+00:00

After reading from a text file , I am trying to connect to SQLplus

  • 0

After reading from a text file , I am trying to connect to SQLplus with a value stored in a variable and trying to update a table but I am getting below error : ” Unterminated String constant
Here is what code looks like, thanks to Guido for helping me out on Step 1.
Can anyone please point out the error . Some error inside If & Else Part , the SQL query or connection is wrong

dim fs, txt, line, yesno , cust_id
set fs = CreateObject("Scripting.FileSystemObject")
set txt = fs.OpenTextFile("E:\batchfiletest\Eapp3\scotia1.txt", 1, false) 

' loop through all the lines
do while not txt.AtEndOfStream
    line = txt.readLine

' read the character and store it in a variable
    yesno = Mid(line, 127, 1)
    cust_id = Mid(line, 1,20)   

' execute the correct query
    if yesno = "Y" then

    set WshShell = CreateObject("WScript.Shell")
    set oEnv=WshShell.Environment("Process") 
    cmdString = "E:\oracle\product\10.2.0\db_1\BIN\sqlplusw.exe -S sysman/csaadmin@convcsd

    UPDATE csa_sli_all.T_CONV_quote set HOLD_CODE = 'CAQ' where quote_id =  cust_id ;
    commit;"

    Set oExec = WshShell.Exec(cmdString)

     ELSE  
    set WshShell = CreateObject("WScript.Shell")
    set oEnv=WshShell.Environment("Process") 
    cmdString = "E:\oracle\product\10.2.0\db_1\BIN\sqlplusw.exe -S sysman/csaadmin@convcsd

    UPDATE csa_sli_all.T_CONV_quote set HOLD_CODE = 'PVQ' where quote_id =  cust_id ;
    commit;"

    Set oExec = WshShell.Exec(cmdString)

    end if
loop
MsgBox "Press OK to close when done reading the output."
  • 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-01T22:08:58+00:00Added an answer on June 1, 2026 at 10:08 pm

    the normal faster and safer way to do this is like

    Const sConnectionStringOracle =  "Provider=OraOLEDB.Oracle;Data Source=xxxx.xxxxx;User id=xxx;password=xxx"
    Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.open sConnectionStringOracle
    sql = "UPDATE csa_sli_all.T_CONV_quote set HOLD_CODE = 'CAQ' where quote_id = " & cust_id
    oConn.execute(sql)
    'rest of the database transactions
    oConn.close
    Set oConn = nothing
    

    You can add error trapping, logging etc.
    Just make sure you have the Oracle OleDb driver installed on the pc you use this.
    If you need to use Sql*Plus then write all the transactions to one sql textfile and have that run just once. You can then execute and debug the sql in case of errors.

    Grtz

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to unpackage gcc-4.4_4.4.3.orig.tar.gz. After reading 5 sites from Google to do
I am trying to obtain the ip address from a text file so when
I'm trying to just get rid of duplicate consecutive words from a text file,
gcc 4.4.4 c89 I am reading in from a text file and the text
I am reading in a String from a text file which contains a date
I am reading a plain text from a file - by lines, with a
I have a text file that I am reading in python . I'm trying
I am reading from a text file line by line. StreamReader reader = new
I am reading a text file from a URL and want to parse the
I'm trying to read data from a text file, clear it, and then write

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.