Forum Discussion

teemu_selkala's avatar
teemu_selkala
Occasional Contributor
13 years ago

Error - ORA-00911: invalid character

Hi,



I have a list of queries in SQL in an excel to be executed in order to test our database. I try to read them out and do the queries with following code but keep getting this error on subject on bolded part, any ideas why?




function checkout()



{



var Conn



var Excel = Sys.OleObject("Excel.Application")



Conn= ADO.CreateConnection()



Conn.ConnectionString="My connection String";



Conn.Open();



Cmd = ADO.CreateCommand();



Cmd.ActiveConnection = Conn;



Cmd.CommandType = adCmdText;



Excel.Workbooks.Open("c:\\querys.xlsx")



var RowsCount = Excel.ActiveSheet.UsedRange.Rows.Count;



for(i=1;i<RowsCount;i++)



{



Cmd.CommandText = Excel.Cells(i,1)



Log.Message(Cmd.CommandText = Excel.Cells(i,1))

// Line below gives the error



RecSet = Cmd.Execute();



}



RecSet.Save("c:\\tietokanta.xml",1)



Conn.Close();



Excel.Quit()



}


2 Replies

  • teemu_selkala's avatar
    teemu_selkala
    Occasional Contributor
    I tried now to separate excel and query parts to own functions and now it gives another error :) Identifier is too long on same Cmd.Execute() part :(
  • teemu_selkala's avatar
    teemu_selkala
    Occasional Contributor
    Ah - this was the matter of ';' in the end of SQL query in my excel - as such it was correct but when added through script it caused an issue :).