Micro Focus QTP (UFT) Forums
ORA-01756: quoted string not properly terminated - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: ORA-01756: quoted string not properly terminated (/Thread-ORA-01756-quoted-string-not-properly-terminated)



ORA-01756: quoted string not properly terminated - egun - 08-25-2009

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?


RE: ORA-01756: quoted string not properly terminated - Saket - 08-26-2009

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 & "'"



RE: ORA-01756: quoted string not properly terminated - egun - 08-26-2009

h_id is a numeric field, yes. Thanks Saket! Works now...
Big Grin