Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ORA-01756: quoted string not properly terminated
#1
Solved: 11 Years, 4 Months, 4 Weeks ago
I'm getting the following error:
[Oracle][ODBC][Ora]ORA-01756: quoted string not properly terminated
Line (27): "set Query = dbexample.execute(sql)".

My code is:
Code:
valueHID = Datatable.Value("HID_out")
sql = "SELECT rev_id FROM bh INNER JOIN clue ON bh.clue_id = clue.clue_id WHERE h_id = " & valueHID & "'"

set Query = dbexample.execute(sql)
Output Query.GetString
msgbox Output

Can anyone help me out on this one? What do I need to add to the end of my sql statement?
Reply
#2
Solved: 11 Years, 4 Months, 4 Weeks ago
I observed that you have an extra single quote (') at the end, what is that for? i think this is causing the issue.
what is the type of field 'h_id'? if its numeric then do not add single quote in your query while passing values.
or if this is varchar then use variable in single quote single quote

Your query should be like
Code:
sql = "SELECT rev_id FROM bh INNER JOIN clue ON bh.clue_id = clue.clue_id WHERE h_id = " & valueHID
or
Code:
sql = "SELECT rev_id FROM bh INNER JOIN clue ON bh.clue_id = clue.clue_id WHERE h_id = '" & valueHID & "'"

Reply
#3
Solved: 11 Years, 4 Months, 4 Weeks ago
h_id is a numeric field, yes. Thanks Saket! Works now...
Big Grin
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  VUser terminated akilamurugesh 0 2,417 08-13-2014, 11:21 AM
Last Post: akilamurugesh
  WPF DataGrid is not recognizing properly suvenduitc@gmail.com 0 3,298 02-13-2014, 03:27 PM
Last Post: suvenduitc@gmail.com
  ORA-06413: Connection not open soumen 1 3,848 12-13-2013, 11:17 AM
Last Post: soumen
  Replace a string in a word document with another string rekha.naik 8 15,582 11-14-2013, 12:58 PM
Last Post: pranikgarg
  QTP 10IS NOT WORKING PROPERLY AFTER INSTALLING THE PATCH IN WINDOW 7 raka54 1 2,700 09-29-2013, 12:10 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)