Pl/sql compile in pro*c
[oracle@Robbie replicate]$ make -f demo_proc.mk tt.c
proc iname=tt
Pro*C/C++: Release 8.1.7.0.0 - Production on Fri Aug 29 10:40:08 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 28, column 1 in file tt.pc
PCC-S-02022, Found end of file while scanning a SQL statement
Error at line 0, column 0 in file tt.pc
PCC-F-02102, Fatal error while doing C preprocessing
make: *** [tt.c] Error 1
#include<stdio.h>
EXEC SQL BEGIN DECLARE SECTION;
char username[20];
char password[20];
EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE sqlca;
void sqlerror();
void main()
strcpy(username,"system");
strcpy(password,"manager");
EXEC SQL CONNECT :username IDENTIFIED BY :password;
EXEC SQL WHENEVER SQLERROR DO sqlerror();
EXEC SQL EXECUTE
BEGIN
select * from red7;
END;
END_EXEC;
void sqlerror()
EXEC SQL WHENEVER SQLERROR CONTINUE;
EXEC SQL ROLLBACK WORK RELEASE;
printf("\n Oracle error detected:\n");
printf("\n%.70s\n",sqlca.sqlerrm.sqlerrmc);
EXEC SQL ROLLBACK RELEASE;
thanks
the topic i posted is wrong. the correct as follow:
tt.pc
#include<stdio.h>
EXEC SQL BEGIN DECLARE SECTION;
char username[20];
char password[20];
EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE sqlca;
void sqlerror();
void main()
strcpy(username,"system");
strcpy(password,"manager");
EXEC SQL CONNECT :username IDENTIFIED BY :password;
EXEC SQL WHENEVER SQLERROR DO sqlerror();
EXEC SQL EXECUTE
BEGIN
select * from red7;
END;
END-EXEC;
void sqlerror()
EXEC SQL WHENEVER SQLERROR CONTINUE;
EXEC SQL ROLLBACK WORK RELEASE;
printf("\n Oracle error detected:\n");
printf("\n%.70s\n",sqlca.sqlerrm.sqlerrmc);
EXEC SQL ROLLBACK RELEASE;
[oracle@Robbie replicate]$ make -f demo_proc.mk tt.c
proc iname=tt
Pro*C/C++: Release 8.1.7.0.0 - Production on Fri Aug 29 10:59:50 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 16, column 21 in file tt.pc
select * from red7;
....................1
PLS-S-00201, identifier 'RED7' must be declared
Error at line 16, column 3 in file tt.pc
select * from red7;
..1
PLS-S-00000, SQL Statement ignored
Semantic error at line 15, column 2, file tt.pc:
BEGIN
.1
PCC-S-02346, PL/SQL found semantic errors
make: *** [tt.c] Error 1
Similar Messages
-
XML function not getting compiled in Pro C
Hello
I have written following statement in ProC
EXEC SQL
select extract(x.xml_data,'//ADDRESS/SERVERS/@REFSYSTEM').getStringVal(),
extract(x.xml_data,'//ADDRESS/SERVERS/text()').getNumberVal()
INTO :h_refsystem,
:h_reftext
from xml_str_table x
where key_no = 1234
and x.xml_data.existsNode('//ADDRESS/SERVERS[@REFSYSTEM="ORACLE"]') = 1 ;
and when compiled it give error " extract(x.xml_data,'//ADDRESS/SERVERS/@REFSYSTEM').getStringVal()
*. should be replaced with date, time etc*
Above query is returning output when I run on Oracle, but same code is not getting compiled in Pro C. Can you please advise what should be done to resolve this issue?
Thanks in advance,Hello!
I found out that the problem was not in the variable os_create_id as I described before, instead in the another variable, l_temp_sku.
But a strange behaviour persists.
The program aborts strangely, if the following variable l_temp_sku isn't initialised like this:
l_temp_sku[0] = '\0'; (if this is done the pro*c runs ok)
This variable gets it value from a Output variable of the package called, and these have the same length, as you can see above.
In the old machine (version 8.1.3.0 as already mentioned) it worked fine without initialisation.
The (strings) precompiler options are the following:
dbms=v8
char_map=string (We already tried to change this to VARCHAR2)
My questions are:
Is this a normal behaviour or is this a non documented feature (bug) ?
Is there any precompiler option that solves this kind of problems ?
We have lots of Pro*C´s with situations like this one, our problem is if all these programs start to blow without warning. Only after lots of time spent around this Pro*C we found where was the problem, and what kind of problem.
/* Code Extract: */
char ls_error_msg[NULL_ERROR];
EXEC SQL VAR ls_error_msg IS STRING(NULL_ERROR);
char l_temp_sku[NULL_SKU];
EXEC SQL VAR l_temp_sku IS STRING(NULL_SKU);
EXEC SQL EXECUTE
DECLARE
L_table VARCHAR(50) := NULL;
L_sub_sku WIN_WH.sku%TYPE := NULL;
L_avail_stock WIN_WH.STOCK_ON_HAND%TYPE := NULL;
O_error_message VARCHAR2(255) := NULL;
BEGIN
if NB_SUB_SKU_SQL.NB_F_CHECK_SUB_SKU(:os_sku,
:os_from_loc,
:os_to_loc,
:os_tsf_no,
:os_tsfalloc_no,
:os_create_id,
to_date(:os_system_date,'YYYYMMDDHH24MISS'),
L_sub_sku,
L_avail_stock,
O_error_message) = FALSE then
:plsql_pkg_failed := -1;
:plsql_pkg_message := O_error_message;
SQL_LIB.BATCH_MSG(:ol_sql_holder,
L_table,
:plsql_pkg_message);
:table := L_table;
else
/* Only if ret true and the sub sku, everything its ok */
if L_sub_sku IS NOT NULL then
:l_temp_sku := L_sub_sku;
:plsql_pkg_failed := 0;
Best Regards,
JAP -
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 -
Error compiling a pro c program
I am having the following error when I compile a pro c program. Any hints will be appreciated
diamond:/home/rechever$ make -f $BANNER_HOME/general/c/sctproc.mk rzrload CHECKOPT='sqlcheck=full userid=baninst21/xxxxx'
proc iname=rzrload.pc ireclen=132 oreclen=132 lines=y select_error=no hold_cursor=no release_cursor=no maxopencursors=255 maxliteral=160 ltype=none include=/u02/sct/banner/bandev2/general/c/ include=/u02/sct/banner/bandev2/general/c/ dbms=v8 unsafe_null=yes sqlcheck=full userid=baninst21/xxxxx
Pro*C/C++: Release 10.2.0.3.0 - Production on Wed Oct 29 16:40:31 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
System default option values taken from: /u01/app/oracle/product/OH4/10g/precomp/admin/pcscfg.cfg
INTERNAL ERROR: Failed assertion [PGE Code=90105]
make: 1254-059 The signal code from the last command is 11.
Edited by: user648177 on Oct 29, 2008 2:04 PM
Edited by: user648177 on Oct 29, 2008 2:05 PMThat's Pro*C's way of telling you that you don't have write access to the directory you're precompiling in.
-
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 -
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 -
Hello,
I try to compile some Proc*c but I receiving the following errors:
stgorl80.pc
stgorl80.o(.text+0x8db): In function `daemonize':
: undefined reference to `errno'
collect2: ld returned 1 exit status
make: *** [stgorl80] Error 1
COMPILE_ERROR IN stgorl80.pc
stgorl85.pc
stgorl85.o(.text+0x9e3): In function `daemonize':
: undefined reference to `errno'
collect2: ld returned 1 exit status
make: *** [stgorl85] Error 1
COMPILE_ERROR IN stgorl85.pc
stngtp90.pc
stngtp90.o(.text+0x944): In function `process_ex_later':
: undefined reference to `errno'
stngtp90.o(.text+0xc7d): In function `process_ex_later':
: undefined reference to `errno'
stngtp90.o(.text+0xd10): In function `process_ex_later':
: undefined reference to `errno'
collect2: ld returned 1 exit status
make: *** [stngtp90] Error 1
COMPILE_ERROR IN stngtp90.pc
stscap10.pc
stscap10.c: In function `open_all_ports':
stscap10.c:1998: warning: large integer implicitly truncated to unsigned type
stscap10.c: At top level:
stscap10.c:2453: warning: `State_init' initialized and declared `extern'
stscap10.c:2521: warning: `State_append1' initialized and declared `extern'
stscap10.c:2597: warning: `State_append2' initialized and declared `extern'
stscap10.c:2656: warning: `State_delete' initialized and declared `extern'
stscap10.c:2682: warning: `State_close' initialized and declared `extern'
stscap10.o(.text+0x1b8e): In function `sys_err':
: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead
stscap10.o(.text+0x1b82): In function `sys_err':
: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead
stscap10.o(.text+0x1b58): In function `sys_err':
: undefined reference to `errno'
stscap10.o(.text+0x1b74): In function `sys_err':
: undefined reference to `errno'
stscap10.o(.text+0x1b7c): In function `sys_err':
: undefined reference to `errno'
collect2: ld returned 1 exit status
make: *** [stscap10] Error 1
COMPILE_ERROR IN stscap10.pc
sttilp10.pc
make: *** [sttilp10] Error 1
COMPILE_ERROR IN sttilp10.pc
Can anyone help me?
Many thanks,
CarlosI had exactly the same problem with the PCC-F-NOERRFILE error.
I think that my oracle installation didn't go completely
smoothly and that's why certain files did not seem to be
properly installed, but here's what I did to get past the
error:
Go to the directory where your oracle distribution is before
it was installed. That is /usr/prod/oracle on my system, and
it's probably different on yours. Look at the message files in
precomp/mesg. Chances are, these files were not completely
installed during the installation. I copied them by hand into
the target directory of my installatio, which is
/usr/u01/oracle/product/8.0.5/precomp/mesg on my system. Now I
am able to run proc without any problem.
Hope that helps.
Simon
Matt Miller (guest) wrote:
: I have just finished installing 8.0.5.1 on RedHat 5.2 and
setting
: up a database. Everything works well after installing the
: glibcpatch. Now I want to compile some Pro*C programs but proc
is
: not found in the $ORACLE_HOME/bin directory. The oracle
install
: program, orainst, says that it was installed. The
: $ORACLE_HOME/precomp directory looks OK except it was missing
: the
: /admin/pcscfg.cfg file which I have now created according to
: instructions I found in the 8.0.5 FAQ. I found the proc
: executable in the distribution directory and copied it into my
: bin directory.
: When I run it, I get the following message:
: "PCC-F-NOERRFILE, unable to open error message file, facility
: PR2"
: Can anyone help me get the Pro*C installed correctly or am I
: just not using it correctly?
: I am not experienced with Pro*C, but very familiar with Oracle
: Server.
: Thanks in advance
: matt
null -
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 -
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 GenetHi
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 -
Enbedding PL/SQL function in Pro Cobol
HI,
I am trying to compile an existing pro cobol program because of a small enhancement. I am trying to embed a pl/sql function in to the program..and the compiler is throwing errors.Can someone please tell me what i am doing wrong? Please look at the piece of code that i added to the existing program.I have set the Oracle option sqlcheck = semantic...
exec sql execute
BEGIN
finddatatype(:ws-destination-tbl1,
:ws-destination-tbl-col-1,
:ws-data-type);
END;
end-exec
nullIt's been a while since I used Pro*C but I think sqlcheck should be set to FULL not SEMANTICS for embedded PL/SQL.
Maybe this is the same for Pro*Cobol? -
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 -
Compiling of pro*C applications
when i am compiling pro*c application - I am getting the error
"internal error failed assertions (PGE Code 90105)"
what will be the cause> sir
my os is sun 6500 and oracle is 8.0.5.
thank u
suryanarayanan chief accounts officer bsnl chennai telephones chennai indiaHi,
I have never done the migration from 7.3 to 9i. But I had done 8.0 to 8i and 8i to 9i.
Pl/SQL code should work fine as it is. I wonder what will happen if you have any variables declared VARCHAR (not VARCHAR2) ? There can be few places like that, if the application was originally written on Oracle 6.Otherwise, the code should work as it is.
Regarding Pro*C, you need to use the new make file which has come with 9i.
Also, I do not remember exactly, but probably, you need to initialize all VARCHAR veriables declared between BEGIN DECLARE SECTION and END DECLARE SECTION. Initialize all of them with \0 (NULL charactor).
I think that should be enough for 7.x application to run on 9i.
Regards -
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
Maybe you are looking for
-
Power Mac g3 Blue & white no video feed
i have a g3 blue and white 350mhz, and it has no video feed it powers up and the hard disk spins up but no video feed
-
Hi Experts, Can anyone please explain record mode ( N, X, " " , and R) with an example. Thanks, DV
-
Hello! I have a very nice PPT that I created and I've tried everthing to bring the files in to get the best looking quality = not easy. What I found to the be the best thing is to publish the PPT file to Presenter and then you have a .swf of each sli
-
Assigning categories to multiple Commodities - Smart Forms
Hi Folks, appreciate any feedback you could give, i'm creating smart forms in 11i for my company based on vendor. were looking to lock down the correct category (not editable) so requestors dont have a choice - reducing backend reclassing to the GL.
-
My family can not I message me. Is there a place to see of they are locked out?
I have a family member who texts me back on my text but we do not receive it. Is there a place where they may be locked out?????