ExecSQL + Oracle + OCI_SUCCESS_WITH_INFO
Posted: 23.09.2006, 15:27
I am useing The ZeosLib version 6.5.1 alpha CVS as of 13/10/2005
(downloaded from sourceforge.net 22/09/2006).
I am writeing an appliaction in Delphi 7, connecting to the Oracle database (Oracle 10g Express Edition).
On the form there is a component ZConnection with properties:
Name ZConnection1
Database XE // (default database in Oracle 10g Express Edition)
Hostname 127.0.0.1 // localhost
Protocol oracle
User and password are OK. My programm is connecting to Oracle properly.
Now I want to create the stored procedure.
I am starting "Go To Database Home Page", running the SQL Command
(Enter the SQL Command) and type the sql code for createing my procedure for example:
CREATE OR REPLACE PROCEDURE PROC3(m_nazwisko IN VARCHAR2, m_imie IN VARCHAR2)
AS BEGIN
insert into OSOBY2(nazwisko, imie) values(m_nazwisko, m_imie);
END PROC3;
Now I am checking procedure:
SELECT
OBJECT_NAME, OBJECT_TYPE, CREATED, STATUS
FROM USER_OBJECTS
WHERE
OBJECT_TYPE='PROCEDURE'
AND
OBJECT_NAME='PROC3'
In the column STATUS i see value "VALID"
Now, I know that the SQL code is properly writeing so we can back to the Delphi codeing.
I placed the TZQuery on the form.
Connection ZConnection1
Name queryMake
Than I put a button on the form and create action OnClick:
procedure TForm1.btnMAKEClick(Sender: TObject);
var
txt : String;
begin
with queryMake do
begin
SQL.Clear();
SQL.Add(' CREATE OR REPLACE PROCEDURE PROC3(m_nazwisko IN VARCHAR2, m_imie IN VARCHAR2) ');
SQL.Add(' AS BEGIN ');
SQL.Add(' insert into OSOBY2(nazwisko, imie) values(m_nazwisko, m_imie); ');
SQL.Add(' END PROC3; ');
SQL.Add(txt);
try
queryMake.ExecSQL();
ShowMessage('OK');
except
raise;
end;
end;
end;
When the action is start the SQL error occurs: "OCI_SUCCESS_WITH_INFO"
Now, when I am checking does the procedure exists, I see that the procedure was created but in the column STATUS I see the value "INVALID", and the procedure
code in the oracle (browse procedure) is:
create or replace PROCEDURE PROC3(m_nazwisko IN VARCHAR2, m_imie IN VARCHAR2)
AS BEGIN
insert into OSOBY2(nazwisko, imie) values(m_nazwisko, m_imie);
END PROC3;
Can you help me?
Regards
mwgomez
Poland
(downloaded from sourceforge.net 22/09/2006).
I am writeing an appliaction in Delphi 7, connecting to the Oracle database (Oracle 10g Express Edition).
On the form there is a component ZConnection with properties:
Name ZConnection1
Database XE // (default database in Oracle 10g Express Edition)
Hostname 127.0.0.1 // localhost
Protocol oracle
User and password are OK. My programm is connecting to Oracle properly.
Now I want to create the stored procedure.
I am starting "Go To Database Home Page", running the SQL Command
(Enter the SQL Command) and type the sql code for createing my procedure for example:
CREATE OR REPLACE PROCEDURE PROC3(m_nazwisko IN VARCHAR2, m_imie IN VARCHAR2)
AS BEGIN
insert into OSOBY2(nazwisko, imie) values(m_nazwisko, m_imie);
END PROC3;
Now I am checking procedure:
SELECT
OBJECT_NAME, OBJECT_TYPE, CREATED, STATUS
FROM USER_OBJECTS
WHERE
OBJECT_TYPE='PROCEDURE'
AND
OBJECT_NAME='PROC3'
In the column STATUS i see value "VALID"
Now, I know that the SQL code is properly writeing so we can back to the Delphi codeing.
I placed the TZQuery on the form.
Connection ZConnection1
Name queryMake
Than I put a button on the form and create action OnClick:
procedure TForm1.btnMAKEClick(Sender: TObject);
var
txt : String;
begin
with queryMake do
begin
SQL.Clear();
SQL.Add(' CREATE OR REPLACE PROCEDURE PROC3(m_nazwisko IN VARCHAR2, m_imie IN VARCHAR2) ');
SQL.Add(' AS BEGIN ');
SQL.Add(' insert into OSOBY2(nazwisko, imie) values(m_nazwisko, m_imie); ');
SQL.Add(' END PROC3; ');
SQL.Add(txt);
try
queryMake.ExecSQL();
ShowMessage('OK');
except
raise;
end;
end;
end;
When the action is start the SQL error occurs: "OCI_SUCCESS_WITH_INFO"
Now, when I am checking does the procedure exists, I see that the procedure was created but in the column STATUS I see the value "INVALID", and the procedure
code in the oracle (browse procedure) is:
create or replace PROCEDURE PROC3(m_nazwisko IN VARCHAR2, m_imie IN VARCHAR2)
AS BEGIN
insert into OSOBY2(nazwisko, imie) values(m_nazwisko, m_imie);
END PROC3;
Can you help me?
Regards
mwgomez
Poland