How to run a procedure of APEX?
Good nightI have created a process to read a flat file and stores it in a database, I've tried for SQL console and it worked very well, so I created an application that calls the procedure of the button, but not agree, it must be
file_browse: select the file to load...
Source
Process [Download Source]
-------------------------------------------------- -------------------------------------------------- ---------
Declare
Start
Proc_Read_File (: P5_LECTURA_ARCHIVOS)
end;
-------------------------------------------------- -------------------------------------------------- ---------
UTL_FILE procedure works, to do something?
I appreciate your attention and offered cooperation
This is the process:
DECLARE
utl_file.file_type v1.
VARCHAR2 (2048) v2;
number now; -Cuenta el total of characters...
CAR1 number; -Cuenta the del character position 1
car2 number; -Cuenta the del character position 1
number of tot_comas; -Contador comas
ACUM NUMBER;
CADEN VARCHAR2 (200);
NUMBER OF TOTAL_CAR;
POS_1 NUMBER;
POS_2 NUMBER;
Number of rest;
Number of Cont_Filas;
cod_archivo varchar2 (70);
-Declaracion las columns
col_1 aaa_p_hisfac_alc. Type of SUSCRIPTOR %;
col_2 aaa_p_hisfac_alc. Type of NUM_CONTRATO %;
col_3 aaa_p_hisfac_alc. Type of COD_DANE_DPTO %;
col_4 aaa_p_hisfac_alc. Type of COD_DANE_MPIO %;
col_5 aaa_p_hisfac_alc. Type of ZONA_IGAC %;
col_6 aaa_p_hisfac_alc. Type of SECTOR_IGAC %;
col_7 aaa_p_hisfac_alc. Type of MANZANA_VEREDA %;
col_8 aaa_p_hisfac_alc. Type of NUM_PREDIO %;
col_9 aaa_p_hisfac_alc. Type of CONDICION_PREDIO %;
COL_10 aaa_p_hisfac_alc. Type of DIRECCION_PREDIO %;
Col_11 Aaa_P_Hisfac_Alc.Num_Factura%Type;
Col_12 aaa_p_hisfac_alc. Type of FECHA_EXPEDICION_FACTU %;
Col_13 aaa_p_hisfac_alc. Type of FECHA_INICIO_PERIODO %;
col_14 aaa_p_hisfac_alc. Type of DIAS_FACTURADOS %;
col_15 aaa_p_hisfac_alc. Type of COD_CLASE_USO %;
col_16 aaa_p_hisfac_alc. Type of UNID_MULTIUSUARIOS_RESIDENCIAL %;
col_17 aaa_p_hisfac_alc. Type of UNID_MULTIUSARIO_NORESIDENCIAL %;
col_18 aaa_p_hisfac_alc. Type of HOGAR_COMUNITARIO %;
col_19 aaa_p_hisfac_alc. Type of USUA_FACTURADO_AFORO %;
col_20 aaa_p_hisfac_alc. Type of USUA_CON_CARACTERIZACION %;
col_21 aaa_p_hisfac_alc. Type of CARGO_FIJO %;
col_22 aaa_p_hisfac_alc. Type of CARGO_VERTIMENTO_BASICO %;
col_23 aaa_p_hisfac_alc. Type of CARGO_VERTIMENTO_COMPL %;
col_24 aaa_p_hisfac_alc. Type of CARGO_VERTIMENTO_SUNTUARIO %;
col_25 aaa_p_hisfac_alc. Type of CMT_COSTO_MEDIO_RETRIBUTIVA %;
col_26 aaa_p_hisfac_alc. Type of VERTIMENTO_PERIODO_M3%;
col_27 aaa_p_hisfac_alc. Type of VLR_FACTURADO_VERTIDO %;
col_28 aaa_p_hisfac_alc. Type of VLR_SUBSIDIO %;
col_29 aaa_p_hisfac_alc. Type of VLR_CONTRIBUCCION %;
col_30 aaa_p_hisfac_alc. Type of FACTOR_SUBS_CONTR_CARGO_FIJO %;
col_31 aaa_p_hisfac_alc. Type of FACTOR_SUBS_CONTR_VERTIMIENTO %;
col_32 aaa_p_hisfac_alc. Type of CARGOS_CONEXION %;
col_33 aaa_p_hisfac_alc. Type of PAGO_ANTICIPADO_SERVICIO %;
col_34 aaa_p_hisfac_alc. Type of DIAS_MORA %;
col_35 aaa_p_hisfac_alc. Type of VALOR_MORA %;
col_36 aaa_p_hisfac_alc. Type of INTERESES_MORA %;
col_37 aaa_p_hisfac_alc. Type of OTROS_COBROS %;
col_38 aaa_p_hisfac_alc. Type of CAUSAL_REFACTURACION %;
col_39 aaa_p_hisfac_alc. Type of NUM_FACTURA_REFACTURACION %;
col_40 aaa_p_hisfac_alc. Type of VALOR_TOTAL_FACTURADO %;
col_41 aaa_p_hisfac_alc. Type of PAGOS_PERIODO_FACTURADO %;
Start
V1: = Utl_File.Fopen ('PUBLIC_ACCESS', 'sui_facturacion_alcantarillado_15085_2011_01_76845_00A.csv', 'R', 32767);
Cont_Filas: = 1;
insert into a values (seq_aaa_p_archivos_leidos.nextval, 'sui_facturacion_alcantarillado_15085_2011_01_76845_00A.csv', sysdate, user) aaa_p_archivos_leidos;
loop
Begin
UTL_FILE.get_line (v1, v2);
-dbms_output.put_line ('El contenido're: ' | v2);
-cuenta los characters...
Select length (v2)
in cont
Double;
dbms_output.put_line ('Total characters: ': suite);
Select count (instr (v2, ','))
in tot_comas
Double;
tot_comas: = 1;
ACUM: = 1;
Pos_1: = 0;
While ACUM < = 41
LOOP
Select instr (V2, ',', 1, ACUM) PRUEBA
IN POS_2
FROM DUAL;
dbms_output.put_line ('-> POSITION TOTAL 1' |) POS_1);
dbms_output.put_line (' POSITION TOTAL 2-> ' |) POS_2);
REST: = (POS_2-POS_1)-1;
SUBSTR (,(POS_1+1), REST V2) SELECT PRUEBA2
BY CADEN
FROM DUAL;
dbms_output.put_line (' CADENA SELECCIONADA-> ' |) CADEN);
-Expressions, variable values of las Br...
If Cont_Filas = 1 Then
Dbms_Output.put_line (' no pasa nada...');
On the other
If acum = 1 then
Col_1: = Caden;
Elsif Acum = 2 Then
Col_2: = Caden;
Elsif Acum = 3 Then
col_3: = CADEN;
Elsif Acum = 4 Then
col_4: = CADEN;
Elsif Acum = 5 Then
col_5: = CADEN;
Elsif acum = 6 then
col_6: = CADEN;
Elsif acum = 7 then
col_7: = CADEN;
Elsif acum = 8 then
col_8: = CADEN;
Elsif Acum = 9 Then
Col_9: = Caden;
Elsif acum = 10 then
Col_10: = Caden;
Elsif acum = 11 then
Col_11: = Caden;
Elsif Acum = 12 Then
Col_12: = Caden;
Elsif Acum = 13 then
Col_13: = Caden;
Elsif Acum = 14 then
Col_14: = Caden;
Elsif Acum = 15 then
col_15: = CADEN;
Elsif Acum = 16 then
Col_16: = Caden;
Elsif acum = 17 then
Col_17: = Caden;
Elsif acum = 18 then
Col_18: = Caden;
Elsif Acum = 19 then
Col_19: = Caden;
Elsif Acum = 20 then
Col_20: = Caden;
Elsif acum = 21 then
Col_21: = Caden;
Elsif Acum = 22 then
Col_22: = Caden;
Elsif Acum = 23 then
Col_23: = Caden;
Elsif Acum = 24 then
Col_24: = Caden;
Elsif Acum = 25 then
Col_25: = Caden;
Elsif Acum = 26 then
Col_26: = Caden;
Elsif Acum = 27 then
Col_27: = Caden;
Elsif Acum = 28 then
Col_28: = Caden;
Elsif Acum = 29 then
Col_29: = Caden;
Elsif Acum = 30 then
Col_30: = Caden;
Elsif Acum = 31 then
Col_31: = Caden;
Elsif Acum = 32 then
Col_32: = Caden;
Elsif Acum = 33 then
col_33: = CADEN;
Elsif Acum = 34 then
Col_34: = Caden;
Elsif Acum = 35 then
Col_35: = Caden;
Elsif Acum = 36 then
Col_36: = Caden;
Elsif Acum = 37 then
Col_37: = Caden;
Elsif Acum = 38 then
Col_38: = Caden;
Elsif Acum = 39 then
Col_39: = Caden;
Elsif Acum = 40 then
Col_40: = Caden;
Elsif acum = 41 then
Col_41: = Caden;
-trae el Código del archivo...
Select Id_Archivo
In Cod_Archivo
Of Aaa_P_Archivos_Leidos
Where number = "sui_facturacion_alcantarillado_15085_2011_01_76845_00A.csv";
-inserta fila acquired the playback...
insert into aaa_p_hisfac_alc (ID_AAA_HISFAC, SUSCRIPTOR, NUM_CONTRATO, COD_DANE_DPTO, COD_DANE_MPIO, ZONA_IGAC, SECTOR_IGAC, MANZANA_VEREDA,
NUM_PREDIO, CONDICION_PREDIO, DIRECCION_PREDIO, NUM_FACTURA, FECHA_EXPEDICION_FACTU, FECHA_INICIO_PERIODO, DIAS_FACTURADOS,
COD_CLASE_USO, UNID_MULTIUSUARIOS_RESIDENCIAL, UNID_MULTIUSARIO_NORESIDENCIAL, HOGAR_COMUNITARIO, USUA_FACTURADO_AFORO, USUA_CON_CARACTERIZACION,
CARGO_FIJO, CARGO_VERTIMENTO_BASICO, CARGO_VERTIMENTO_COMPL, CARGO_VERTIMENTO_SUNTUARIO, CMT_COSTO_MEDIO_RETRIBUTIVA, VERTIMENTO_PERIODO_M3,
VLR_FACTURADO_VERTIDO, VLR_SUBSIDIO, VLR_CONTRIBUCCION, FACTOR_SUBS_CONTR_CARGO_FIJO, FACTOR_SUBS_CONTR_VERTIMIENTO, CARGOS_CONEXION, PAGO_ANTICIPADO_SERVICIO,
Dias_Mora, Valor_Mora, Intereses_Mora, Otros_Cobros, Causal_Refacturacion, Num_Factura_Refacturacion, Valor_Total_Facturado, Pagos_Periodo_Facturado, Cod_Archivo)
Values (Seq_Aaa_P_Hisfac_Alc.nextval, col_1, col_2, col_3, col_4, col_5, col_6, col_7, col_8, col_9, col_10, col_11, col_12, col_13, col_14,
Col_15, Col_16, Col_17, Col_18, Col_19, Col_20, Col_21, Col_22, Col_23, Col_24, Col_25, Col_26, Col_27,
col_28, col_29, col_30, col_31, col_32, col_33, col_34, col_35, col_36, col_37, col_38, col_39, col_40, col_41, Cod_Archivo);
End If;
end if;
ACUM: = NOW + 1;
Pos_1: = Pos_2;
Tot_Comas: = Tot_Comas + 1;
End loop;
cont_filas: = cont_filas + 1;
Dbms_Output.put_line (' contains United Nations total: ' |) Tot_Comas | «comas...» ») ;
Dbms_Output.put_line (' contains United Nations total: ' | cont_filas |) "filas");
exception
When no_data_found then
"exit";
end;
dbms_output.put_line ('-'); -LINEA SALTO
dbms_output.put_line ('-'); -LINEA SALTO
end loop;
dbms_output.put_line ('-->'); -LINEA SALTO
dbms_output.put_line ('-' | cont); -LINEA SALTO
Dbms_Output.put_line (' the value of the columna es 2 ' | col_1);
UTL_FILE.fclose (v1);
exception
while others then
dbms_output.put_line (SQLERRM);
end;
/
and permissions already due...
I appreciate your attention and offered cooperation
Reynel Salazar Martinez+.
There are discussions here of the past showing how to upload a CSV (comma-delimited file) to an existing table... Here's an example blog which may help: http://oraexplorer.com/2007/11/apex-to-upload-text-file-and-write-into/
Thank you
Tony Miller
Webster, TX
Follow your passion; the rest will take care of itself.
JMS
If you answer this question, please mark the thread as closed and give points where won...
Tags: Database
Similar Questions
-
How to run a procedure with refcursor to more
an entry is User_id = CMSH_USER; p_Ot-num =-9999; p_ppst_flag = 'P' and I want to take the trace by running this procedure, and any1 help me, how to run this procedure below and how to use these 5 on refcursor...
procedure Pr_get_mny(p_ot_Num IN NUMBER, p_User_Id IN VARCHAR2, p_Ppst_Flag IN VARCHAR2, Ref_Cur OUT Ref_Cursor, CUR_OPT OUT Ref_Cursor, CUR_TAXRATE OUT Ref_Cursor, CUR_TAXHOLD OUT Ref_Cursor, CUR_PENDGAACNT OUT Ref_Cursor ) IS
If the goal is to Test, the best tool is SQL
var ref_cur refcursor var cur_opt refcursor var cur_taxrate refcursor var cur_taxhold refcursor var cur_pendgaacnt refcursor exec pr_get_mny(-9999,'CMSH_USER','P',:ref_cur,:cur_opt,:cur_taxrate,:cur_taxhold,:cur_pendgaacnt) print ref_cur print cur_opt print cur_taxrate print cur_taxhold print cur_pendgaacnt
-
How to run a procedure with parameters in pl/sql collections?
I created a procedure with parameter from the collection. Can somone help me how to run a procedure in passing the parameters in the collection.
Package and how to create is successful. But I get the error message when executing the procedure.
ORA-06550: line 3, column 19:
PLS-00222: no function with name 'T_TAB' does exist in this scope
I gave the example of code here. Can someone please help me solve this problem.
-Spec package
create or replace package pkg_dist is
TABLE index IS THE NUMBER of t_tab_num TYPE of PLS_INTEGER;
procedure prc_test (a t_tab_num IN,
b IN t_tab_num,
c IN OUT t_tab_num);
end pkg_dist;
-Package body
create or replace package body is pkg_dist
procedure prc_test (a t_tab_num IN,
b IN t_tab_num,
c IN OUT t_tab_num) is
Start
IF (a (16) = 0) then
(16) c: = 0;
c (17): = 0;
c (18): = 0;
end if;
c (15): = (14)-(15)-a (16);
(16) c: = b (16) /b (17);
c (17): = 50;
(18) c: = a (16) * 2;
end prc_test;
end pkg_dist;
-executeing procedure
declare
TABLE index IS THE NUMBER of t_tab TYPE of PLS_INTEGER;
x t_tab: = t_tab (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
y t_tab: = t_tab (0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500);
z t_tab;
BEGIN
pkg_dist.prc_test (x, y, z);
dbms_output.put_line (z (18));
END;
Error:
--------------------------------------------------------------------------------
ORA-06550: line 3, column 19:
PLS-00222: no function with name 'T_TAB' does exist in this scopeMy suggestion would be:
CREATE OR REPLACE PACKAGE pkg_dist IS PROCEDURE prc_test (a IN SYS.odcinumberlist, b IN SYS.odcinumberlist, c IN OUT SYS.odcinumberlist); END pkg_dist; CREATE OR REPLACE PACKAGE BODY pkg_dist IS PROCEDURE prc_test (a IN SYS.odcinumberlist, b IN SYS.odcinumberlist, c IN OUT SYS.odcinumberlist) IS BEGIN IF (a (16) = 0) THEN c (16) := 0; c (17) := 0; c (18) := 0; END IF; c (15) := a (14) + a (15) + a (16); c (16) := b (16) / b (17); c (17) := 50; c (18) := a (16) * 2; END prc_test; END pkg_dist; / DECLARE x SYS.odcinumberlist; y SYS.odcinumberlist; z SYS.odcinumberlist; BEGIN x := sys.odcinumberlist (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); y := sys.odcinumberlist (0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500); z := sys.odcinumberlist (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); pkg_dist.prc_test (x, y, z); DBMS_OUTPUT.put_line (z (18)); END; /
See you soon,.
Manik. -
How to run a procedure with the object as OUTPUT parameter
Hello
I have a procedure and it composed of 2 parameters, there is an input parameter and it's some ID (NUMBER datatype) and 2nd parameter is an output parameter and it an object type. I want to run this procedure, but not able to do the same thing. Can someone please suggest me how to run a procedure that got the object as output parameter.
Thank you very much in advance for your support.Example:
SQL> create or replace type t_obj as object (ename varchar2(10), deptno number); 2 / Type created. SQL> ed Wrote file afiedt.buf 1 create or replace procedure myproc (p_empno in number, obj out t_obj) is 2 begin 3 select t_obj(ename, deptno) 4 into obj 5 from emp 6 where empno = p_empno; 7* end; SQL> / Procedure created. SQL> set serverout on SQL> declare 2 v_obj t_obj; 3 begin 4 myproc(7788, v_obj); 5 dbms_output.put_line(v_obj.ename||','||v_obj.deptno); 6 end; 7 / SCOTT,20 PL/SQL procedure successfully completed.
-
How to run four procedures, in order, by using anonymous block
Hello
I am trying to run four procedures, in order, by using anonymous block. If one of the procedure fails remaining should get executed. How can I achieve this?
For example:
BEGIN
PROC1;
Proc2; -Suppose that Proc2 will fail, it should not affect the execution of Proc3 and proc 4
Proc3;
Proc 4;
END;Thank you!
Hello
Maybe this can help you:
BEGIN begin Proc1; exception when others then dbms_output.put_line('proc1 ' || sqlcode || ' ' || sqlerrm); end; begin Proc2; exception when others then dbms_output.put_line('proc2 ' || sqlcode || ' ' || sqlerrm); end; begin Proc3; exception when others then dbms_output.put_line('proc3 ' || sqlcode || ' ' || sqlerrm); end; begin Proc4; exception when others then dbms_output.put_line('proc4 ' || sqlcode || ' ' || sqlerrm); end; END;
In your case, it may be useful if your procedures have their own exception handlers, so they never fail. But then you need a sort of exception information that is displayed.
concerning
Kay -
How to run a procedure created dynamically with out parameter
Hi guys,.
a friend I need to run a procedure whose name will change dynamically and this procedure is with 2 out parameter. I need to capture the value of these 2 output settings, here I m giving my code too...
declare
int v_emp_id: = 100013;
p_reg_off varchar (5): = "R";
int p_user_id: = 6;
v_status varchar (200);
v_message varchar (200);
v_Formula varchar (100);
int v_number: = 1;
Start
v_Formula: = 'call testsp_ | v_number | ' ('| v_emp_id |', "'| p_reg_off |") «, » || p_user_id | v_status, v_message)';
DBMS_OUTPUT. Put_line (v_Formula);
immediately run v_Formula;
end;
and my procedure structure is like this
CREATE OR REPLACE PROCEDURE testsp_1
(
p_emp_id INT,
p_reg_off TANK,
p_user_id INT,
p_status OUT NOCOPY INT,
p_message OUT NOCOPY VARCHAR2
)
AS
Start
end;
Please help me...Hello
You must use the "USING" clause to execute dynamic sql with parameter out.
Example: http://download-west.oracle.com/docs/cd/B28359_01/appdev.111/b28370/dynamic.htm
Arun-
-
How to run a procedure ODI of a shell command?
Hello
Is it possible to perform the procedure ODI of a shell command? How?
I would like to invoke the execution of the second another batch processing procedure, we have tips.
Thank you.You can create the scenario of the ODI procedure and call this scenario using the startscen at the command prompt,
before that make sure that you odiparams file is updated. -
Hello:
I am trying to execute this procedure with HR:
CREATE or REPLACE PROCEDURE proc_depto_1 (new_dept_name IN VARCHAR2, dept_id in NUMBER)
AS
BEGIN
UPDATE services
SET department_name = new_dept_name
WHERE department_id = dept_id;
END;
The procedure has been created successfully = 'created Procedure '.
I tried proc_depto_1 EXECUTE ('wow', 90) and it does not work with the page interface web oracle 10g express edition but it works perfectly with the sql command line.
Could someone tell me the statement for execution of the procedure in the web page tool or how to configure it to work?
Thank you very much
Published by: user12229399 on 18-ene-2010 04:42To try:
BEGIN
proc_depto_1 ('wow', 90);
END; -
How to run a procedure of SQL commands
I tried in many ways, for example:
RUN POPULATE_HIERARCHY (121121);
but I get the error: ORA-00900: invalid SQL statement.BEGIN POPULATE_HIERARCHY(121121); END;
-
How to run the procedure which parameter is in a single query
Hi all
Here's sinario
create or repalce procedure proc1 (number, number xyz, sys_refcursor Prefcur abc)
as
Start
...
......
... do something...
end;
front end, all paramertes came as string...
'proc1 (1,5,Prefcursor).
now what I do is that I created an another procedure that accept this string as parameter.
create or replace procedure proc2 (Vpstring varchar2, Prefcursor to sys_refcursor)
as
Start
execute Vpstring;
end;
but it gives me error
Please help me solve this problem.
any help appriciatedIt looks like a very strange requirement for me.
Try like this.
SQL> create or replace procedure p1(a1 number, a2 number, a3 out sys_refcursor) 2 as 3 begin 4 open a3 for select * from dual where a1 = a2; 5 end; 6 / Procedure created. SQL> create or replace procedure p2(str varchar2, rc out sys_refcursor) 2 as 3 lstr varchar2(100); 4 begin 5 lstr := 'BEGIN ' || substr(str,1,instr(str,',',1,2))||':1);' ||' END;'; 6 7 execute immediate lstr using rc; 8 end; 9 / Procedure created. SQL> var rc refcursor SQL> exec p2('p1(1,1,rc)',:rc) PL/SQL procedure successfully completed. SQL> print rc D - X SQL> exec p2('p1(1,2,rc)',:rc) PL/SQL procedure successfully completed. SQL> print rc no rows selected SQL>
Thank you
Knani. -
Try to run a procedure that takes as parameter VARRAY
Hi gurus,
I am trying to run a procedure having a table entry.
However, I get an error during execution.
Can you please help me on how to run a procedure having a table input?
create or replace type type_a in the table to the number (10,0);
Script:
declare
txn_id type_a
Start
txn_id type_a()
txn_id (1): = 516963065;
procedure_1 (emp_id = > 1001, txn_id)
end;Besides above solutions, you must confirm that all variables have a corresponding input parameter, including the case even in the name of the variable, if your Oracle database is case-sensitive.
Can you check and let us know your findings?
Kind regards
Ashutosh -
How to run a stored procedure in TOAD 9.0
Dear friends,
I use TOAD 9.0.
Running a procedure, but the error...
create or replace PROCEDURE UPD_TBL (parameter i_nom_table IN VARCHAR2) IS
CURSOR c_columns is select column_name from ALL_TAB_COLUMNS where
Table_name = i_nom_table parameter;
BEGIN
FOR rec in c_columns
LOOP
IF (CRE. COLUMN_NAME = "X_NNM_TYPE_CD") THEN
UPDATE parameter i_nom_table value X_NNM_TYPE_CD = REPLACE (X_NNM_TYPE_CD, '-', '_')
WHERE INSTR (X_NNM_TYPE_CD, '-') > 0;
ELSIF (CRE. COLUMN_NAME = "X_REVENUE_TYPE_CD") THEN
UPDATE parameter i_nom_table value X_REVENUE_TYPE_CD = REPLACE (X_REVENUE_TYPE_CD, '-', '_')
WHERE INSTR (X_REVENUE_TYPE_CD, '-') > 0;
END IF;
END LOOP;
EXCEPTION
While OTHERS then
NULL;
END UPD_TBL;
ERROR: TABLE OR VIEW DOES NOT EXIST.
Please let me know how to perform the procedure in Toad.
Thank you/kumarkumar73 wrote:
I use kaw_owner schema for the tables.I'm not sure I understand what you're saying here. Do you mean that the tables are the property of KAW_OWNER? That the procedure is owned by KAW_OWNER? You added an OWNER = predicate "KAW_OWNER" to the query? Or something else?
I'm passing valid table name but always the for loop is not an iteration.
I had the habit now of user_tab_columns but no record recovery.
There are still two possibilities. The table name is incorrect or the owner of the procedure has sufficient privileges. I don't know which account is the owner of the procedure or how you gave that account access to the tables, so it is difficult to be more specific that declare that the owner of the procedure needs direct access to the tables so that the query return lines.
As the owner of the procedure, connect to SQL * Plus, type
SET ROLE OFF;
Run the query with the name of the hard-coded array and display the results
Justin
-
How to write a procedure to call and run the custom package backend
Hi all
Oracle 10g
Oracle Apps R12
I work with here oracle order management, we have a package called (Pick Release) to customize. Due to a problem, we have this concurrent program execution manually giving Route_id as parameter. The route_id comes from the road to the Table. By using this query
Select distinct route@DB_LINK_APPS_TO_ROADSHOW route_id
When trunc (route_date) = trunc (sysdate + 2).
on a daily basis, we have almost 42 routes and we run this simultaneous program manually close times.
so now how to write a procedure for this
Step 1 make the route to the routing table. (By cursor we can get the route_id accordingly)
Step 2 How to trigger custom backend package and run accordingly to this output of the cursor (route_id)
If 40 routes of cursor get is - that the simultaneous program runs 40 times according to this route_id.
can some could provide the steps to do this
Thanks and greetings
Srikkanth.MTo submit a competing request from the back - end:
FND_REQUEST. SUBMIT_REQUEST (Client or server)
Summary
function FND_REQUEST. SUBMIT_REQUEST
(application IN varchar2 default NULL,
program IN varchar2 NULL by default,
Description IN varchar2 default NULL,
start_time IN varchar2 default NULL,
sub_request IN default boolean FALSE
Argument1,
argument2,..., argument99.
Return to argument100 number);
Description
Submits a competing treatment by a simultaneous Manager. If the query is successful, this function returns the ID of the concurrent request; Otherwise, it returns 0.
ATTENTION: FND_REQUEST needs to know information about the user and accountability whose application is submitted. Therefore, this feature works of concurrent programs or forms within the Oracle Applications.
The FND_REQUEST. SUBMIT_REQUEST function returns the ID of the concurrent application after successfully. It is up to the caller to issue a commit to complete the application.
Your code should retrieve and handle the error message generated if there is a problem of presentation (the ID of the concurrent request returned is 0). Use FND_MESSAGE. RETRIEVE and FND_MESSAGE. ERROR to retrieve and display the error (if the application is made on the client side).
Related essays: overview of the Message dictionary (see page)
You must call FND_REQUEST. SET_MODE before calling FND_REQUEST. SUBMIT_REQUEST of a database trigger.
If FND_REQUEST. SUBMIT_REQUEST fails to go anywhere but a database trigger, database changes are cancelled until the time of the function call.
After a call to the FND_REQUEST. SUBMIT_REQUEST function, installation of all parameters are reset to their default values.
Arguments (input)
short name of the application associated with the concurrent request for enforcement.
short simultaneous program (not the executable) name of the program for which the application must be made.
Description Description of the application that appears in the form of concurrent requests (optional).
start_time time during which demand is expected to start running in the (optional) HH24 or HH24:MI:SS format.
sub_request set to TRUE if the request is made by another application and should be treated as a subquery.
From version 11, this parameter can be used if you submit requests for in a concurrent program of PL/SQL stored procedure.
argument1... 100 arguments for the concurrent request; up to 100 arguments are allowed. If the Oracle Forms submitted, you must specify all arguments of 100. -
How to run the packaged procedure with Ref Cursor
Hello.
The question may be very simple for you... but I was confused how to run
I have the following package
But I want to test (run) this procedure...CREATE OR REPLACE PACKAGE CURSPKG AS TYPE T_CURSOR IS REF CURSOR; PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER, IO_CURSOR IN OUT T_CURSOR); END CURSPKG; / CREATE OR REPLACE PACKAGE BODY CURSPKG AS PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER, IO_CURSOR IN OUT T_CURSOR) IS V_CURSOR T_CURSOR; BEGIN IF N_EMPNO <> 0 THEN OPEN V_CURSOR FOR SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME FROM EMP, DEPT WHERE EMP.DEPTNO = DEPT.DEPTNO AND EMP.EMPNO = N_EMPNO; ELSE OPEN V_CURSOR FOR SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME FROM EMP, DEPT WHERE EMP.DEPTNO = DEPT.DEPTNO; END IF; IO_CURSOR := V_CURSOR; END OPEN_ONE_CURSOR; END CURSPKG; /
But confused how to have Ref Cursor
Could you help me in this...
Thank youYou must declare a variable of type T_CURSOR and pass it to the procedure like this.
declare lOutCursor CURSPKG.T_CURSOR; begin CURSPKG.OPEN_ONE_CURSOR(
, lOutCursor); end; -
How to run a stored procedure by using the steps in database?
Hello
I'm trying to run some procedures of the store and it will not work.
See the file attached is seq.
I have a varchar parameter (50), which must also be provided to the stored procedure and it returns an int.
To do this I had to only use data in an open statement
Maybe you are looking for
-
Why is the Google Talk Plugin blocked on my computer at times?
The Plugin has been blocked once or twice in the past. I didn't know this until I made an update of Firefox. It is now unlocked. This is the case, I guess that when I'm doing or received phone calls in Google (G-mail & Hangouts). My questions are the
-
Monitor flicker - on certain colors.
CAN SOMEONE PLEASE HELP FIX MY MONITOR. DARK COLOURS ARE OK BUT ALL THE OTHER COLORS FUZZY AND FLICKERING IN PINK DON'T KNOW WHAT SE PAST ALREADY HAPPENED LOOKING AT THIS SCREEN NOW BLACK, GREEN SETTOP BOX, JOIN CONVERSATION IS OK BUT THE BOX, I TAPE
-
How to connect a Nexus tablet to my wireless system?
I'm trying to connect my Tablet Nexus to our wireless network... Please help! Thank you!
-
HP Photosmart C4780: error
Salvo, he modello della mia stampante e C4780 ed ho no problema: error in file C:\Program Files (x 86) \HP\Digital Imaging\bin\hpqscloc\1033.xml of analysis. He mio e 8.1 Windows operating system e non più utilizzare potendo it cd Bolivia All della s
-
problems of version 1.5 package
This is the message that I FINALLY received my printer after having repeatedly tried to solve the problem.I wanted to just send and print the photo of my new grandson. In addition, he won't let me attach my photos to my Yahoo E mail. Help! Message a