Native PL/SQL compilation
Hi -
Does anyone have native PL/SQL compilation working correctly on their Linux server?
It is reasonably easy to deduce suitable values for the init.ora parameters "plsql_...." .
I suspect the problem is with the make file: spnc_makefile.mk .
The supplied make file:
$ORACLE_HOME/plsql/spnc_makefile.mk
does not work, throwing an internal error:
PLS-00801: internal error [79704]
I have read the article on OTN concerning upgrading the entire database to native PL/SQL. It is very helpful, but unfortunately does not solve the problem.
Can anyone help? Thanks.
Bryan Genet
Hi
try
--RN 24.3.2003, PL/SQL mit native execution
-- Example in PL/SQL Users Guide and Reference, Kap. 12, Tuning PL/SQL
-- SuSE 8.0, oracle 9.2.0.1 using spfile
-- ORACLE_HOME /oracle/ORA92
alter system set plsql_native_library_dir='/opt/oracle/native_lib';
-- here you'll find the shared librarys
alter system set plsql_native_make_utility='gmake';
-- a normal make/gmake will work?
alter system set plsql_native_make_file_name='/oracle/ORA92/plsql/spnc_makefile.mk';
alter session set plsql_compiler_flags='NATIVE';
set serveroutput on;
set timing on
create or replace procedure with_native
as
erg number;
begin
for i in 1..1000000 loop
erg := mod(i,4711);
end loop;
dbms_output.put_line(to_char(erg));
end;
show errors
execute with_mitnative
prompt "NATIVE"
alter session set plsql_compiler_flags='INTERPRETED';
create or replace procedure without_native
as
erg number;
begin
for i in 1..1000000 loop
erg := mod(i,4711);
end loop;
dbms_output.put_line(to_char(erg));
end;
-- show errors
execute witout_native
prompt "INTERPRETED"
regards
Roman
Similar Messages
-
Gcc compiler for native pl-sql (SunOS 5.9)
Hi All !
Whether it is possible to use native pl-sql compilation on platform Solaris 9 with the compiler gcc? I Have established gcc version 3.3.2
At compilation of a package I receive a error: (Warning) PLS-00923: native compilation failed: make:spdtexmk:?Although the configuration is certified not all new 9i features are supported with previous versions of Oracle.
In order for result set to work you will require Oracle v9i. -
Using Native Dynamic SQL in Forms
Can Native Dynamic SQL be used in Forms 5.0 or Forms 6.0? (Database 8.1.6.0.0)
I have tried the following code (examples below) from the PL/SQL User's Guide and Reference Release 8.1.6 and the Metalinks Note: 62592.1 and the trigger/procedure (in Forms) will not compile. I appreciate any help given.
Example1:
(I have a table named temp_jane with a column named companies and a value 'Hello'. When compiling, I receive the error: 'Error 103 at line 8, column 11 Encountered the symbol ''IMMEDIATE" when expecting one of the following :=.(@%; ')
declare
str varchar2( 200 );
val varchar2( 20 );
ret temp_jane%rowtype;
begin
str := 'select company from temp_jane where company = :b1';
val := 'Hello';
execute immediate str into ret using val;
message('Value fetched from table: '| |ret.company);
end;
Example2:
(Here is the real issue, I don't know what the select statement, so I need to be able to assign a variable. When compiling, I receive the error: 'Error 103 at line 28, column 21 Encountered the symbol "VSQLSTATEMENT" when expecting one of the following: select ').
declare
type ItemsControlCurTyp is ref cursor;
ItemsCur ItemsControlCurTyp;
ItemsRec Items%rowtype;
vSQLStatement varchar2( 5000 );
vExecuteSQL varchar2( 5000 );
vNumRows integer;
vValue varchar2( 2000 );
vFirstOne varchar2( 1 ) := 'Y';
vRetval varchar2( 2000 );
begin
-- Display the column prompts with the right text.
set_item_property( 'ITEMS_AVAILABLE.NDB_VALUE', PROMPT_TEXT, :ITEMS_CONTROL.AVAILABLE_LABEL );
set_item_property( 'ITEMS_CHOSEN.NDB_VALUE', PROMPT_TEXT, :ITEMS_CONTROL.CHOSEN_LABEL );
-- Save the original version of CHOSEN_STRING in case the user reverts or cancels.
:ITEMS_CONTROL.CHOSEN_STRING_ORIG := :ITEMS_CONTROL.CHOSEN_STRING;
vSQLStatement := :ITEMS_CONTROL.SELECT_STATEMENT;
vExecuteSQL := vSQLStatement;
-- Open the cursor
open ItemsCur for vSQLStatement;Hi JTaylor
You cannot use NDS in Client side (Developer). You have to use DBMS_SQL only.
Regards
A K Srinivasan
Oracle. -
Workaround for opening a strongly typed cursor using native dynamic SQL
Hi All,
In reading the PL/SQL documentation for Oracle 9i, I noted that the OPEN-FOR
statement with a dynamic SQL string only allows the use of weakly typed cursors.
I have verified this limitation with my own experimentation as follows:
DECLARE
type rec_type is record(
str varchar2(40),
num number(22)
type cur_type is ref cursor return rec_type;
my_cur cur_type;
que varchar2(100);
tab varchar2(40);
BEGIN
tab := 'dynamic_table_name';
que := 'select key_name, key_value from ' || tab || ' where key_name like ''01%''';
open my_cur for que;
loop
if my_cur%found then
dbms_output.put_line('source_name: ' || my_cur.str || ', page_sn: ' || my_cur.num);
exit;
end if;
end loop;
close my_cur;
END;
Running the above trivial example in an anonymous sql block yields the following
errors as expected:
ORA-06550: line 10, column 8:
PLS-00455: cursor 'MY_CUR' cannot be used in dynamic SQL OPEN statement
ORA-06550: line 10, column 3:
PL/SQL: Statement ignored
ORA-06550: line 13, column 54:
PLS-00487: Invalid reference to variable 'MY_CUR'
ORA-06550: line 13, column 7:
PL/SQL: Statement ignored
Is there a workaround to the situation? Since I do not know the table name at run
time, I must use Native Dynamic SQL. I have a long and complex record type
that I wish to return through JDBC using the REFCURSOR Oracle type in order to
avoid having to register an inordinate number of OUT parameters. Moreover, I
would like to return potentially one or more results in a ResultSet. Using the
standard method of registering native SQL types for the IN and OUT bindings
can only return one result. Hence the reason I would like to return a strong
cursor type. Also, the type of query I am doing is complex, and needs to be
executed in a PL/SQL procedure for performance reasons. Therefore simply
executing a SELECT query dynamically built up on the the JDBC client won't
do the trick.
If anybody has experience with a similar problem and would like to volunteer
information on their workaround, I would really appreciate it.
Best Regards,
J. MetcalfWe can use strongly-typed REF CURSORs in DNS, but the typing derives from a table e.g.
TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
so the problem is your use of "return rec_type" bit.
Forgive my bluntness but I think you have misunderstood strong and weak typing. You actually want to be using weakly-typed cursors. I mean this:
Moreover, I would like to return potentially one or more results in a ResultSet. suggests that the structure of your resultset may vary, which is precisely what a weakly-typed ref cursor allows us to do. Then we can use the JDBC metadata methods to interrogate the structure of the resultset, innit.
so try this:
DECLARE
type cur_type is ref cursor;
my_cur cur_type;
que varchar2(100);
tab varchar2(40);
BEGIN
tab := 'dynamic_table_name';
que := 'select key_name, key_value from ' || tab || ' where key_name like ''01%''';
open my_cur for que;
loop
if my_cur%found then
dbms_output.put_line('source_name: ' || my_cur.str || ', page_sn: ' || my_cur.num);
exit;
end if;
end loop;
close my_cur;
END;
ras malai, APC
Cheers, APC -
Can we use NATIVE PL-SQL with OWB ?
Is there a performance advantage to use it with OWB.
We work with owb9.0.2. We are going to migrate to owb10g soon.You may be able to, however I have never done so. I would expect that you can just call native PL/SQL from something like SQL Plus? In that case you may be able to use it in custom functions...
Jean-Pierre -
Missing message file for PL/SQL compile time warnings
I want to use PL/SQL compile time warnings but I don't have the message file on my system (or it is not installed correctly). This results in output like this:
3/5 PLW-05005: Message 5005 not found; No message file for
product=plsql, facility=PLW
Where can I get this message file and what do I have to do to install it?
Thank you.
Alex.hi Will
Maybe this is a beter forum for your question:
"JDeveloper and OC4J 11g Technology Preview"
JDeveloper and OC4J 11g Technology Preview
success
Jan Vervecken -
Alternative to native, dynamic sql to return a ref cursor to a client
I'm on Oracle 8.0.4, and would like to pass a string of values like '1,2,7,100,104' that are the primary key for a table. Then use something like:
procedure foo( MyCur RefCurType, vKey varchar2)
begin
open MyCur for
'select names from SomeTable' | |
' where ID in (' | | vKey | | ')'
end;
This would return a recordset to (in this case) a Crystal Reports report.
However, native dynamic SQL ain't available until 8.1.0. So can anyone think of a clever way to accomplish this, with a way to return a cursor? I can't figure out how to do this with DBMS_SQL, because open_cursor is just returning a handle, not a referene to a cursor that can be passed to a remote client.
Thanks in advance.I'm on Oracle 8.0.4, and would like to pass a string of values like '1,2,7,100,104' that are the primary key for a table. Then use something like:
procedure foo( MyCur RefCurType, vKey varchar2)
begin
open MyCur for
'select names from SomeTable' | |
' where ID in (' | | vKey | | ')'
end;
This would return a recordset to (in this case) a Crystal Reports report.
However, native dynamic SQL ain't available until 8.1.0. So can anyone think of a clever way to accomplish this, with a way to return a cursor? I can't figure out how to do this with DBMS_SQL, because open_cursor is just returning a handle, not a referene to a cursor that can be passed to a remote client.
Thanks in advance. -
Apex PL/SQL: Compilation unit analysis terminated
HI,
Does any one help me on this.
while i compile my function, it compiles successfully. but show errors showing
menuid in 'TY_MENUIDS'; -- this line shows the error
PLS-00201: identifier 'TY_MENUIDS' must be declared
'TY_MENUIDS' is TYPE which has created inside the same schema
line 0 position 0 PL/SQL: Compilation unit analysis terminated
Thanks
Logaa
Edited by: Logaa on Aug 11, 2009 11:39 PMHi Gussay,
Thanks for your reply.
i have created type of object.
CREATE OR REPLACE TYPE "TY_NSN_MENUITEMS" AS OBJECT(id NUMBER, menuid VARCHAR2(100))
then i have create a type of TY_NSN_MENUITEMS
CREATE OR REPLACE TYPE "TY_NSN_MENUIDS" AS VARRAY(500) OF TY_NSN_MENUITEMS
then i have refered this TY_NSN_MENUIDS inside my function . in declaration part it shows me the error.
The function which i have created inside my APEX->OBJECTBROWSER->SCHEMA-> MYFUNCTION
thanks
Logaa
Edited by: Logaa on Aug 12, 2009 10:49 PM -
Is there any way to give the PL/SQL compile options while compiling from SQL*PLUS like we give in Pro*c Compilers using EXEC ORACLE OPTIONS (name=value);
ThanksRichard,
I tried the following simple PL/SQL
created the package
CREATE OR REPLACE PACKAGE partest AS -- package spec
PROCEDURE insert_dummy_details(num INTEGER);
END partest;
Created the body
CREATE OR REPLACE PACKAGE BODY partest AS -- package body
PROCEDURE insert_dummy_details(num INTEGER) IS
BEGIN
INSERT INTO pardummy values(num);
END insert_dummy_details;
END partest;
created pardummy table
compiled & executed it
count in v$open_cursor increased by 1.
Also, i executed the query which you mentioned.
It showed the corresponding insertion sql text with the status CURBOUND
Does it mean that a cursor is open in session which can be counted against open_cursor for that insert statement.
Partha -
Product: Microsoft SQL Server 2012 Transact-SQL Compiler Service -- Error 1335
Hello,
I am getting an error while using windows update or manually downloading and running
SQLServer2012-KB2793634-x64.exe
Product: Microsoft SQL Server 2012 Transact-SQL Compiler Service -- Error 1335. The cabinet file 'Redist.cab' required for this installation is corrupt and cannot be used. This could indicate a network error, an error reading from installation media,
or a problem with this package.
What can be done?
Thanks
ByeHello,
I am getting an error while using windows update or manually downloading and runningT
SQLServer2012-KB2793634-x64.exe
Product: Microsoft SQL Server 2012 Transact-SQL Compiler Service -- Error 1335. The cabinet file 'Redist.cab' required for this installation is corrupt and cannot be used. This could indicate a network error, an error reading from installation media,
or a problem with this package.
What can be done?
Thanks
Bye
This KB article was issued as fix for known Issue as per below link.
http://support.microsoft.com/kb/2793634
Now I assume you are getting this error because downloaded file seems corrupt to me.Can you download again and copy it to local disk and start running from there.
http://www.microsoft.com/en-in/download/details.aspx?id=36215
Also make sure your installer is not corrupt.If you find it corrupt please download it from below link and install after that run the setup again
http://support.microsoft.com/kb/942288
Hope this helps
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
What is the problem with native dynamic sql when counting rows in all table
what is the problem with native dynamic sql when counting rows in all table?Giving an error "table or view does not exist". Thanks.
DECLARE
v_sql_string varchar2(1000);
v_no_of_rows number;
BEGIN
for i in ( select table_name from all_tables )
loop
v_sql_string := ' select count(1) from ' || i.table_name;
dbms_output.put_line( v_sql_string );
--execute immediate v_sql_string into v_no_of_rows;
end loop;
END;Usually your problem can be described with 'Who cares'. I mean, for what reason do you do this? I doubt that there's a business need to get 100 % accurate answers for this. Normally such things are used to get a picture about the growth of data.
Personally I would prefer to have up-to-date statistics for all tables and just query the number of rows from there. Sufficient for me in < 99 % of all cases.
Just my $ .02... -
Security question: Can you decompile a PL/SQL compiled procedure?
I am wondering if anyone would be able to tell me if it is possible to decompile a compiled oracle PL/SQL procedure.
Scenario:
I create some data encryption code in PL/SQL that contains an encryption key string. I compile the PL/SQL as a stored procedure and store that binary object as a BLOB in the database. If a hacker can snag a whole database that would include this BLOB and he figures out that the BLOB might contain the key, can he get access to the key by decompiling somehow the BLOB back into PL/SQL statements?
Thanks in advance!!
Gary Glover, CISSP
[email protected]Gary, when a hacker gets into your database (with sysdba rights), your are pretty much screwed - even with encrypted code and data.
To obtain that level of access, the hacker must be good. And persistant. Thus you can expect that he will compromise the rest of the stuff inside the database.
Alternatively, your database security was shoddy - trying to patch security via encrypting code in the database is a poor second.
It is also a question of time and effort vs. benefits. Spend 80% attempting to secure the code in the database, and 20% securing the database? Or 90% securing the database and 10% securing the code and data in the database? -
Hi guys,
Sorry that i'm quite new to PL SQL and oracle. I having some issue on pl sql function as i implementing a CREATE OR REPLACE FUNCTION. Below is my syntax for my function.
create or replace function auth_Name ( v_auth_state IN varchar)
return varchar2 is
v_authName varchar;
BEGIN
select name into v_authName from employee
where
name= v_auth_state;
return v_authName;
end auth_Name;
But whenever I compile it will show "Function created with compilation errors". Isn't it supposed to show "Function created successfully"? anyone can guide me along with this?Hi,
Welcome to the forum!
The immediate problem is that the local variable v_authName can't be declared as just VARCHAR. That's how you give the datatype of an argument (like v_auth_state) or the function's return type, but the local variable has to be given a length.
You could say something like:
v_authName varchar (20);but, since v_authName has to match a specific column from a specific table, it's better to define it as that column's type and length directly.
You might want to do the same for the argument and the return type, like this:
create or replace function auth_Name ( v_auth_state IN employee.name%TYPE)
return employee.name%TYPE is
v_authName employee.name%TYPE;
BEGIN
select name
into v_authName
from employee
where
name = v_auth_state;
return v_authName;
end auth_Name;
show errorsIt looks the function is just returning it's argument. Is that what you want? If not, describe what the function is supposed to do.
As written, the function will have a run-time error if there is not exactly one row in the employee table with the given name. What would you like to happen if there is no matching row in the table? How about if there are several? -
PL/SQL compile button missing JDEV 11g TP4
Hi
I have been working through the database development with Jdeveloper tutorial:
http://www.oracle.com/technology/obe/obe11jdev/11/db_dev/obe_%20databasedevmt.htm
this, as name suggests, discusses db development with jdev 11g TP4.
However I seem to have an issue with the section named 'Creating and Debugging PL/SQL Objects in the Database'.
In section 9 of 'creating a pl/sql package' the tutorial talks about a compile for debug button on the code editor. This essentially compiles the package against the DB, however in my Jdev, this button is does not exist. Is this just because this is only a tech preview version or is there some further config I need to do?
Versions are..
OS: Vista SP1
JDEV: 11.1.1.0.0
DB: 10.2.0.1.0
Thanks in advance
Willhi Will
Maybe this is a beter forum for your question:
"JDeveloper and OC4J 11g Technology Preview"
JDeveloper and OC4J 11g Technology Preview
success
Jan Vervecken -
the topic just i posted is wrong,
sample11.pc in directory
/oracle/product/8.1.7/precomp/demo/proc
[oracle@Robbie proc]$ make -f demo_proc.mk sample11.c
proc iname=sample11
Pro*C/C++: Release 8.1.7.0.0 - Production on Fri Aug 29 10:59:07 2003
(c) Copyright 2000 Oracle Corporation. All rights reserved.
System default option values taken from: /oracle/product/8.1.7/precomp/admin/pcscfg.cfg
Error at line 93, column 17 in file sample11.pc
emp_demo_pkg.open_cur(:emp_cursor, :dept_num);
................1
PLS-S-00201, identifier 'EMP_DEMO_PKG.OPEN_CUR' must be declared
Error at line 93, column 17 in file sample11.pc
emp_demo_pkg.open_cur(:emp_cursor, :dept_num);
................1
PLS-S-00000, Statement ignored
Semantic error at line 92, column 13, file sample11.pc:
begin
............1
PCC-S-02346, PL/SQL found semantic errors
make: *** [sample11.c] Error 1
thanksRichard,
I tried the following simple PL/SQL
created the package
CREATE OR REPLACE PACKAGE partest AS -- package spec
PROCEDURE insert_dummy_details(num INTEGER);
END partest;
Created the body
CREATE OR REPLACE PACKAGE BODY partest AS -- package body
PROCEDURE insert_dummy_details(num INTEGER) IS
BEGIN
INSERT INTO pardummy values(num);
END insert_dummy_details;
END partest;
created pardummy table
compiled & executed it
count in v$open_cursor increased by 1.
Also, i executed the query which you mentioned.
It showed the corresponding insertion sql text with the status CURBOUND
Does it mean that a cursor is open in session which can be counted against open_cursor for that insert statement.
Partha
Maybe you are looking for
-
Track changes in Adobe Reader 8
I've created a form in Livecycle. Our company has Adobe Reader 8 installed on the network. I'd like to be able to track changes, like in Microsoft Word, on the pdf form when it is emailed to another user so if changes are made, I can see what chang
-
Reader plug-in, save copy of password protected pdf without password
Hello, We currently have an Acrobat Reader plugin (using the 8.1 SDK) and are having trouble with password protected PDFs. The sole purpose of our plug-in is to pass a copy of the currently open PDF to a different folder on the user's computer. The p
-
Buyer Beware,What good is buying the protection!!!!!
Took my Sub Woofer in for repair under warranty. This was an act of congress to begin with ( just getting them to realize it was still under warranty). Then I had to drive an hour to the closest BB and all they could do is send it off for repair ( di
-
Itunes will not show album cover in new features.
I updated itunes to itunes 7 the album artwork shos up when im listening to a sond but in the what apple calls coverflow feature. Even in the itunes music store it comes up that way. I reintalled and still the same problem. Any help would be great it
-
When importing a CD, the 'View Options' do not stay as I have set them. Ugh
(In iTunes 7), When I insert a CD, the 'DEVICES' part shws the disc. When I click on the disc, the columns of data is pretty minimal. I NEED to see the BPM, Year, etc.. I have to set it for EVERY device (CD) that I insert. Um, can you say ANNOYING?!?