Forum > Databases
ORA-00933 SQL command not specifically terminated. Zeos or SQLdb + Oracle
babycode:
Good afternoon sirs,
I have a Data Module with ZConnection and a ZQuery with SQL:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---select * from COMPANY.clients;
When I activate the query at design or run time I receive the error: "ORA-00933 SQL command not specifically terminated."
I ran the query creating the objects at run time and the problem does not occur:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TfrmPrincipal.Button1Click(Sender: TObject);var Connection: TZConnection; Query: TZQuery;begin Connection := TZConnection.Create(nil); try Connection.Protocol := 'oracle'; Connection.HostName := 'LOCALHOST'; Connection.Database := 'DATABASE_COMPANY_A'; Connection.User := 'USER'; Connection.Password := 'masterpass'; Connection.LibraryLocation:='oci.dll'; Connection.Connected := True; Query := TZQuery.Create(nil); try Query.Connection := Connection; Query.SQL.Text := 'SELECT * FROM COMPANY.clients WHERE CODCLI = 123456'; Query.Open; // Processar os dados while not Query.EOF do begin ShowMessage(Query.FieldByName('NAME').AsString); Query.Next; end; finally Query.Free; end; finally Connection.Free; end;end;
The problem occurs with both Zeos and SQLdb
dseligo:
Try without semicolon at the end. In your 2nd example (which works) you don't have semicolon.
babycode:
Hello, thanks for responding. I tried without the semicolon.
dseligo:
And what if you (in runtime) try:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Query.SQL.Text := 'SELECT * FROM COMPANY.clients WHERE CODCLI = 123456';Query.Open;
Also, try to make one component in runtime, and other one at design time (i.e. create TZConnection at runtime, and put your TZQuery in Datamodule).
Then at runtime (without creating TZQuery):
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- Query.Connection := Connection; Query.SQL.Text := 'SELECT * FROM COMPANY.clients WHERE CODCLI = 123456'; Query.Open;
If it works when you all create at runtime, I bet the error is somewhere in your code or component setup.
Did you set Connected of TZConnection to false before running application?
Zvoni:
Errr...... isn't the delimiter to separate schema/namespace from table a colon in Oracle?
Navigation
[0] Message Index
[#] Next page