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

[code]...

View 18 Replies


ADVERTISEMENT

Send CLOB Data Automatically Using CDC?

Jan 5, 2012

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.

View 1 Replies View Related

SQL & PL/SQL :: Passing CLOB Data As Input Parameter?

May 24, 2010

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?

View 9 Replies View Related

SQL & PL/SQL :: Sending Mail Through UTL_SMTP / Unable To Send CLOB In It

Sep 14, 2010

I am sending mail thru UTL_SMTP. But i am unable to send the CLOB in it.If i break the CLOB into varchar2 then also it doesn't work.

Variables:-
vBuffer VARCHAR2 (4000);
l_amount BINARY_INTEGER := 4000;
l_pos PLS_INTEGER := 1;
l_clob_len PLS_INTEGER;
[code].....

While using the write_data procedure it is giving error as "Invalid OPeration"...how we can send the mail with CLOB.

View 1 Replies View Related

SQL & PL/SQL :: Send Again Function Of Equivalent Of DATEADD

Apr 19, 2011

Is it possible to send again the function of equivalent of DATEADD in sql for plsql??

View 3 Replies View Related

SQL & PL/SQL :: Passing Hierarchy As Input To Function That Returns XML?

Aug 3, 2012

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.

AAAA
----AAA
----BBB
----CCC
-------CC1
-------CC2
-------CC3

[code]....

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

View 12 Replies View Related

PL/SQL :: Send Regexp Back Reference To A Function?

Jul 23, 2013

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

[code]...

View 3 Replies View Related

PL/SQL :: Best Way To Send A Procedure / Function Output To The Application

Sep 8, 2013

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. 

View 49 Replies View Related

SQL & PL/SQL :: Pass Multiple Values As Single Input Parameter Into Pipeline Function

Dec 23, 2012

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)

View 2 Replies View Related

SQL & PL/SQL :: Function Returning CLOB - Invalid Format

Jan 22, 2011

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.

View 2 Replies View Related

PL/SQL :: Return Past Timestamp Values On Base Of Input Hour To User Function

Nov 22, 2012

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.

*Action: 

View 6 Replies View Related

Reports & Discoverer :: Clob In 6i - Error Function Return Must Char

Jun 23, 2011

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]........

View 3 Replies View Related

PL/SQL :: To Create Function Based Index For Group Function Columns

Jun 15, 2012

Is anyway to create function based index for group function columns.

For example

select max(timestamp),min(age),averge(sal).... ... .. from tab;

View 5 Replies View Related

PL/SQL :: Calling External C Function / ORA-06521 Error Mapping Function

Feb 4, 2013

I have the following C code:

class Factorial {
  public:
  int getVal (int a);
};
[code]....

/When I am trying to execute this function always get the ORA-06521. I changed the data types - but nothing changed.

Just in case, listener.ora
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = db)(PORT = 1521))
                   (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
[code]....

View 6 Replies View Related

SQL & PL/SQL :: Difference Between Stand Alone Function And Function Declared In A Package?

Mar 11, 2010

What is the Difference between a Stand Alone Function/Procedure & a Function/Procedure declared in a Package.

View 2 Replies View Related

Y Or N Input From User

Nov 4, 2010

I have a script that I want to add some sort of code that will allow for a Y or N input from the user.

Example: ** This script is going to drop your database, Do you want to continue? **

If the user puts Y, the database will begin to drop. If the user puts N, the script will exit.

Would Accept work for this or is their something better?

View 3 Replies View Related

SQL & PL/SQL :: Get Input From User?

Jan 27, 2011

I want to get input of employee name from user, then select salary of that user & display. I have written following code but system shows error.

****************************************
create or replace procedure test is

number1 NUMBER(10);
number2 NUMBER(2) := 17;
text1 VARCHAR(12) := 'HELO WORLD';
text2 DATE := SYSDATE;
text3 VARCHAR(5);

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

View 3 Replies View Related

Send Mail Using SQL

Feb 23, 2009

I want to send mail using plsql.I know that this can be possible by UTL_SMTP package.So I went thro some doc's & I tried this code :

PROCEDURE send_test_message
IS
mailhost VARCHAR2(64) := 'mailhost.fictional-domain.com'; /*(my computer name)*/
sender VARCHAR2(64) := 'prasadsug@yahoo.com';
recipient VARCHAR2(64) := 'prasadsug@rediffmail.com';
mail_conn utl_smtp.connection;
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25);
utl_smtp.helo(mail_conn, mailhost);
[code]....

I got 'ora-00900:INVALID SQL STATEMENT'. which line i've done the mistake .how to rectify that?.

View 5 Replies View Related

Send SMS Through Oracle DB?

Jul 7, 2012

We can send E-mail through Oracle DB, can we send SMS through Oracle DB to any Mobile No.

View 1 Replies View Related

SQL & PL/SQL :: Send SMS Via Oracle 10g?

Mar 5, 2012

i am sending { Daily Status } via E-Mail by Oracle 10g,,,,

now My client want to Receive By sms to his mobile ,,,

Is there any possibilities to sent sms by oracle 10g ,,if exists pls sent the Code,,,or any procedure to sent sms via Oracle 10g

View 11 Replies View Related

PL/SQL :: Possible To Send Sms Through Database

Aug 13, 2013

 I would like to know about the implementation of sending an SMS through pl/Sql.

View 8 Replies View Related

PL/SQL :: How To Send A Mail

Aug 6, 2013

I have a requirement how to send a mail from pl/sql procedure and that mail content will be in HTML format and the data i have to fetch from one table

View 2 Replies View Related

SQL & PL/SQL :: What Is Advantage Of Deterministic Function Over Normal Function

Jun 10, 2010

What is advantage of Deterministic function over normal function?

What is the diff B/W Deterministic function and normal function and also give me a example in which scenario we use Deterministic function?

View 4 Replies View Related

SQLPlus Input Arguments?

Sep 30, 2003

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.

View 2 Replies View Related

Read From Input File

Mar 5, 2011

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�;

View 4 Replies View Related

SQL & PL/SQL :: Validating Input Parameter

Aug 11, 2010

I'm using Oracle 9i. How can i check for a string if it contains only numbers or letters? Otherwise i should return false.

View 6 Replies View Related

SQL & PL/SQL :: Can Have Input Parameter In Procedure

Oct 11, 2010

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?

View 6 Replies View Related

SQL & PL/SQL :: SP2-0027 - Input Is Too Long

May 3, 2013

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.

View 3 Replies View Related

Forms :: Numeric Input In 6i

Jul 25, 2005

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.

View 4 Replies View Related

SQL & PL/SQL :: How To Use Date As Input Parameter

May 13, 2013

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

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved