Passing Sh Variable Value To Input Of PL/SQL Procedure

Aug 30, 2012

how can I pass the sh variable (.i.e file name stored in sh variable called($F)) as a input of below mention procedure (YODEL_XL_ INS_SDG_ COMMER_ PROD)

for F in *.dat; do
#
echo $F
#
#sqlldr apps/apps control=$CONTROL data=$F
# Below Part is used for Add the file name into table
[code]...

View 8 Replies


ADVERTISEMENT

SQL & PL/SQL :: Passing Input Parameter To Like Variable In Procedure

Dec 27, 2012

I have a procedure named 'GetShipperinfo' which takes i_name as input and needs to build a cursor taking i_name as input

i.e.

The following sql when executed at sqlplus prompt gives correct results.

select dept, supplier, shipper_id
from shippers
where upper(shipper_name) like upper('Frank Robert%');

How can I transform this inside a cursor within a procedure passing 'Frak Robert' value as i_name input.

i.e I should be able to call the procedure as follows

sql> variable v1 varchar2;
sql> exec pkg_shipment.GetShipperinfo('Frank Robert',:v1);
sql> print :v1;

Should the cursor inside the procedure be built as follows

cursor c1 is
select dept, supplier, shipper_id
from shippers
where shipper_name like ''||upper(i_name'%''||)'';

Iam unable to build the sql for the cursor.

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

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

Passing Variable To Exp In UNIX?

Sep 20, 2013

I want to pass a variable in unix to oracle exp command

I have a file with owner and password

I did

export user=$(head -$riga $file | tail -1)
echo $user
let riga+=1
export psw=$(head -$riga $file | tail -1)
echo $psw
exp $user/$psw file=exp_$current.dmp

but this doesn't work.

View 4 Replies View Related

PL/SQL :: How To Write Procedure To Load Data Into Table Using XML File As Input To Procedure

Sep 20, 2013

how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me. 

xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>.

View 3 Replies View Related

SQL & PL/SQL :: Passing The Char Variable In Cursor

Apr 9, 2013

i trying to pass the char varible to the cursor but it is not taking ,,, if i hardcode the values to the cursor it is taking

here is the detailed program ... why this is not taking and tell me how to pass the values through it..

declare
v_name char(6) ;
cursor c1(c_name char) is
select name, parent,child,status from relation
start with name='%'
connect by prior parent=child
union

[Code]...

View 9 Replies View Related

SQL & PL/SQL :: Passing Variable Into TO_DATE Function

Apr 14, 2011

select to_date('13:14:00', 'HH24:MI:SS') FROM DUAL;

what is output of this?

and why this result is coming?

View 32 Replies View Related

SQL & PL/SQL :: Passing Variable Into TO_DATE Function?

Aug 10, 2010

I am trying convert number value in date. I know somewhere I doing mistake. But I cant get it.

Here is my Partial Code

create or replace
PROCEDURE "REPORT_ARTICLEMOSTVIEWED2"
(

[Code]....

Error starting at line 5 in command:
EXEC REPORT_ARTICLEMOSTVIEWED2(null,null,null,null,:RC)
Error report:
ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at "IIS_ORACLE_11GR2_LIVE.REPORT_ARTICLEMOSTVIEWED2", line 22
ORA-06512: at line 1
01858. 00000 - "a non-numeric character was found where a numeric was expected"
*Cause: The input data to be converted using a date format model was
incorrect. The input data did not contain a number where a number was
required by the format model.
*Action: Fix the input data or the date format model to make sure the
elements match in number and type. Then retry the operation.
RC

How do I put condition for Null value in this procedure And set dateTo = sysdate if v_day,v_month,v_year are null.

View 9 Replies View Related

SQL & PL/SQL :: Print Message Just Before Asking For Input To Bind Variable?

Apr 17, 2013

i want to print a message just before asking for input to a bind variable

SQL> SET serveroutput on;
SQL> DECLARE
2 pname varchar2(20);

[Code].....

but i want to print 'hello world' before asking value for bind variable like:

hello world
Enter value for num: 1
old 9: WHERE ID = #
new 9: WHERE ID = 1;

then how to achive it?

View 4 Replies View Related

PL/SQL :: Passing Json String Into Varchar2 Variable

Jan 11, 2013

I'm trying to pass a JSON string into a stored procedure that has a single VARCHAR2 variable.

begin
SAVE_JSON('{"app_id":"800414","merch_id":"84657156","user_id":"6985","P25_DBA_NAME":"TEST"}');
end;
/

I'm getting the ORA-20001: ORA-06502: PL/SQL: numeric or value error

View 3 Replies View Related

Application Express :: Passing Variable To Javascript

Aug 28, 2013

4.1.2theme 24

I have a .js process in the before header of a page which has this pl/sql process using htp script javascript function {code} 

function check(flag_val){ if(flag_val=="N") 
document.getElementById("btn").disabled = true;
else 
document.getElementById("btn").disabled = false;  } 
{code} 

and then there is the actual pl/sql process which  has a cursor 

{code} 
declareflg varchar2(1);
..begin selectflag into v_flagfrom table where rownum = 1;
-- actual conditions are different but this returns one value.

 Then below using htp package I had html table with something like 

<td align="right">
<button class="btn btn-success" type="button" id="btn"  onclick="check(flg);"
title="Accept Lead" style=" width:50px;">Flag value</button> </td>  
 {code}

For some reason the script function is not called if I use onload. If I change the onload to onclick it works. Also, if I pass check(flg) it does not work. If I use check(''N'') then is works fine. question is how do I pass a pl/sql variable flg in this case to a javascript function as a parameter? I basically, want the value of flg checked on page load and then if it is N then disable the button. Or else keep it enabled.

View 0 Replies View Related

PL/SQL :: Passing Char Variable In Cursors - Not Taking?

Apr 9, 2013

i trying to pass the char varible to the cursor but it is not taking ,,, if i hardcode the values to the cursor it is takinghere is the detailed program ... any body can tell why this is not taking and tell me how to pass the values through it..

declare
v_name char(6) ;
cursor c1(c_name char) is
select name, parent,child,status from relation
start with name='%'

[code]....

View 4 Replies View Related

Client Tools :: Passing Variable And Displaying Select Data In TOAD?

Apr 22, 2010

All I want to do is run a procedure (DO_H_RUN) that returns a number into "v1" and then use that variable to return the result sets in three selects. This is all in TOAD. If I do not have a where clause, the code executes fine (allowing me to see the data in multiple Grid tabs)! But, I want to filter the rows.

I've tried doing a number of different things (finding all sorts of stuff on the Web) like declaring cursor variables and the like but after spinning on this for a couple of hours, I'm stuck.

Here's my attempt (the names have been changed to protect the innocent!):

declare
v1 Numeric;
BEGIN
DO_H_RUN('Me', v1);
--DBMS_OUTPUT.PUT_LINE(v1); --This line works okay!
select * from h_run where h_run_id=v1; --NO GO

[code]....

View 10 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 :: Passing DATE To Procedure?

Dec 10, 2010

I have a procedure that accepts a date as an input parameter. This parameter is used in a select statement to match on a table column of date type.

1) Should the parameter be declared and passed in as a varchar2 and then converted using to_date() or declared as a date type? If it's declared as a date type what format should it be passed in as, ie. '01-MAY-2010' or '01-MAY-10' or etc.

2) When I run the sql query, knowing data exist, like "WHERE test_date = '22-NOV-10'" I get no results so I know I'm not matching the date correctly but if I use "WHERE test_date LIKE '22-NOV-10%'" I get the correct results. Trying to build a variable to match this, and use in a cursor, consistently gives me the 'non-numeric character was found...' error

3) formatting the test_date input variable to match on the date type column.

View 21 Replies View Related

SQL & PL/SQL :: Passing Parameter In Procedure

Jan 4, 2011

I have got this procedure:

CREATE OR REPLACE PROCEDURE GET_NUM_ROWS(TABLE_NAME VARCHAR2) AS
NUM_ROWS NUMBER;
BEGIN
SELECT COUNT(*) INTO NUM_ROWS FROM TABLE_NAME;
DBMS_OUTPUT.PUT_LINE(NUM_ROWS);
END;

When I try to compile it, the compiler says:

ERROR at line 4: PL/SQL: ORA-00942: table or view does not exist.

View 3 Replies View Related

SQL & PL/SQL :: Run Procedure Without Passing Value For IN Parameter

Mar 10, 2012

I have a pl/sql procedure having IN, OUT and IN-OUT parameters, this procedure in called from front end application. Now I need create a script to run this procedure from back end (sql prompt) and the result must be same as the front end application call to this procedure.

For the procedure I don't want to pass IN parameter instead to pick the value from the package where the derivation is defined. how to run this procedure from sql prompt without passing value for IN parameter.

View 6 Replies View Related

SQL & PL/SQL :: How To Collect Input Parameter In Procedure

Mar 4, 2010

I have a procedure, which is getting called from ado.net with a input parameter named p_inp_oids which is a character string like '(122,323,434,444)',

My procedure body contains a query whose WHERE clause contains

AND OID IN p_inp_oids

I cannot post the whole procedure. Also OID is number.How to collect that input parameter in my procedure?

View 24 Replies View Related

SQL & PL/SQL :: Debugging The Procedure With XML As Input Parameter?

Jun 23, 2011

I have a procedure where it contains an XML as input parameter.And i have to debug this procedure in pl/sql developer to check whether this is the correct XML and inserting the XML data in to my table. But when debugging, I am getting an Error "EXPRESSION IS OF WRONG TYPE". Below is my

declare
px_xml xmltype;
begin
px_xml:='Xml content';
--call the procedure
package_name.procedure_name
(parameter1 => :parameter1,
px_xml => px_xml,
pvo_out_mesg => :parameter3);
end;

Is there any other way to debug XML in plsql developer.

View 3 Replies View Related

Forms :: Passing Data From One Procedure To Another?

Apr 18, 2013

How to pass data of one procedure to another procedure in oracle forms.

View 1 Replies View Related

Update Store Procedure (List Of Input)

Jan 10, 2012

The current update store procedure that I have updates a list of input provided, but it there are fields that are left blank, they are being updated as null in the database.

I'm having a trouble creating a store procedure that will just update the provided fields only.

View 1 Replies View Related

SQL & PL/SQL :: Procedure To Get Or Sum The Closer Numbers To On Input Number?

Aug 14, 2011

in have one input number for example 300 and in database i have 3 number as below :

1 100
2 200
3 50

i need procedure to give the closer number , for this example the output should return 2&1

example 2 :

input number 100
database number
1 50
2 100
3 140

the output should be 2 and so ....

View 2 Replies View Related

PL/SQL :: How To Concatenate Quote To Procedure Parameter Input Value

Dec 6, 2012

create or replace procedure ab(a in varchar2, b in varchar2)
is
test varcha2(8);
begin
if (a is not null) then
for i in(select c
from t
where c between ||'''||a||'''|| and ||'''||b||'''||)
loop
test:=i.c
end loop;
end if;
end;

I want both parameter input values to be enclosed in quotes so that it considers both parameter values as char.Receiving ora 00936 missing expression error.

View 7 Replies View Related

PL/SQL :: Procedure To Search Employee By Passing First / Middle Or Last Name

Jun 5, 2013

sort out the error of this procedure to search an employee by passing employee fname or middle or last to get his name .

CREATE OR REPLACE PROCEDURE "WEB_MASTER"."SEARCH_EMPLOYEE"
(empname IN VARCHAR2) is
cur number;
v_emp_name VARCHAR2 (100);
r number;
begin
[code]....

View 6 Replies View Related

PL/SQL :: Execute Procedure By Passing Number Array

Oct 26, 2012

Oracle 11.2.0.1
Windows

create type np_type is varray(3) of number
/

create type cn_type is varray(3) of number;
/

create type cxn_type is varray(3) of varchar2(2000)
/

I created TEST table by below pl/sql block :

declare
execstr varchar2(2000) :='create table test(';
begin
for i in 1..80 loop

[Code]....

*ERROR at line 5: ORA-06550: line 5, column 8: PLS-00103: Encountered the symbol "MYPROC1" when expecting one of the following: := . ( @ % ;

The symbol ":=" was substituted for "MYPROC1" to continue.

SQL>The above procedure will insert the supplied numbered string into the test table which split the numbered string based upon supplied splitids of sp_table.

View 7 Replies View Related

SQL & PL/SQL :: Usage Of Loop - Creating A Procedure With 4 Input Parameters

Jun 6, 2012

I have a Table with 4 columns and I am creating a procedure with 4 input parameters and inserting into the table as 4 parameters and how to use loop to insert multiple records.The data to be taken from excel.please suggest how to use the loop to insert multiple records.

create or replace procedure PRC_add_data(
P_Emp_No varchar2,
P_Member_Name varchar2,
P_IDvarchar2,
P_UHID varchar2
)
is
BEGIN
INSERT INTO UploadData (Emp_No,Member_Name,ID,UHID) values (P_Emp_No,P_Member_Name,P_ID,P_UHID)
END;
/

View 6 Replies View Related

SQL & PL/SQL :: Removal Of Time In Input Parameter In Stored Procedure?

May 15, 2011

I'm creating a stored procedure wherein I'm the field wherein I will use for date input parameter is having a datetime format.

The format that we need for user's to input is 'DD-MON-YYYY' (without the minutes and seconds.)

how should I proceed with the creation of stored procedure for this?

View 2 Replies View Related

SQL & PL/SQL :: Convert As Procedure Based On Input Date Parameter

Dec 12, 2012

i have the below query

select to_char(report_date, 'YYYY MM Mon'), count(1) no_of_times
from (
select to_date('&&YYYYMMDD', 'YYYYMMDD')+rownum report_date
, mod(rownum,14) mod_result
from all_objects

[code]...

need to convert as procedure based on input date parameter.I will pass the input date from java environment and need to see the sql query output in front end.

View 7 Replies View Related

SQL & PL/SQL :: Stored Procedure That Takes List Of IDs As Input Parameters

Oct 22, 2010

I need a stored proc that takes list of ids as input parameters. For all these Ids. the proc will send out data from another table as out ref cursor. Sounds very simple yet I am stuck with how do I pass the input list of ids.

View 3 Replies View Related







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