Skip to ContentSkip to Footer
Start of content
- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- procedure in unix
General
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-11-2006 12:21 AM
08-11-2006 12:21 AM
procedure in unix
Hi all,
I have a table which has two columns
Criterian no CRT1
UPD_STATEMENT
update table_case set title=:' || CRITERIA_NUMBER || ', support_msg=:' || FILE_NAME || ' where objid=268435458;
update table_case set title=:' || CRITERIA_NUMBER || ', support_msg=:' || FILE_NAME || ' where objid=268435459;
For this CRT1 ther are two update statement so i want the procedure to execute two update stmnts
create or replace procedure proc2(CRITERIA_NUMBER varchar2,FILE_NAME varchar2 ) is
str varchar2(2000);
NOC number(7,2);
pos Number(7,2);
counter Number(7,2);
tempstr varchar2(1000);
cutchar varchar2(1000);
Begin
SELECT upd_statement INTO str FROM cfg_batchimporttool WHERE criteriano=CRITERIA_NUMBER;
tempstr:=str;
IF(LENGTH(str)>0)
THEN
dbms_output.put_line('Total Length ' ||LENGTH(str));
NOC:=LENGTH(str);
counter:=1;
WHILE(counter<=NOC)
LOOP
pos:=INSTR(tempstr,';');
if(pos=0)
THEN
EXIT;
END IF;
cutchar:=SUBSTR(tempstr,1,pos-1);
IF(LENGTH(tempstr)!=0)
THEN
BEGIN
dbms_output.put_line('ORIGINAL ::::'||cutchar);
EXECUTE IMMEDIATE cutchar using CRITERIA_NUMBER,FILE_NAME;
tempstr:=SUBSTR(tempstr,(pos+1),NOC);
END ;
ELSE
EXIT;
END IF;
counter:=(pos+1);
END LOOP;
END IF;
END proc2;
This procedure works fine when i hard code the values for ilename and criteriano directly in update stmnt.But when use variable and try to assign procedure param to these variables using execute immediate it shows an error
EXECUTE IMMEDIATE cutchar using CRITERIA_NUMBER,FILE_NAME in this line
A host/bind variable invalid
Wat change i need to make either in procedure r tin the update stmnt int the table
But this procedure is not executed i need to call procedure in unix
I have a table which has two columns
Criterian no CRT1
UPD_STATEMENT
update table_case set title=:' || CRITERIA_NUMBER || ', support_msg=:' || FILE_NAME || ' where objid=268435458;
update table_case set title=:' || CRITERIA_NUMBER || ', support_msg=:' || FILE_NAME || ' where objid=268435459;
For this CRT1 ther are two update statement so i want the procedure to execute two update stmnts
create or replace procedure proc2(CRITERIA_NUMBER varchar2,FILE_NAME varchar2 ) is
str varchar2(2000);
NOC number(7,2);
pos Number(7,2);
counter Number(7,2);
tempstr varchar2(1000);
cutchar varchar2(1000);
Begin
SELECT upd_statement INTO str FROM cfg_batchimporttool WHERE criteriano=CRITERIA_NUMBER;
tempstr:=str;
IF(LENGTH(str)>0)
THEN
dbms_output.put_line('Total Length ' ||LENGTH(str));
NOC:=LENGTH(str);
counter:=1;
WHILE(counter<=NOC)
LOOP
pos:=INSTR(tempstr,';');
if(pos=0)
THEN
EXIT;
END IF;
cutchar:=SUBSTR(tempstr,1,pos-1);
IF(LENGTH(tempstr)!=0)
THEN
BEGIN
dbms_output.put_line('ORIGINAL ::::'||cutchar);
EXECUTE IMMEDIATE cutchar using CRITERIA_NUMBER,FILE_NAME;
tempstr:=SUBSTR(tempstr,(pos+1),NOC);
END ;
ELSE
EXIT;
END IF;
counter:=(pos+1);
END LOOP;
END IF;
END proc2;
This procedure works fine when i hard code the values for ilename and criteriano directly in update stmnt.But when use variable and try to assign procedure param to these variables using execute immediate it shows an error
EXECUTE IMMEDIATE cutchar using CRITERIA_NUMBER,FILE_NAME in this line
A host/bind variable invalid
Wat change i need to make either in procedure r tin the update stmnt int the table
But this procedure is not executed i need to call procedure in unix
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-12-2006 03:20 PM
08-12-2006 03:20 PM
Re: procedure in unix
What SQL server are you using here? I can't tell.
One long-haired git at your service...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
End of content
United States
Hewlett Packard Enterprise International
Communities
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP