MRPG MRPG - 5 months ago 51
Vb.net Question

JavaScript critical error at line 120, column 85 in http://localhost:50754/page.aspx SCRIPT1015: Unterminated string constant

I have a following code in visual basic. When I call it on a button click event I get the error 'SCRIPT1015: Unterminated string constant'. Can I use PL/SQL like this from vb code:

strInsert = "DECLARE "
strInsert = strInsert + " in_xml_value varchar2(32767) "
strInsert = strInsert + " BEGIN "
strInsert = strInsert + " in_xml_value := "
strInsert = strInsert + " '" + dv1.Table.Rows(j).Item("XML_Report")
strInsert = strInsert + "' " + "INSERT into Report (ID,USER, XML_Report)"
strInsert = strInsert + " VALUES(" + CStr(dv1.Table.Rows(j).Item("ID"))
strInsert = strInsert + ", '" + dv1.Table.Rows(j).Item("USER")
strInsert = strInsert + "', XMLTYPE.CREATEXML(in_xml_value)" + ");"
strInsert = strInsert + " commit; "
strInsert = strInsert + " END; "
clsREPORTS.strInsert = New SqlTypes.SqlString(strInsert)


When debug I get this error:

ORA-06550: line 1, column 40:

PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:

:= ; not null default character

The symbol ";" was substituted for "BEGIN" to continue.

ORA-06550: line 1, column 4078:

PLS-00103: Encountered the symbol "INSERT" when expecting one of the following:

* & = - + ; < / > at in is mod remainder not rem

<an exponent (**)> <> or != or ~= >= <= <> and or like like2

like4 likec between || multiset memb

Answer
strInsert = strInsert + " in_xml_value varchar2(32767) "

This should be with semicolon at the end. So it becomes :

strInsert = strInsert + " in_xml_value varchar2(32767) ;"

Also every statement should end with semicolon so you need to have one before your INSERT too.