database procedure, function
HelloThe insert statement below is used in the procedure called "schedule_vehicle_cred_check."
There are "vpp_error_log" for the "error_program" function name column in the table, I'm not able to understand this.
could someone help?
insert into vpp_error_log
(
error_id,
error_type,
error_message,
error_date,
error_program
)
values
(
null,
'2',
err_num ||':' ||err_msg ||','||' Error in vehicle credential check' || ref_rec.vpp_vehicle_seq_number,
sysdate,
'schedule_vehicle_cred_check' <----------------------
);
Muriel Ram wrote:
Hello
The insert statement below is used in the procedure called "schedule_vehicle_cred_check."
There are "vpp_error_log" for the "error_program" function name column in the table, I'm not able to understand this.
could someone help?insert into vpp_error_log ( error_id, error_type, error_message, error_date, error_program ) values ( null, '2', err_num ||':' ||err_msg ||','||' Error in vehicle credential check' || ref_rec.vpp_vehicle_seq_number, sysdate, 'schedule_vehicle_cred_check' <---------------------- );
This isn't a function name, it is just a literal string. Looks like it is the registration of the name of a program or procedure that took trapped in an error, but in the end, it is simply insert the literal "schedule_vehicle_cred_check" in the ERROR_PROGRAM column
Tags: Database
Similar Questions
-
Difference of procedure &; function
Hi all
After citing some tutorials, I got to know that the difference between the procedure and the function is that the procedure may or may not return a value as the function must return a value to the calling program. Given below is my procedure. & He would compare the lower of the two numbers would be smaller than
create or replace procedure findmin
(
x in number,
there in numbers,
z series
)
is
Start
if(x<y) then
z: = x;
on the other
z: = y;
end if;
end;
declare
c number;
Start
findmin (23,45,c);
dbms_output.put_line (c);
end;
Here's my function even if it does the same thing.
create or replace function findmin_fun
(
x in number,
y number
)
Return number
is
number of z;
Start
if(x<y) then
z: = x;
on the other
z: = y;
end if;
Return z;
end;
declare
Start
dbms_output.put_line (findmin_fun (56,28));
end;
I would like to know under what are all the scenarios of the procedure and function would be used. And also I want to know could do dml as insert, update, and delete operations
If so, could you guys explain me with some examples to expose DML operations on functions
After citing some tutorials, I got to know the difference between the procedure & function is that the procedure may or may not return a value as the function must return a value to the calling program.
Not quite.
A procedure does NOT return a value - it can fill in the parameters OUT or INOUT but which is NOT considered to be "of return values.
A function ALWAYS returns a value that can be null. The only exception is if the function throws an exception.
My procedure is given below. It would be to compare the lower of the two numbers & would mean that smaller
Not quite - the procedure returns NO value. You use it to try to fill one OUT parameter, but it's NOT the same.
I would like to know under what are all the scenarios the procedure & function would be used.
Functions can be used in SQL; procedures cannot be used in SQL.
The functions return a value; procedures of does NOT return a value.
Use the functions when you need to return a value; Use the procedures when you do NOT need to return a value.
It is not possible to list 'all scenarios' for one or the other, because there may be ANY NUMBER of possible scenarios.
And also I want to know could do dml as insert operations, update & delete
What happened when you tried?
The best and fastest, to learn is to actually TRY THINGS. Don't be afraid to break the Oracle by actually writing code and tests of things yourself.
If so, could you guys explain me with some examples to expose DML operations on functions
The Oracle documentation have a LOT of examples of using functions and procedures and include the code of the example.
https://docs.Oracle.com/CD/E11882_01/AppDev.112/e25519/subprograms.htm#CHDBEJGF
The internet has even more examples of code.
-
Updated APEX collection error ORA-04044: procedure, function, package, type
Hi all
I am trying to update the APEX MEMBER of the COLLECTION and encounter errors:
1 error has occurred
ORA-06550: line 9, column 8: PL/SQL: ORA-04044: procedure, function, package or type is not allowed here ORA-06550: line 7, column 3: PL/SQL: statement ignored
The PLSQL code are as below
DECLARE
entire x;
v_date_started VARCHAR2 (255);
v_date_finished VARCHAR2 (255);
BEGIN
SELECT c.seq_id
X
OF APEX_COLLECTION c
WHERE collection_name = "PHASE_COLLECTION."
AND c001 =: P41_MPM_ID
and rownum = 1;
v_date_started: =: P41_DATE_STARTED;
v_date_finished: =: P41_DATE_FINISHED;
APEX_COLLECTION. () UPDATE_MEMBER
p_collection_name = > 'PHASE_COLLECTION '.
, p_seq = > x
, p_c004 = > v_date_started
, P_c005 = > v_date_finished
);
END;
The process will take place after SUBMIT and validation.
The code I used to add a colletion APEX will work perfectly and is as below
-Initialization Collection PHASE_COLLECTION
BEGIN
IF THIS ISN'T APEX_COLLECTION. COLLECTION_EXISTS('PHASE_COLLECTION') THEN
APEX_COLLECTION. CREATE_COLLECTION ('PHASE_COLLECTION');
ON THE OTHER
APEX_COLLECTION. TRUNCATE_COLLECTION ('PHASE_COLLECTION');
END IF;
-Add members to the COLLECTION PHASE of table PHASE_MEMBERSHIP
IF: P41_MPM_ENG_ID IS NOT NULL THEN
FOR x IN (SELECT mpm_id, mpm_eng_id, phase_number, date_started, date_finished, date_created
OF phase_membership
WHERE mpm_eng_id =: P41_MPM_ENG_ID
AND active = 1
ORDER BY date_created)
LOOP
APEX_COLLECTION. ADD_MEMBER
(p_collection_name = > 'PHASE_COLLECTION')
, p_c001 = > x.MPM_ID
, p_c002 = > x.MPM_ENG_ID
, p_c003 = > x.PHASE_NUMBER
, p_c004 = > x.DATE_STARTED
, p_c005 = > x.DATE_FINISHED
, p_c006 = > x.DATE_CREATED
);
END LOOP;
END IF;
EXCEPTION
WHILE OTHERS THEN
Logger.Error (p_message_text = > SQLERRM)
, p_message_code = > SQLCODE
, p_stack_trace = > dbms_utility.format_error_backtrace
);
LIFT;
END;
What I tried to use APEX_COLLETION to check the overlap between the date_range.
The requirement is just to display a warning if the user adds a record to the new phase or update record of current phase may overlap between the order of phase together.
Table PHASE_MEMBERSHIP script is
CREATE TABLE 'PHASE_MEMBERSHIP '.
(
ACTIVATE THE "MPM_ID" NUMBER NOT NULL,
ACTIVATE THE "MPM_ENG_ID" NUMBER NOT NULL,
ACTIVATE THE "PHASE_NUMBER" NUMBER (2.0) NOT NULL,
"DATE_STARTED" DATE NOT NULL ACTIVATE.
DATE OF THE "DATE_FINISHED."
'NOTES' VARCHAR2 (2000 BYTE),
'DATE_CREATED' DATE NOT NULL ACTIVATE.
ACTIVATE THE 'CREATED_BY' VARCHAR2 (20 BYTE) NOT NULL,
NUMBER (2.0) 'ACTIVE' DEFAULT 1 ACTIVATE NOT NULL)
So, basically, I want to fill the documents associated with a particular to a collection of APEX called PHASE_COLLECTION MPM_ENG_ID.
Then when the user specify date_started and date_finished, it will update/insert the APEX collection first.
Then the rank based on audit collection date
http://www.Oracle-base.com/articles/Misc/overlapping-date-ranges.php
then display the warning to ask the user to confirm message.
But then I'm stuck at the step of updating COLLECTION of APEX.
If anyone has any ideas on what is wrong, please help.
Thanks in advance.
AnnYour syntx error line number should give you the trick - it is not a member of the update, rather the SQL - you are referring to apex_collection, not apex_collections view dictionary.
Scott
-
Database Validation function Question
In the Page 37 of the APEX_listener_v1.pdf, it is mentioned that we can create a function "check_valid_procedure".
I guess it's similar to the version of the EPG, wwv_flow_epg_include_mod_local.
My problem is that the admin screen will not accept it.
Request could not be processed due to the error:
Sea 14 Jul 09:58:48 EDT 2010
Database Validation function CHECK_VALID_PROCEDURE is not valid.
Should what I use to create this function?You will need to prepend the proc with the diagram unless you've granted to public and have a public syn your help.
-kris -
Build a complicated procedure/function
Hello world
I am creating a complicated procedure.
I have three columns:
Column C contains a result. So, I need to find how this result was built. In other words, this procedure/function must answer the question:line A B C 1 5.5 3.2 - 2 1.05 6.1 - 3 0.6 7.8 - 4 6.4 4.13 - 5 - - 8.98
What are the numbers in columns A and B, which has contributed to achieve this result.
In this example, we found that:
(there is a condition: we cannot do so one number per line is selected.: A(1) + B(1).)C = B(1) + A(2) + A(3) + B(4) = 3.2 + 1.05 + 0.6 + 4.13 = 8.98
Concerning
Published by: zakaria84 on May 22, 2009 15:25
Published by: zakaria84 on May 22, 2009 15:49Hello Zakaria,
Here is a right solution with SQL:
SQL> create table giventable (a,b,c) 2 as 3 select 5.5, 3.2, null from dual union all 4 select 1.05, 6.1, null from dual union all 5 select .6, 7.8, null from dual union all 6 select 6.4, 4.13, null from dual union all 7 select null, null, 8.98 from dual 8 / Tabel is aangemaakt. SQL> create table resulttable as select * from giventable where 1=0 2 / Tabel is aangemaakt. SQL> insert into resulttable 2 select a 3 , b 4 , null 5 from ( select case mod(trunc(l/power(2,line)),2) when 0 then a else null end a 6 , case mod(trunc(l/power(2,line)),2) when 1 then b else null end b 7 , sum(case mod(trunc(l/power(2,line)),2) when 0 then a else b end) over (partition by l) x 8 from ( select a 9 , b 10 , row_number() over (order by null) - 1 line 11 from giventable 12 where c is null 13 ) 14 , ( select level - 1 l 15 from dual 16 connect by level <= power(2,(select count(*) from giventable where c is null)) 17 ) 18 ) 19 where x = (select c from giventable where c is not null) 20 union all 21 select null 22 , null 23 , c 24 from giventable 25 where c is not null 26 / 5 rijen zijn aangemaakt. SQL> select * from resulttable 2 / A B C ---------- ---------- ---------- 3,2 1,05 4,13 ,6 8,98 5 rijen zijn geselecteerd.
Kind regards
Rob. -
Hi all
Basic question:
1 oracle objects as a synonym, trigger, procedures, views, function (of a particular user) where these items will be present? Is - this data dictionary user default tablespace or system?
2. the user have create session, synonym to create, select any user of permission.and table have default tablespace DATA.
(a) if the user has create any synonym it will store in the tablespace DATA?
(b) if the user can able to select a table only or can see all notices and the level of database functions?
Thank you903787 wrote:
Sorry, I don't understand could you please it explain.After SQL & results that show how the synonym of space, function, view, & trigger consume in your DB.
-
solution in OWB, procedure/function
I have different columns in different tables, with values 0 or 1.
In the tables in the target, a 0 is no. and 1 Yes.
What is the best way to implement this.
a function/procedure on the database using as a transformation in OWB or
is there a better solution in OWB.
Another question: will I maps the columns separately or is there a way to map all columns through the 1 design element (transformation? expression?)?You will have problems with route mapping plug-in for the re-use of expressions since each use is considered to be a set of independent lines. That would leave functions as the first choice. ODI, reusable expressions can be made using the user-defined functions, with the latter in the code is placed online.
See you soon
David -
Why is conversion of procedures &; functions due to lack of MySQL to Oracle?
Hi all
I'm trying to migrate a database from MySQL to Oracle using the Migration Workbench data in SQL Developer 1.5.4.
I ran both the quick Migration Wizard and the Manual Migration process as described in the documentation.
I get through the process very well, even if not everything is successfully migrated. Namely, stored procedures and functions of the database of third parties are not correctly migrated.
The following text is listed in the Migration log for each of the stored procedures and functions:
* "Limitation of the translation"procedure_audit requires a translation of the manual"met on the column of the stored procedure fse.procedure_audit line 0-0."
If I look at the 'converted' model the procedure has been created and is set to NULL. The procedure of 'captured the model' original is commented out in the body of the procedure in the "convert" template Does anyone have any ideas as to why it's a failure? And how do I fix it?
In addition, there seems to be a problem with the conversion of the index, particularly those that are 'MAJOR' indexes in MySQL not appear in models 'captured' or 'converted '.
In addition, the migration log provides the following:
* "Index 'customer_customer_id' on the 'customer' table ' has been ignored, because it is a duplicate of a constraint" * "
Looking at the index in the original third party database, it does appear that an index on that column on the respective table. The ides why this happens?
Here, any help would be immensely appreciated.
Thank you
Amedeo.Mysql stored procedure to PL/SQL function is not available, or in the direction sqldeveloper statement:
http://www.Oracle.com/technology/products/database/sql_developer/files/sqldeveloperstatementofdirection.htm
-Turloch
-
DB procedure / function can return multiple values in a PL/SQL block
Hi all
I have a problem returning to the exit procedure following in PL/SQL because I have SELECT INTO variable but with no output back in my PL/SQL block even if I turned it into a function.
. pls suggest.
CREATE OR REPLACE PROCEDURE nominations (p_start_date AS, p_end_date IN DATE)
IS
v_day_id PLS_INTEGER;
v_day_name VARCHAR2 (33);
v_day_date DATE;
BEGIN
SELECT (2 + (p_start_date + (LEVEL - 1) + LEVEL - 1 - TRUNK (LEVEL - 1 + 1, "IW" + p_start_date)) AS day_id
, TO_CHAR (LEVEL - 1, 'Day' + p_start_date) AS day_name
, TO_CHAR (LEVEL - 1, "DD-MM-RRRR" + p_start_date) AS day_date
IN v_day_id, v_day_name, v_day_date
OF THE DOUBLE
CONNECTION OF LEVEL < = 1 + p_end_date - p_start_date;
END;
/
Your insert would be something like this:
INSERT INTO PR_OPS_APPOINT_SETS (SPEC_CODE1, SPEC_CODE2, CLINIC_NO, SECTOR_ID, USER_ID, APPOINT_DATE)
SELECT r.SPEC_CODE1, r.SPEC_CODE2, r.CLINIC_NO, r.SECTOR_ID, USER, d.APPOINT_DATE
PR_OPS_CLINIC_RECS r
CROSS JOIN)
SELECT TO_DATE (TO_CHAR (LEVEL - 1, "MM/DD/RRRR" + p_start_date), "MM/DD/RRRR") AS APPOINT_DATE
OF THE DOUBLE
CONNECT BY LEVEL<= p_end_date="" -="" p_start_date="" +="">=>
) d
WHERE SPEC_CODE1 = p_SPEC_CODE1
AND SPEC_CODE2 = p_SPEC_CODE2
AND CLINIC_NO = p_CLINIC_NO
AND SECTOR_ID = P_SECTOR_ID;
In terms of getting the parameters p_SPEC_CODE1, p_SPEC_CODE2, p_CLINIC_NO, P_SECTOR_ID...? I don't have enough information on your part.
-
Plan does not show the local procedures/functions
Hello
SQLD 4.1
I use the preview to a plsql procedure feature. The procedure provides a local procedure.
In the window structure the local procedure does not at all. Declared variables and cursors in the local procedure are displayed, but as if they where in the main proceedings.
Local procedures and functions should be displayed in the window structure. It would be nice if the declares the variables and cursors of a local proceeding would be arranged in suchs a means, it is visible that they belong to this local procedure, perhaps using an indentation.
Best regards
Joop
Hey, Joop!
A mysterious person, known only as "SF" for the purpose of this response, has also reported this to me. We have filed a bug on this subject, and it shows as 'fixed' in 4.1.1.
-
12.1.3 extension XSLT editor Query-database mapping function
Hello
, We are trying to move from 11.1.1.7 to 12.1.3 JDeveloper. We have developed a number of xsl maps in 11.1.1.7 using the function oraext:query - database Oracle extension (where the namespace oraext is xmlns:oraext ="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc" "). This works in JDeveloper 11.1.1.7 when the test of the card where the call to the map looks like this:
< xsl: value-of select = "oraext:query - database (concat (& quot; Select fvalue GetMapCodeList ("param1", "param2", "param3") of double, quot;), false (), false (), & quot;jdbc:oracle:thin:dbuser/dbpassword@dbhost:1521:dbservicename & quot;) "/ >"
In the statement select above is "select GetMapCodeList" which is a function defined in the database which takes 3 parameters. This works very well for us in 11.1.1.7. We are new to 12.1.3 and we get an error test map XSLT in JDeveloper. The error is
file:/[file path] / [file name] .xsl: XML-22044: function (error) Extension error: Error invoking 'queryDatabase':'java.lang.NoClassDefFoundError: oracle/jdbc/OracleConnection '.
It seems that it cannot find the ojdbc6.jar file, but I don't see where that should be added.
Edit:
OK, I realized that the extension functions XPath of Oracle do not appear in my XSLT Map Editor component palette. I also see that when I change the XPath of the oraext:query - database is highlighted by JDev as being invalid. I think my problem is with the extension being not loaded XPath functions.
Thanks in advance.
Steve
OK, after working with the support of the Oracle, the answer is that the ojdbc6.jar did indeed need to be added to the configuration of JDeveloper 12.1.3. To do this the following line was added at the end of the jdev.conf file:
AddVMOption - Xbootclasspath/r:... /... /.. /oracle_common/modules/Oracle.jdbc_12.1.0/ojdbc6.jar
The jdev.conf file is located in your Oracle_Home\jdeveloper\jdev\bin directory. Don't forget to adjust the relative path to match your environment. In addition, please note that the only spaces in the AddVMOption line are a space immediately after "AddVMOption".
Another concern in this thread that the functions of data base in the XPath Group advanced components from the component Palette was missing. The groups Advanced general XPath XPath and XSLT components model will appear only in the component Palette if the application is a SOA application.
A score more. I don't know if Oracle sees this as a bug and the ojdbc6.jar to be in the classpath without the user set it up like that in the jdev.conf. If it's a bug, and then if all goes well it will be resolved in a future release, and this configuration will be necessary.
-
Get the CGI env variables in a database procedure using the new listener to the APEX
I already posted this question in the earpiece of the Apex forum and still no response after a week. The original post is here:
So please forgive me for posting in this forum as well, but there is much more activity here.
I would like to know how I can get the CGI environment to the listener of the APEX. For example, if I want to write a procedure that inserts into a table, the client web request originating IP address, how do it?
I am familiar with the Oracle Http Server and mod_plsql, and I know how to call OWA_UTIL. GET_CGI_ENV to get this kind of information. How can I do this by using the earpiece of the APEX?
In particular, how to do that when you call a custom (not in a workspace Apex) procedure? When I try now, I get an error owa_util. The cgi env seems to be empty or not initiated (owa.num_cgi_vars is null or zero).
Specific settings:
I have a web server running the last JDK, Glassfish and 1.1.4 Apex listener. It connects to another server running the last database 11.2. Apex is installed and running, but I'm not really developing a traditional Apex application in a workspace. I use it mainly as you would use mod_plsql. In other words, I have packages of pl/sql custom which are called directly via a URL. Applications must be sent by the listener to the database and DB executes the procedure and returns output using htp.p to send the text to the browser. And it works very well for this purpose. But if I want to call GET_CGI_ENV to get information such as IP address, the browser making the request, etc. I can't get with the OWA packages.
Anyone can shed some light on this? If the listener of the Apex is not designed to do this, is it some kind of workaround that I can use to transfer such information to the database for each request?Hi Adam,.
APEX is located on the top of the Toolbox for OWA. There is no appeal of the special procedure to be implemented.
Kind regards
Christian -
Calling a database procedure which returns the array as output parameters
Hello
I wanted to call a procedure that returns "T_Disponibilidad_Diaria".
Type T_Disponibilidad_Diaria is Table of the R_Disponibilidad_Diaria
INDEX OF DIRECTORY;
Type R_Disponibilidad_Diaria is {Record
}
Please suggest me the best way to convert this type of array complex java object
Thanks in advance
Concerning
VidyaBut what you can do...
Try to create a new stored procedure, which returns the type of the database object.
In this procedure, you can call the original procedure.
Take what it returns and make the type object. That's what you need to retrieve your procedure ;-) (.. .huh?) -
Tlist to reliable independent package/procedure/function
I want to know the list of tables with is not in the package/procedure and function.
I did a procedure to find a few tables, but do not come from this procedure. It is not also the view user_source. But the tables are usued on this particular package.
create table procedure_name (proc_name varchar2 (30), varchar2 (30)) from table_name;
CREATE OR REPLACE PROCEDURE prc_table_found IS
cursor c1 is select table_name DISTINCT from user_tables;
v_table_name varchar2 (30);
v_str varchar2 (10000);
TYPE t_procedure IS TABLE OF THE user_source.name%TYPE;
l_tab t_procedure;
BEGIN
Open c1;
loop
Fetch c1 into v_table_name;
OUTPUT WHEN c1% NOTFOUND;
v_str: =' select distinct name from user_source
where the text like ' | " ' ||' %'|| v_table_name | » %'||'''';
dbms_output.put_line (v_str);
execute immediate v_str in bulk collect into l_tab;
If l_tab.count > 0 then
for me in l_tab.first... loop of l_tab. Last
Insert into procedure_name (proc_name, table_name) values (l_tab (i), v_table_name);
commit;
end loop;
on the other
null;
end if;
end loop;
Close c1;
END;
exec prc_table_found;
Select distinct table_name from user_tables
less
Select distinct procedure_name tbl_name
;Hello
http://download.Oracle.com/docs/CD/B14117_01/server.101/b10755/statviews_2513.htmSomething like that
select * from user_tables t where t.table_name not in ( select distinct e.referenced_name from user_dependencies e where e.referenced_type = 'TABLE' )
Edited by: user6806750 the 14.10.2011 01:00
-
Can be passed to the formula of the procedure/function the column value?
Cf_value is back after some calculation using the main request.
Can be passed directly the value of column of formulas of procedure without assinged to placeorder?
as below...
f_convert(:cf_value,new_value);
---------------------------------------------------------------
My procedure is...
PROCEDURE f_convert (val1 val2 in number, number) IS
BEGIN
val2: = val1 * 100;
END;
If anyone knows pls answer me...In fact, if there is that other calculations he (in Proceudre)
Can I used is like below?
---
PROCEDURE f_convert (val1 val2 in number, number) ISBEGIN
val2: = val1 * 100;
return (val2);
END;
----A procedure cannot return a value, the return in my previous post clause was part of the function for formula column.
Let's say you have a column of forms of so-called CF_2, then the function because it will be like:function cf_2formula return number is val1 number; val2 number; begin val2 := :cf_1 * 100; -- or val2 := val1 * 100 --parameters not allowed in formula column function -- All the other code that you need inclusive of calling function, procedure as in any PL/SQL block can be placed return (val2); end;
Any calculation can be used in the service of the formula column
Maybe you are looking for
-
My Photo Duplicate Cleaner will not identify many obvious duplicates I have in a folder on the desktop. The folder is also a problem being slipped and fell into the cleaner of Photos for verification, but eventually could be verified. Photos Duplic
-
Problem with LabPython - implement the Python Server
I booted the server as follows: It was made as a separate VI, and I ran it before the opening of any other VI. Initializes the server, but I can't get the variables of thethe code is calculated. Here is a very simple program, with itserror code. I wa
-
Pavllion dv7: seeing orange mute for dv7 pavllion
Mute my button is Orange & I can't return to the green or blue when I touch I get no sound at all on the right bottom corner where it shows the volume when I touch the mute botton it shows silent then on but orange button mute do not change in blue o
-
Pavilion 11-n011dx: battery and other improvements
I bought this laptop in may for my family to use. They were satisfied with the life of the battery, so I thought well lets just buy a new one. But, this isn't one of those models where the battery is directly accessible, I guess I have to disassemble
-
my mp3 player doesn't play music whitch I have synced to mymlaptop
I sync music from my laptop to player.my mp3 music is transferred ok but it will not play on mp3 I bought the new MP3 even result delete all mp3 music and started again without change