CLOB as input Variable to a procedure
Hi allI'm passing an i / p parameter of a procedure. Its data type is Clob. But when I test the procedure there are variables such as NULL.
I wonder why this is happening.
See you soon!
Vikas
I think that you are testing your procedure using a Test window (I rarely use which) then?
Because when you use the Test window I don't also get no matter what exit, even if I get a value for the CLOB parameter.
However, by running this:
begin
test_proc('BLABLABLA');
end;
in a SQL window, I am getting my output as expected.
There are so many a "PL/SQL dev. -ISM '.
Edit
Or, in the Test window: disable the variable checkbox and just use something like:
begin
-- Call the procedure
test_proc(p_scope => 'BLABLABLA');
end;
This will give you also exit...
Published by: hoek on January 28, 2010 17:14
Tags: Database
Similar Questions
-
Hi guys, I'm new to Teststand and I'm learning.
Well, I made a request a step like that fixed.
I'm a little confused on how to set the input variables. I want that taststand ask me to.
Another question is how I can see my test result in the final report? I want to see the result of the sum and the product. Can you help me?
Thank you
Look at the changes I made to your VI and sequence. -What are you trying to achieve?
-
Hello community, I have a problem when creating a function. The purpose of this function is to check the table of weather gave yesterday or not. We must check this on different tables on different sachems. We are creating a function with input variables.
CREATE OR REPLACE FUNCTION IN_SCHEMA.IS_YDAYDATA_TO_TABLE
(
in_schema IN VARCHAR2,
in_tablename IN VARCHAR2,
in_datefield IN VARCHAR2,
)
RETURNS INTEGER
AS
-Declaring variables
v_is_true INTEGER.
BEGIN
SELECT
CASE
WHEN MAX (in_datefield) = TRUNC(SYSDATE-1)
THEN 1
ON THE OTHER
0
END
IN
v_is_true
Of
in_schema.in_tablename
;
RETURN v_is_true;
END;
/
When creating, I got error: [error] ORA-00942 (44:19): PL/SQL: ORA-00942: table or view does not exist
How to use the values of the input variables on the table select statement names?
Hello
Here's a way you can use dynamic SQL statements for this task:
CREATE OR REPLACE FUNCTION IS_YDAYDATA_TO_TABLE
(
in_schema IN VARCHAR2,
in_tablename IN VARCHAR2,
in_datefield IN VARCHAR2,
in_first_date DATE DEFAULT SYSDATE - 1,.
in_last_date DATE by DEFAULT NULL
)
RETURNS INTEGER
AS
-IS_YDAYDATA_TO_TABLE returns 1 if in_schema.in_tablename.in_datefield
-contains all the dates in the in_first_date of the range through included in_last_date
- and it returns 0 if there is no such lines.
-If in_last_date is omitted, the search only the data on in_first_date.
-If in_first_date is omitted, it defaults to yesterday.
-Time parts of the in_first_date and in_last_date are ignored.
-Declaring variables
sql_txt VARCHAR2 (1000);
v_is_true INTEGER.
BEGIN
sql_txt: = 'SELECT COUNT (*).
|| 'FROM ' | in_schema | '.' || in_tablename
|| 'WHERE ' | in_datefield | ' > =: d1'
|| «AND» | in_datefield | '< > >
|| 'AND ROWNUM = 1';
dbms_output.put_line (sql_txt |) '= sql_txt in IS_YDAYDATA_TO_TABLE"); -For debugging
Sql_txt EXECUTE IMMEDIATE
IN v_is_true
With the HELP of TRUNC (in_first_date) - d1
TRUNC (NVL (in_last_date
in_first_date
)
) + 1 -- d2
;
RETURN v_is_true;
END is_ydaydata_to_table;
/
DISPLAY ERRORS
If you must use dynamic SQL statements, put all the SQL statement in a single string variable, such as sql_txt in the example above. In this way, you can easily see exactly what will be executed. Comment out the call to dbms_output under test is completed.
Try to write functions that will address not only the question that you have now, but similar questions that you may have in the future. For example, now that interest you only to the verification of the data of yesterday, but later, you might want to check another day or range of days. The above function combines the convenience of a function simple (looks like yesterday data if you don't tell him otherwise) with the power of a more complex function (you can use the same function to check any day or range of days).
-
How to swap two values without using the third variable using the procedure
How to exchange the two values without using the third variable using the procedure?
In a procedure using two mode we pass two values A = x and B = y, and let us pass parameters to receive the output has A = y and B = x without using the third variable
Published by: Millar on August 19, 2012 11:23Your question doesn't seem wise. As written, there is no reason to a third variable, just
CREATE OR REPLACE PROCEDURE( x IN number, y IN number, a OUT number, b OUT number ) AS BEGIN a := y; b := x; END;
If it's an interview question, I suspect that the intention was that you had two settings IN OUT and you wanted to swap the values without the help of a third variable.
Justin
-
updating of a variable in a procedure
Hello!
I know this thread has already posted several times, but I am doing everything as it is explained and it still does not work.
I created the variable STARTDATE: TEXT, the most recent value and a package with following steps:
(1) declare the Variable STARTDATE
(2) update the Variable STARTDATE
(3) procedure
The procedure uses the variable, but does not recognize it.
Update Table1 set eof_timestamp_2 = eof_timestamp_1 where eof_timestamp_1 > = to_date ('#ODS.) STARTDATE ',' dd.mm.yyyy hh24:mi:ss')
Thanks for help
MarcinIt should work... seems that ODI is not translating the variable.
Let me suggest something to debug this variable...
Creat a step before update like:
Technology: Java BeanShel
Check ignore error checkboxCommand:
throw new Exception ("' \n\n is the value of the variable: #STARTDATE \n\n '")
This command should show if ODI can recognize the variable inside the procedure.
Run and tell me what you have to tab performance (operator)
Cezar Santos
[www.odiexperts.com] -
Call a procedure stored via JDBC with a REF CURSOR * input variable.
Hello
S/n of my client has provided me with a stored procedure that I need to call to get information about products prices. Something along the lines of:
some_package.getPrices (products IN OUT csr_type);
where csr_type represents a REF CURSOR. This cursor has a product ID column and a price column. The plan is to move the cursor with the populated product id column and have the routine decorate the slider with the prices.
The setting in this plan is that it seems that it is not possible to go from JDBC REF CURSOR in . However, I'm not sure, since I can only find throw comments on various forums (e.g. http://www.orafaq.com/forum/t/35088/0/), without any reference. If I go back to the client and tell them that their idea will not work, I prefer to be able to point them to a documentation somewhere
So I guess my questions are:
1. it is indeed impossible to pass a REF CURSOR type as a variable input on JDBC to a stored procedure?
2. is there information I can do about my client?
3. am I on the right track thinking I need to go down the path of an array of objects?
Thank you very much to anyone who can help
Peter Svehla.Hi Peter,.
I see it, missed that you actually want to pass in a list of products. Don't think that you can do this with the current procedure. A slider is just a pointer to a result set.
How the result set is created and what it looks like, is determined when the cursor is opened.What does this procedure with the cursor? -It does not have some OPEN
TO ; inside? Or, perhaps, you are supposed to send in an open cursor (does not much sense to me)?
Concerning
Peter -
Get multiple values in a select statement in a variable to a procedure
Hello
I'm trying to craete a procedure where the entry of the procedure will be a similar string "a, b, c, d" and output the values of a table that matches the value separated by commas of in sting.
For this.
create table test (varchar2 (10)) nm;
Insert test values ('a');
Insert test values ('b');
Insert test values ('c');
Insert test values (');
Select * from test;
NM
------
one
b
c
d
Now I'm doing a procedure where the parameter will be the column values NM of TEST table in a string separated by commas like "a, b, c, d, x, l" there could be false values also.
The procedure will return only the values that are adapted with column NM from the TEST table for this I created this procedure.
create or replace procedure p_test (p_nm IN varchar2 / *, THE sys_refcursor p_out * /)
is
number of l_len;
l_val varchar2 (10);
l_val1 varchar2 (10);
Start
l_len: = length (p_nm);
-dbms_output.put_line (l_len);
Start
because me in 1.l_len
loop
Select REGEXP_SUBSTR (p_nm, ' ([^,] *)(,|$)', 1, I, NULL, 1) in double l_val;
-dbms_output.put_line (l_val);
-Open p_out for
Select * into l_val1 of test where nm = l_val;
dbms_output.put_line (l_val1);
output when l_len is null;
end loop;
exception
When no_data_found then
null;
end;
exception
while others then
dbms_output.put_line (' error reason :'||) SQLERRM |' :'|| error code SQLCODE);
end;
EXECUTE p_test ('a, b, c, d, q, w');
OUTPUT-
one
b
c
d
This procedure gives me out as I need, but I need to get this in a variable which should be OUT the parameter of this procedure will be called by the JAVA for our application.
As I already tried to use the refcursor (see the commented part), but it gives me no output during a call there.
Its a call to this procedure when I use the refcursor (removing comments).
declare
l_out sys_refcursor;
l_val varchar2 (20);
l_str varchar2 (20): = 'a, b, c, d;
Start
p_test (l_str, l_out);
loop
extract the l_out in l_val;
dbms_output.put_line (l_val);
dbms_output.put_line ('a');
When the output l_out % notfound;
end loop;
end;
So here I am stuck with that, how to get the result of multiple or I'm missing something here and if there is a better approach to this requirement as I come with that so I'm sharing it here.
OR if someone can tell me what is the problem with this package-
create or replace package p_test_api
is
type t_rec is rendered (name varchar2 (200));
type t_tab is table of index by pls_integer t_rec;
procedure p_pest_proc (p_nm in varchar2, p_out to t_tab);
end p_test_api;
/
create or replace package body p_test_api
is
procedure p_pest_proc (p_nm in varchar2, p_out to t_tab)
is
number of l_len;
l_val varchar2 (10);
l_val1 varchar2 (10);
Start
l_len: = length (p_nm);
Start
because me in 1.l_len
loop
Select REGEXP_SUBSTR (p_nm, ' ([^,] *)(,|$)', 1, I, NULL, 1) in double l_val;
dbms_output.put_line (l_val);
Select * bulk collect into p_out test where nm = l_val;
output when l_len is null;
end loop;
exception
When no_data_found then
null;
end;
exception
while others then
dbms_output.put_line (' error reason :'||) SQLERRM |' :'|| error code SQLCODE);
end p_pest_proc;
end p_test_api;
CALL THIS PACKAGE-
declare
l_out p_test_api.t_tab;
l_str varchar2 (20): = 'a, b, c, d;
Start
P_TEST_API. P_PEST_PROC (l_str, l_out);
dbms_output.put_line ('b');
because me in 1.l_out.count
loop
dbms_output.put_line ('a');
dbms_output.put_line (l_out (i). (Name)
dbms_output.put_line ('a');
When the output l_out.count = 0;
end loop;
dbms_output.put_line ('a');
end;
It won't loop
I am using-
Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
Thank you
First of all, get rid of it WHEN OTHERS like William already noted. If you do not want to use the collections:
SQL > create or replace
function f_test () 2
3 p_nm varchar2
4 )
5 return varchar2
6 is
v_result 7 varchar2 (4000);
Start 8
9. Select listagg (nm, ',') within the Group (nm control)
10 in v_result
11 test
where the 12 «,» | p_nm | ',' like '%', | NM | ',%';
13 return v_result;
14 end;
15.The function is created.
SQL > start
2 dbms_output.put_line (f_test ('a, b, c, d, x, w'));
3 end;
4.
a, b, c and dPL/SQL procedure successfully completed.
SQL >
SY.
-
Use fault strategies to get the input variable and call a new service.
Hello
I have 2 composites that are the answer to the request. If none of these composite gives an error I want to have policies to correct this fault. Is possible to obtain the input of the first variable composite and call a new service with this variable to handle the error?
Thank you
Daniel
I found the solution here:
With the help of mismanagement in a BPEL process
Using the method getVariableData to get the variable I want.
Kind regards
Daniel
-
Using a dynamically allocated variable in a procedure?
Hello everyone...
I had a little problem in writing a query...
In fact, I needed to create a tablespace by using a procedure
My procedure is:
create or replace procedure datafile_test as
df_location varchar2 (600);
Start
Select distinct substr (file_name, 1, instr(file_name,'/',-1)) in df_location of dba_data_files;
dbms_output.put_line (' location of the data file created is ' | df_location);
end;
/
This procedure works fine but now my requirement is to use the value stored in the variable df_location in
create the my_tbs < df_location > tbs.dbf tablespace size 20 m; I need to write this statement in my Interior... How can I bring df_location value in my query
is it possible to do?
Thanks in advance...
Hello Raymond vinay
OK, your initial statement was not right and I haven't checked
Try this one, it should work:
create or replace procedure datafile_test
as
df_location varchar2 (600);
v_statement VARCHAR2 (4000);
Start
Select distinct substr (file_name, 1, instr(file_name,'/',-1)) in df_location of dba_data_files;
v_statement: = 'CREATE TABLESPACE MY_TBS DATAFILE ' | CHR (39) | df_location | ' / tbs.dbf'. CHR (39) | 'SIZE 20 M'
-This is optional, but I use this:
|| "PERMANENT AUTOEXTEND OFF LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO FLASHBACK 8K BLOCKSIZE AUTOALLOCATE ONLINE ON.
;
V_statement EXECUTE IMMEDIATE ;
dbms_output.put_line ('Tablespace is created: "' |") v_statement | '"'));
end;
/
I hope this helps you!
-
How to give the table name as input for the insertion procedure parameter
Hello
Could a little help in this scenario,
Here is an example of how to insert,
where the 'b' table name will change at each
is there a possible way to keep the name of the table as an input parameter
SQL > CREATE or REPLACE PROCEDURE PROC_INSERT as
BEGIN 2
3 INSERT INTO A
4 (ID, NAME, LOC)
5. SELECT ID, NAME, B LOC;
6 VALIDATION;
7 END;
Kind regards
VikramIf you need to pass the object name to a SQL running, you must use dynamic SQL statements.
A simpler way is the following
create or replace procedure proc_insert ( pTableName varchar2 ) as begin execute immediate 'insert into a (id, name, loc) select id, name, loc from ' || pTableName; commit; end;
-
Cannot get a dynamic year of input variable
Hello
I want to find year dynamically from the datetime variable, I used the below syntax for him but it doesn't work, please someone help me
XP20:Year-from-DateTime(bpws:getVariableData('inputVariable','payload','/client:Process/client:input'))You send the value as a string? Try to move the date time as string to this function.
Try this, should work.
XP20:year - from-DateTime('inputVariable','payload','/client:Process/client:input')Thank you
Vijay -
How to use the Bpel output as input to the stored procedure
I am a beginner SOA. The scenario is to use the output of a BPEL process in a procedure stored as input and validate it against the data in the database. The data received from the BPEL are compared with fields from different tables.
It's basically a business process data validation.
The output of BPEL is an Xml file and how it can b used in the query of a procedure?
Published by: 869091 on June 29, 2011 12:14 AMThe output of the BPEL process is in XML format.
Your requirement is not clear, please state it correctly what you doing.Yatan-
-
How to pass the variable in a procedure as parameter
CREATE OR REPLACE PROCEDURE APPS. "" QFJS_LMO_TIMESLOT_PROC ".
(
a_std IN VARCHAR2,
TYPE str_table IS TABLE OF CLOB directory INDEX;
timeStr OUT str_table;
)
It's in error!
Help, please!That's what you're looking for? (you can also create the type of your database)
CREATE OR REPLACE PACKAGE APPS.MY_PACKAGE AS PRAGMA SERIALLY_REUSABLE; TYPE str_table IS TABLE OF CLOB INDEX BY BINARY_INTEGER; PROCEDURE "QFJS_LMO_TIMESLOT_PROC"(a_std IN VARCHAR2, post_std IN VARCHAR2, a_time IN VARCHAR2, post_hc IN NUMBER, pre_hc IN NUMBER, ods_schedule_date IN DATE, timeStr IN OUT str_table); END MY_PACKAGE; / CREATE OR REPLACE PACKAGE BODY APPS.MY_PACKAGE IS PRAGMA SERIALLY_REUSABLE; PROCEDURE "QFJS_LMO_TIMESLOT_PROC"(a_std IN VARCHAR2, post_std IN VARCHAR2, a_time IN VARCHAR2, post_hc IN NUMBER, pre_hc IN NUMBER, ods_schedule_date IN DATE, timeStr IN OUT str_table) IS v_clob clob; BEGIN FOR i IN 1 .. timeStr.COUNT LOOP v_clob := timeStr(i); -- ... END LOOP; END "QFJS_LMO_TIMESLOT_PROC"; BEGIN NULL; END MY_PACKAGE; / BEGIN APPS.MY_PACKAGE.QFJS_LMO_TIMESLOT_PROC('1','2','3',4,5,sysdate,APPS.MY_PACKAGE.str_table('clob1', 'clob2', 'clob3')); END; / -- Hugs, Philips
-
ODI 11 g | Passing the value of the variable ODI option procedure
Hi Experts,
I need to pass the value of the global variable / project to an option of the procedure and in the application of the procedure to retrieve. Procedure will be implemented in jython.
How can I pass the value of the variable option procedure ODI & then retrieve it in the jython script?
Model data source is the flat file based & I want to retrieve the location of the source directory using jython/java (must implement an on file preprocessing step before calling the interface to load). Is there an ODI API to retrieve the location of the source directory?
Thank you
AshishThe reason OdiGetOption won't work because odigetoption running will search for the name of the variable where like everything using the execution variable will look at the value of the variable.
In order to manage your situation i belive, we can establish by using the combination of getoption and global variable using the if conditionYou can write code something like that
If odigetoption == 'dat ':
ctrlfileExt = #v_CtrlFileExt
If odigetoption == "txt":
ctrlfileExt = #v_CtrlFileExtTxtThis way, when you call the procedure, you can supply the value of the extension and procedure will use the right variable and the value.
I hope this helps.
-
The Null value as the default value for an input to a stored procedure parameter
Hello
How can we set the default values with the NULL value for the parameter in a stored procedure.
As described above if I want to delete only the functioningcreate or replace procedure emp_proc ( p_test_input in varchar2 p_emp_id in number, p_emp_name in varchar2, p_manager_id in number ) as begin if ( upper ( p_test_input ) = 'I' ) then insert into emp values ( p_emp_id ,p_emp_name ,p_Manager_id,sysdate ); elsif ( upper ( p_test_input ) = 'D' ) then delete from emp where emp_id = p_emp_id; else dbms_output.put_line ( 'Please input ''A'' for ADD or ''D'' Delete EMPLOYEE' ); end if; end;
I want to call this procedure without pass additional parameters.
Published by: Rede on May 28, 2010 12:21EXECUTE emp_proc('D',1010);
Published by: Rede on May 28, 2010 12:22create or replace procedure emp_proc ( p_test_input in varchar2, p_emp_id in number, p_emp_name in varchar2 default null, p_manager_id in number default null )
Maybe you are looking for
-
I had my Ipod 5th generation stolen... A week before taking, I have it synced with my computer to put new songs on it... My question is, I had photos on this Ipod I do not download to my perceive computer... There's these photos on my iCloud and how
-
Try to install KB2656378, get error codes: 0 x 643 and 0x8007F070
I tried ALL suggested fixes, including MicrosoftFixIt50123 etc, uninstall and reinstall all versions of .NET Framework, for the following problem that has persisted for six weeks. "The following update has not been installed: a security update for Mi
-
How to move files to the external drive to the right folder
EXTRACTION OF DATA EXTERNAL HARDIVE IN APPROPRIATE ON LAPTOP COMPUTER LIBRARIES My laptop crashed and I had to have my hard drive, removed and downloaded on my external hard drive. I then had the external hard drive, downloaded on my new laptop but i
-
I'm not able to disable the Group Policy Manager (even if my user ID has administrator privileges) In other words, when I click on the box next to the service in MSCONFIG the audit go far - but as soon as I hit the key "Apply", the control is display
-
Performing the migration of the first deployment of Collaboration CUCM and IM + P again
Hello We used the server first deployment of Collaboration to create virtual machines, run the upgrades and migration of 9,02 10.5 CM and IM + P. The migration was properly executed and CM and IM + P came as a cluster. We could save phones and test.