SQL & PL/SQL :: Set / Send / Input CLOB Value To Function?
Jan 19, 2012
Trying to set/send/input CLOB value to function.
I tried:
Clob size is about 4-5KB of data.
DECLARE clobz CLOB:=EMPTY_CLOB();
BEGIN
SELECT '<claim>'+
'<lbo_id>34</lbo_id>'+
'<claim_type_id>11</claim_type_id>'+
'<claim_subtype_id>11</claim_subtype_id>'+
[code]...
Error:
Error report:
ORA-06550: line 2, column 1:
PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
begin function pragma procedure subtype type <an identifier>
<a double-quoted delimited-identifier> current cursor delete
I want to know whether is it possible to send CLOB data automatically using CDC...i usually have to run a procedure manually to send such data to remote locations.
I have a requirement where in I have to store large data in one of the database columns using stored procedure.
I have declared the column as CLOB as it can store upto 4GB and also the input parameter for the procedure as CLOB. But when I am trying to pass large data it is not allowing to store as it is throwing literal string too large error.
Is there any restriction in the data size to be passed to the stored procedure?
I have an requirement to create an function which takes table or hierarchy of tables as input and returns xml output in hierarchy. Below given is the Tables hierarchy.
Requirement: Initially input was table name and using table as the root node output should generate xml of all the records of child tables.But now requirement is to give the flexibility to user to select what hierarchy he needs i.e he may select AAAA, CCC and in the nodes C1,C2,C3 and C4 if he doesn't want C3 then that node should not be shown in output.
I have created Hierarchy table having 3 columns SI.No, ParentNode and ChildNode and entered the above hierarchy relation.
1. What is the best to way (design)to pass input parameter for the function.
2. How to generate hierarchy in xml using DBMS_XMLGEN
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.2.0.3.0 - Production CORE 11.2.0.3.0 Production TNS for HPUX: Version 11.2.0.3.0 - Production NLSRTL Version 11.2.0.3.0 - Production
Can I call a function from a regexp back reference? I would like to call SELECT UTL_ENCODE.TEXT_ENCODE (:mytext, 'WE8ISO8859P1', 1) FROM DUAL; for all text after Password= and before line break WITH t AS (SELECT '[MyDB] Army=@MyDBarmy Navy=@MyDBnavy Airforce=@MyDBairf
What is the best way to send the output of a PL / SQL function / procedure to the application in Oracle 11g. I understand that it could be different for applications built in JAVA , .Net , SAP etc.
My need is to pass multiple values as single input parameter into pipelined function. For example - "2" and "3" are values of input parameter "t":
with data as ( select 1 as t from dual union all select 2 as t from dual union all select 3 as t from dual union all select 4 as t from dual union all select 5 as t from dual ) select * from data where t in (2,3)
I have a problem when trying to create a PLSQL function based on an XML extraction query.
I have three dummy tables:
SQL> get create_address 1 create table ADDRESS 2 ( 3 id NUMBER not null, 4 house_number NUMBER, 5 house_name VARCHAR2(20), 6 street_name VARCHAR2(30),
[code]....
And the following dummy data for these:
1 insert all 2 into ADDRESS (ID, HOUSE_NUMBER, HOUSE_NAME, STREET_NAME, CITY, COUNTY, POSTAREA, POSTSTREET) 3 values (1, 1, '', 'Tube Street', 'Norwich', 'Norfolk', 'NF12', '2DF') 4 into ADDRESS (ID, HOUSE_NUMBER, HOUSE_NAME, STREET_NAME, CITY, COUNTY, POSTAREA, POSTSTREET) 5 values (2, 5, '', 'Dave Street', 'Edlington', 'Kent', 'CT34', '8GH') 6 into ADDRESS (ID, HOUSE_NUMBER, HOUSE_NAME, STREET_NAME, CITY, COUNTY, POSTAREA, POSTSTREET)
[code]....
So far so good then. But, what I want to create is a function where I can pass in an id value and return the corresponding XML CLOB.
So I try, very simply, this:
SQL> get get_xml_data 1 create or replace function get_xml_data(p_id in number) return clob is 2 Result clob; 3 begin 4 select xmlroot(xmlelement("HomeData",
[code]....
And, alas, i'm greeted by this:
SQL> / Warning: Function created with compilation errors. SQL> sho err Errors for FUNCTION GET_XML_DATA: LINE/COL ERROR -------- ----------------------------------------------------------------- 4/5 PL/SQL: SQL Statement ignored 24/63 PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got - SQL>
I've tried to redo the query in several different ways but so far nothing.
resolve issue while modified the user function code for returns the values as timestamps
---function code
create or replace function fun_test_timestamp(P_HOUR varchar2) return varchar2 is sql_stmt varchar2(1000); begin
[Code].....
Input:- select fun_test_timestamp('5') from dual;
Output:-
SELECT CURRENT_TIMESTAMP - INTERVAL '5' HOUR FROM DUAL;
Modified Fun Code:
create or replace function fun_test_timestamp(P_HOUR varchar2) return timestamp is sql_stmt varchar2(1000);
[Code]...
Input:- select fun_test_timestamp('5') from dual;
Output:-
ORA-00911: invalid character ORA-06512: at "NETVERTEXTRUNK.FUN_TEST_TIMESTAMP", line 8 00911. 00000 - "invalid character"
*Cause: identifiers may not start with any ASCII character other than letters and numbers. $#_ are also allowed after the first character. Identifiers enclosed by doublequotes may contain any character other than a doublequote. Alternative quotes (q'#...#') cannot use spaces, tabs, or carriage returns as delimiters. For all other contexts, consult the SQL Language Reference Manual.
I having issue when i try to use CLOB as varchar2 is not enough in my case. I'm developing function column in oracle report. I'm using developer 6i. I get error function return must char?
How I can use CLOB in oracle report?
function CF_RnoFormula return Char is --v_release_num CLOB; v_release_num varchar2(32767); begin FOR rec IN [code]........
BEGIN text3:='&text3'; select sal into number1 from emp where ename=text3; dbms_output.put_line(text1||' today on '||text2||' salary of Mr.'||text3||' is='||number1); end test; **************************************
ERROR at line 1: ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "SCOTT.TEST", line 10 ORA-06512: at line 1
I'm running a C++ program to call sqlplus to execute some sql scirpts. The program will accept arguments from users at the command line, and execute the script which the name will also be passed in as an argument to the program eg:
./MY_PROG.sh ABC.sql 23 (MY_PROG will call ABC.sql script and pass 23 as an argument to ABC.sql)
it works fine when the argument is passed in correctly, and my ABC.sql scirpt is able to execute correctly, however when the argument is not passed in, the program just hangs there, waiting for an input from the users. This is because "&1" in my script is expecting some value from users.
Because this program will be scheduled to run, and no one will be there to monitor the job, if so happens arguments were missing, the program will wait there for the entire night. Is there any way that I could make the program or the script to exit when there is no input to be found? I can't use timeout as I do not know how long does the script take to finish it operations, I could be updating millions of record from a script.
I am often supplied with a list of numbers to query against & normally take the easy option of editing the file & placing the select on each line. Like so. what to do to loop this. The input file would just be the numbers in a flat file.
Select status from thetable where MPN=�01234567890�; Select status from thetable where MPN=�12345678901�; Select status from thetable where MPN=�23456789012�; Select status from thetable where MPN=�34567890123�;
i am trying to create a procedure that will take an input and based on that input it will delete or update a row, if the input is wrong we will dbs_ouput a line telling the user to enter the input again. can i have a input parameter in a procedure and insert multiple rows with a single insert on a procedure?
We are on Oracle 11.2.0.2 on Solaris 10. I have a procedure call that errors out with this error:
SP2-0027: Input is too long (> 2499 characters) - line ignored.
It is one single procedure but it takes too many long inputs in it. This giant procedure call -with some names changed - is as below -
SQL> exec func_j23k_TYPE_ADD( 'coR-EXECUTION-SUCCEEDED-XLS-PDF-HTM-TXT-CSV-XML-FLF','co Reporting','NOT',func_j23k_TYPE_ACTION_ARRAY(func_j23k_TYPE_ACTION_TYPE(LANG_TEXT_ARRAY(LANG_TEXT_TYPE('en_US', 'Find in Report List'),LANG_TEXT_TYPE('en_CA', 'Find in Report List'),LANG_TEXT_TYPE('fr_CA', 'Chercher dans la liste des rapports'),LANG_TEXT_TYPE('es_US', 'Buscar en lista de informes')),'/Reporting/el/',1,func_TYPE_ACTION_STATUS_ARRAY(),func_TYPE_ACTION_SCREEN_ARRAY(),'NWR',NULL, NULL),func_j23k_TYPE_ACTION_TYPE(LANG_TEXT_ARRAY(LANG_TEXT_TYPE('en_US', 'Open using Excel'),LANG_TEXT_TYPE('en_CA', 'Open using Excel'),LANG_TEXT_TYPE('fr_CA', 'Ouvrir au format Excel'),LANG_TEXT_TYPE('es_US', 'Abrir usando [code]....
SP2-0027: Input is too long (> 2499 characters) - line ignored.
I have an issue in oracle form 6i. I want to create an input box that accepts only number. As the user press any key other than allowed for numbers it should not accept.
How to use date as an input parameter,im supposed to use varchar2 as the data type
CREATE OR REPLACE PROCEDURE mail1 ( recievers VARCHAR2 ,p_date in varchar2 ) IS sender VARCHAR2(30) := 'xyz@gmail.com'; mailhost VARCHAR2(100) := 'host address'; TAB VARCHAR(2) := CHR(9); mail_conn utl_smtp.connection;
[code].....
cursor c1 is
--select activity_date,procedure_name,status_message,error_desc from staging_activity_log where rownum between 1 and 10 ; select activity_date,procedure_name,status_message,error_desc from staging_activity_log where error_desc is not null and trunc(activity_date) >= to_date(p_date,'DD-MON-YYYY') ; BEGIN
[code].....
when i execute i get
BEGIN mail1 ('xxx@gmail.com,yyy@gmail.com,'28-jan-2008'); END; Error at line 1 ORA-06502: PL/SQL: numeric or value error ORA-06512: at "MAIL1", line 27 ORA-06512: at line 1