Encrypt procedure in oracle
How to encrypt the procedure in oracle use wrap?
Pls tell me the way and step.
check this dude:
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/c_wrap.htm#2062
succes.
Similar Messages
-
I, wanted to know that how, can we encrypt a procedure in Oracle. As, per my knowledge, this is generally done so that unwanted people cannot read the code of the procedure.
I hope, my question is clear.
Please, help in solving the doubt.
regardsuser574290 wrote:
hi,
thanks, for your answer. But, this talks more of encryting pl/sql code in a file. I wanted to see this encrytion when I access the procedure from TOAD. I think, it is possible.
I hope, my question is clear.
Please, help in solving the doubt.If you actually read about "wrap" it encrypts your source file code. You then run that encrypted source file code against the database, just as you would if it were not wrapped, and then the code stored on the database also becomes encrypted. It's very simple and, by now, you could have tried it to see for yourself. -
Need sample source code for calling stored procedure in Oracle
Hi.
I try to call stored procedure in oracle using JCA JDBC.
Anybody have sample source code for that ?
Regards, Arnold.Thank you very much for a very quick reply. It worked, but I have an extended problem for which I would like to have a solution. Thank you very much in advance for your help. The problem is described below.
I have the Procedure defined as below in the SFCS1 package body
Procedure Company_Selection(O_Cursor IN OUT T_Cursor)
BEGIN
Open O_Cursor FOR
SELECT CompanyId, CompanyName
FROM Company
WHERE CompanyProvince IN ('AL','AK');
END Company_Selection;
In the Oracle Forms, I have a datablock based on the above stored procedure. When I execute the form and from the menu if I click on Execute Query the data block gets filled up with data (The datablock is configured to display 10 items as a tabular form).
At this point in time, I want to automate the process of displaying the data, hence I created a button and from there I want to call this stored procedure. So, in the button trigger I have the following statements
DECLARE
A SFCS1.T_Cursor;
BEGIN
SFCS1.Company_Selection(A);
go_Block ('Block36');
The cursor goes to the corresponding block, but does not display any data. Can you tell me how to get the data displayed. In the future versions, I'm planning to put variables in the WHERE clause. -
How to call statement's execute function to execute procedure in Oracle?
I made a very simple procedure in oracle logged as internal user.
the procedure as the following:
create or replace procedure temptest
as
begin
insert into indextab(idx) values(100);
commit;
end temptest;
in Java program,I use Oracle's jdbc driver to connect database, still connect as internal user.
I can call statement.executeUpdate("insert into indextab(idx) values(100)"). and 100 row was added in database.
then,I delete this row, try to run procedure in java,
but the call of statement.execute("temptest") throw a exception
the error message is:"java.sql.SQLException: ORA-00900: invalid SQL statement"
then, I write the same procedure in sql server.
all things work right.( I use jdbc-odbc bridge connect to sql server database)
who can tell me what's the reason?
I'm so urgent, please help me as soon as fast, thank you very muchInstead of a Statement object, use a CallableStatement. CallableStatement is the JDBC wrapper for a stored proc. JDBC requires that the vendor specific call be wrapped in a {CALL ....}.
So, your code would look like the following:
Connection con = some connection;
CallableStatement cs = con.prepareCall("{CALL temptest}");
cs.execute();
Take a look at the Javadoc. You can set both IN and OUT parameters using a CallableStatement. -
I try to execute procedure on ORACLE(8i) but get err SQLException ..
but for SELECT UPDATE INSERT statements all is OK!!
for SELECT, UPDATE, INSERT I wrote such code:
Statement stmt = conn.createStatement();
String strExec="SELECT ...."
stmt.executeQuery(strExec); (OR stmt.executeUpdate(strExec);)for proceure I wrote
strExec = " my_proc() ";
stmt.execute(strExec);what is wrong here??Try like this,
CallableStatement cstm = con.prepareCall("{ call my_proc }");
cstm.executeUpdate();
Sudha -
How to use a stored procedure in oracle reports
How to use a stored procedure in oracle reports
Dear,
In report triggers you can write your procedure/functions or call it like
function AfterPForm return boolean is
begin
myprocedure(:mydate);
return (TRUE);
end;
Thanks
Jamil -
SQLException while calling a Stored Procedure in Oracle
Hi all,
I am getting this error while calling a Stored Procedure in Oracle...
java.sql.SQLException: ORA-00600: internal error code, arguments: [12259], [], [
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:207)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:540)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1273)
at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:780)
at oracle.jdbc.driver.OracleResultSet.next(OracleResultSet.java:135)
at StoredProcedureDemo.main(StoredProcedureDemo.java:36)
The Program is ...
import java.sql.*;
public class StoredProcedureDemo {
public static void main(String[] args) throws Exception {
Connection con = null;
ResultSet rs = null;
Statement st = null;
CallableStatement cs = null;
int i;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:SHYAM","scott","tiger");
System.out.println("Got Connection ");
st = con.createStatement();
String createProcedure = "create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS"
+" Emp_name VARCHAR2(10);"
+" CURSOR c1 (Depno NUMBER) IS"
+" SELECT Ename FROM emp WHERE deptno = Depno;"
+" BEGIN"
+" OPEN c1(Dept_num);"
+" LOOP"
+" FETCH c1 INTO Emp_name;"
+" EXIT WHEN C1%NOTFOUND;"
+" END LOOP;"
+" CLOSE c1;"
+" END;";
System.out.println("Stored Procedure is \n"+createProcedure);
i = st.executeUpdate(createProcedure);
System.out.println("After creating the Stored Procedure "+i);
cs = con.prepareCall("{call Get_emp_names(?)}");
System.out.println("After calling the Stored Procedure ");
cs.setInt(1,20);
System.out.println("Before executing the Stored Procedure ");
rs = cs.executeQuery();
System.out.println("The Enames of the given Dept are ....");
while(rs.next()) {
System.out.println("In The while loop ");
System.out.println(rs.getString(1));
catch (Exception e) {
e.printStackTrace();
Stored Procedure is ...
create or replace PROCEDURE Get_emp_names (Dept_num IN NUMBER) IS
Emp_name VARCHAR2(10);
CURSOR c1 (Depno NUMBER) IS
SELECT Ename FROM emp WHERE deptno = Depno;
BEGIN
OPEN c1(Dept_num);
LOOP
FETCH c1 INTO Emp_name;
EXIT WHEN C1%NOTFOUND;
END LOOP;
CLOSE c1;
END;
Stored procedure is working properly on sql*plus(Oracle 8.1.5)) editor. But it is not working from a standalone java application. Can anyone please give me a solution.
thanks and regards
Shyam KrishnaThe first solution is to not do that in java in the first place.
DDL should be in script files which are applied to oracle outside of java.
Other than I believe there are some existing stored procedures in Oracle that take DDL strings and process them. Your user has to have permission of course. You can track them down via the documentation. -
Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)
Hi All,
We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
Database is Oracle.
*Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
If both are equal, then
if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
else if the field: 'qq' in YY table equals to "Modify" then take the data from the view table: 'Modify_View'.
Finally, We need to archive the selected data from the respective view table.*
From each table, data will come differently, means with different field names.
I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
Is there any way other than Stored Procedure?
How to handle Data Types as data is coming from two different tables?
Can we create one data type for two tables?
Is BPM required for this to collect data from two different tables?
Can somebody guide me on how to handle this?
Waiting eagerly for help which will be rewarded.
Thanks and Regards,
Jyothirmayi.Hi Gopal,
Thank you for your reply.
>Is there any way other than Stored Procedure?
Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
I need to select the data from different tables based on some conditions. Let me simplify that.
Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
How can we meet this by configuring sender adapter with ATP?
================================================================================================
>How to handle Data Types as data is coming from two different tables?
If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
we need to take data only from one table at a time. It is not join of two tables.
================================================================================================
Thanks,
Jyothirmayi. -
Calling stored procedure in Oracle forms
I have a stored procedure in Oracle which is declared as follows in the package
SFCS1.Company_Selection(O_Cursor IN OUT T_Cursor, cls IN Varchar2);
Where T_Cursor is defined as a Ref Cursor
From the Oracle forms I'm using the following code
SFCS1.Company_Selection(A,my_cls);
go_block('Block50');
Execute_Query;
I get the error message "FRM40505:Oracle Error: Unable to Perform Query". If I hardcode the value of my_cls in the query it runs properly. Any solutions will be really helpful
Further to this, I want to put the single quotes around a value (for eg. 'A') from a variable. For instance I'm getting a value from my_cls and for the output I want to surround it with the single quotes, can somebody tell me how to do it.
Thanks in advanceThis is a bit of a roundabout way to do it? Try setting up the block data source as procedure and set the values in the property palette of the data block.
e.g.
Query Data Source Type = Procedure
Query Data Source Name = SFCS1.Company_Selection
Query Data Source Columns = (Whatever columns/items you have in your datablock)
Query Data Source Arguments = Argument names are your ref cursor and your variable.
Check out basing data blocks on Ref Cursors.
HTHs
L :-) -
How to verify stored procedures in Oracle 10g.
I would like to locate default stored procedure in Oracle 10g database.
And Suggest which stored procedure can be converted in to JAVA code ??If the Java part of the question refers to looking for potential to speed up your stored procedures:
You should consider native compilation which transfers your code to shared libraries which are bound to the DB kernel.
In this case however consider, that this does not make any sense/improvement for pure data access statements but only for procedures consisting of complex algorithmic processing.
For details refer to
[How native compilation works|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/tuning.htm#sthref2280]
and
[Setting Up and Testing PL/SQL Native Compilation|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/tuning.htm#sthref2309] -
How to write a PL/SQL stored procedure in Oracle to call Webservice
Can any one pelase send me a code on how to write a PL/SQL stored procedure in Oracle database to call the Webservice ?
Thanks,
RajeshWere you able to solve this problem
-
How to Create a Stored Procedure in Oracle
I try to create a very simple Stored Procedure from Oracle SQL Developer, got the following error. Can someone give me some help on this? I am new on this. Thanks.
Error(4,1): PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: := ( ; not null range default character The symbol ";" was substituted for "BEGIN" to continue.
create or replace PROCEDURE Test
AS ACCESSTYP_ID ACCESSTYP.ACCESSTYPCD%TYPE
BEGIN
SELECT ACCESSTYPCD
INTO ACCESSTYP_ID
FROM ACCESSTYP
WHERE ACCESSTYPCD = 'WWW';
END;I found out I forgot to put ";" after the declare.
How do I test it call this stored procedure from
Oracle SQL Developer.
create or replace PROCEDURE Test_VL
AS ACCESSTYP_ID
ACCESSTYP.ACCESSTYPCD%TYPE;
SELECT ACCESSTYPCD
INTO ACCESSTYP_ID
FROM ACCESSTYP
WHERE ACCESSTYPCD = 'WWW';
END;in your SQL Developer window just enclosed your procedure with a Begin ... End.
Begin
Test_VL;
End; -
Dear Friends,
I have a lot of c-stored procedures for DB2,
now,I want to use these c-stored procedures in Oracle directly without any changes.
I'm not sure whether this method is right.
Please help me.
GuangI think, that the best way inclusion of business logic into ORACLE database as a TABLE-constraints, triggers and stored procedures for guaranteeing data integrity.
But if you have really a LOT of c-stored procedures and you need provide quick startup with ORACLE, than you can use your c-procedures as "external calls" with ORACLE.
Unfortunately I don't know DB2 c-stored procedures specifics and can't give finally recommendations for you.
Sincerely, Urry -
Stored procedure in Oracle 8.1.7.0
HI,
my oracle version is 8.1.7.0
I've created this stored procedure:
CREATE OR REPLACE procedure CREATE_TAB1
IS
SVUOTA VARCHAR2(64);
PRAGMA AUTONOMOUS_TRANSACTION;
err_num number;
err_msg varchar2(100);
BEGIN
SVUOTA := 'TRUNCATE TABLE TAB1 REUSE STORAGE';
EXECUTE IMMEDIATE SVUOTA;
INSERT INTO TAB1
SELECT "COD_IMM","PIANO","COD_RITMI","TOTAL_AREA","MAX_AREA"
FROM (SELECT a.*,
MAX(total_area) OVER (PARTITION BY cod_imm, piano) max_area
FROM REP_02_TEST1 a
where a.COD_RITMI not in ('04'))
WHERE max_area = total_area;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
err_msg:= SUBSTR(SQLERRM, 1, 100);
err_num:= SQLCODE;
INSERT INTO tab_error (proc_name, err_code, err_msg, err_date)
VALUES ('CREATE_TAB1', err_num, err_msg, sysdate);
COMMIT;
END CREATE_TAB1;
but when I compile I get this error
PROCEDURE AFM.CREATE_TAB1
On line: 14
PLS-00103: Encountered the symbol "(" when expecting one of the following:
, from
the procedure stop on line:
MAX(total_area) OVER (PARTITION BY cod_imm, piano) max_area
I think that oracle version 8.1.7.0 not allow the code "OVER (PARTITION BY"
I tried also with:
EXECUTE IMMEDIATE 'INSERT INTO TAB1
SELECT "COD_IMM","PIANO","COD_RITMI","TOTAL_AREA","MAX_AREA"
FROM (SELECT a.*,
MAX(total_area) OVER (PARTITION BY cod_imm, piano) max_area
FROM REP_02_TEST1 a
where a.COD_RITMI not in ('04'))
WHERE max_area = total_area';
but I get:
PROCEDURE AFM.CREATE_TAB1
On line: 16
PLS-00103: Encountered the symbol "04" when expecting one of the following:
How can I create my stored procedure with Oracle version 8.1.7.0
Thank in advance!What is this code suppose to accomplish?
Is this type of processing not possible using Global Temporary Tables?
Oracle8i PL/SQL did not parse analytic functions correctly so you would have to make that SELECT a view and then SELECT from that view in PL/SQL.
I tried also with:When you wrap the SELECT in EXECUTE IMMEDIATE you have to properly use the single quotes. The single quote that appears at this line:
where a.COD_RITMI not in ('04'))is assumed by the compiler as the end of the string started by EXECUTE IMMEDIATE. That is not what you want.
Please post some more details about the type of procesing that this code is suppose to accomplish so we can suggest alternatives to get it done better. -
Stored procedure in oracle plsql giving Error
Hi all,
I want to create stored procedure in oracle.
In that,I want to update if record is present in the table else want to insert that record in that table.
Here is my stored proc which I write.
I have very little knowledge about oracle(to be honest no knowledge).
Below is my code and the purpose of this code is to insert/update the data based on the entry what ever the user makes in cognos report studio report view.
Collapse | Copy Code
create or replace
PROCEDURE INSERTCOMMENTS
N_HATID NUMBER
, N_IN_NUMBER NUMBER
, N_POINTS VARCHAR2 DEFAULT 255
, N_QETYPE VARCHAR2 DEFAULT 255
) AS
BEGIN
IF((SELECT COUNT(*) FROM CCM_REPORT_USER.POINTS_QETYPE_COMMENTS
WHERE CCM_REPORT_USER.POINTS_QETYPE_COMMENTS.HATID = N_HATID)=0)
THEN (INSERT INTO "CCM_REPORT_USER"."POINTS_QETYPE_COMMENTS" (HATID, IN_NUMBER, POINTS, QETYPE)
VALUES (N_HATID , N_IN_NUMBER , N_POINTS , N_QETYPE,));
ELSE
(UPDATE "CCM_REPORT_USER"."POINTS_QETYPE_COMMENTS" SET CCM_REPORT_USER.POINTS_QETYPE_COMMENTS.POINTS = N_POINTS
AND CCM_REPORT_USER.POINTS_QETYPE_COMMENTS.QETYPE = N_QETYPE
WHERE CCM_REPORT_USER.POINTS_QETYPE_COMMENTS.HATID = N_HATID)
AND WHERE CCM_REPORT_USER.POINTS_QETYPE_COMMENTS.IN_NUMBER = N_IN_NUMBER)
END IF;
END INSERTCOMMENTS;948677 wrote:
I want to create stored procedure in oracle.
I have very little knowledge about oracle(to be honest no knowledge).If you are new to Oracle you should first be familiar with the manuals before writing code
http://tahiti.oracle.com/
For the latest version
http://www.oracle.com/pls/db112/homepage
And then start with *2 Day Developer's Guide*
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10766/toc.htm
SQL Language Reference
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/toc.htm
Concepts
http://download.oracle.com/docs/cd/E11882_01/server.112/e16508/toc.htm
PL/SQL Language Reference
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/toc.htm
And the Error Messages references for looking up the errors you will encounter when starting out
http://download.oracle.com/docs/cd/E11882_01/server.112/e17766/toc.htm
>
In that,I want to update if record is present in the table else want to insert that record in that table.
Here is my stored proc which I write.Once you know where the manuals are you would see that you would not write a stored procedure, you would use the MERGE command to do this
http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_9016.htm#i2081218
Which you can of course put in a stored procedure if you like.
Maybe you are looking for
-
Problem connecting to SAP Open Hub
Hi, I am trying to set up a SSIS job connecting to SAP Open Hub and have with support from the SAP guys been able to get some progress, but it has now stopped up on a error message we're not able to solve. Any suggestion on what can be wrong and how
-
Hotmail dosen't push after phonecall
Hi, I have a problem with the new active sync feature of hotmail. If I fetch the mail manual or i.e. every 15 min every thing works well. If I try to let hotmail push mails, it works also well... But, if I have a phone call (or the iPhone is in fligh
-
I can t get any sound notication sounds on my ipad 2 such as new email etc
I can t get any sound notication sounds on my ipad 2 such as new email etc
-
PB 11.5.1 and Windows Tablet 8.1
Hi all! We are thinking of taking our POS application written in PB 11.5.1 and SQL Server 2008 R2 (SNC) in the new Windows Tablets 8.1 We are actually buying time because in parallel we are developing the POS app for Android/iOS. So I would like to a
-
Fresh install on Win XP Pro, w/sp2 and 2 gig mem. Open CS3, click on brouse, attempts to start....then get error message and wants to send to MS. Deleted program, cleaned registry, reinstalled. Same problem Any ideas on how to get Bridge to work?????