convert the function package...
can someone convert this package to work in such a way that we can use it in the sql command...{color: #993300} create or replace package metaphone
is
function to generate (s varchar2) return varchar2;
Metaphone end;
/
display errors; {color}
{color: #993300} create or replace package body metaphone
is
type rule_rec is record
(
whole f_off
f_match varchar2 (10),
f_result varchar2 (10)
);
type rule_tab is table of the directory index rule_rec;
g_rules rule_tab;
g_vowels constant varchar2 (5): = 'AEIOU ';
--
function cmp_rule
(
p_rule rule_rec,
p_off pls_integer,
P_STR varchar2
) return a Boolean value;
--
function to generate the varchar2 (s varchar2) return
is
L_S varchar2 (32767).
l_r varchar2 (32767).
Start
-get rid of the non-alphanumeric characters
I'm looping 1.length (s)
If (substr (s, i, 1)) upper between 'A' and 'Z' then
L_S: l_s = | Upper (substr (s, i, 1));
end if;
end loop;
If l_s is null then
Returns a null value.
end if;
-clean the word a little
If l_s as 'AE %' or l_s as 'GN %' or like «% KN» l_s
l_s like '% FN' or like «% WR» l_s
then
L_S: = substr(l_s,2); -first letter drop
elsif l_s as 'X %' then
L_S: = the of ' | substr(L_S,2); -Replace with S
elsif l_s as 'WH %' then
L_S : = « W » || substr(L_S,2); -change W
end if;
I'm looping 1.length (l_s)
If I & gt; 1 and substr (l_s, i - 1, 1) = substr (l_s, i, 1)
and substr (l_s, i, 1). = « C »
then
-drop the second letter doubled except C
null;
elsif instr (g_vowels, substr(l_s,i,1)) & gt; 0 then
-ignore all but the initial vowels
If I = 1 then
l_r: = l_r | substr (L_S, i, 1);
end if;
elsif substr (l_s, i, 2) = "GH."
and I & lt; length (l_s) - 2
and instr (g_vowels, substr(l_s,i+1,1)) = 0
then
-a hard rule:
-If silent "GH" and not at the end or before a vowel
null;
on the other
-analysis of the structure of words
for r loop 1.g_rules.count
If cmp_rule (g_rules (r), i, l_s) then
l_r: = l_r | g_rules (r) .f_result;
"exit";
end if;
end loop;
end if;
end loop;
l_r return;
end generate;
--
procedure add_rule (whole p_off, p_match varchar2, varchar2 p_result)
is
l_rule_rec rule_rec;
Start
l_rule_rec.f_off: = p_off;
l_rule_rec.f_match: = p_match;
l_rule_rec.f_result: = p_result;
g_rules (g_rules. (Count + 1): = l_rule_rec;
end add_rule;
--
function cmp_rule
(
p_rule rule_rec,
p_off pls_integer,
P_STR varchar2
) return Boolean
is
CH1 tank;
Char CH2;
Start
If p_rule.f_match like '%c %' or p_rule.f_match like '% %' then
I'm looping 1.length (p_rule.f_match)
CH1: = substr (p_rule.f_match, i, 1);
CH2: is substr (p_str, p_off + p_rule.f_off + i, 1);.
If ch2 is null then
Returns false;
end if;
If ch1 = 'v' then
If instr (g_vowels, ch2) = 0 then
Returns false;
end if;
elsif ch1 = 'c' then
If instr (g_vowels, ch2)! = 0 then
Returns false;
end if;
elsif ch1! = ch2 then
Returns false;
end if;
end loop;
Returns true;
end if;
If p_off & lt; = - p_rule.f_off then
Returns false;
end if;
return p_rule.f_match
= substr (p_str, p_off + p_rule.f_off, length (p_rule.f_match));
end cmp_rule;
Start
-to initialize the rule table
-order is important
add_rule (-1, 'MB', null);
add_rule(0,'B','B');
add_rule(0,'CIA','X');
add_rule(0,'CH','X');
add_rule(0,'CI','S');
add_rule(0,'CE','S');
add_rule(0,'CY','S');
add_rule(0,'C','K');
add_rule(0,'DGE','J');
add_rule(0,'DGY','J');
add_rule(0,'DGI','J');
add_rule(0,'D','T');
add_rule(0,'F','F');
add_rule(0,'GN',null);
add_rule(0,'GNED',null);
add_rule(0,'GI','J');
add_rule(0,'GE','J');
add_rule(0,'GY','J');
add_rule(0,'G','K');
add_rule(-1,'vHc',null);
add_rule (-1, 'CH', null);
add_rule (-1, 'PH', null);
add_rule (-1, 'SH', null);
add_rule (-1, 'TH', null);
add_rule(0,'H','H');
add_rule(0,'J','J');
add_rule (-1, 'CK', null);
add_rule(0,'K','K');
add_rule(0,'L','L');
add_rule(0,'M','M');
add_rule(0,'N','N');
add_rule(0,'PH','F');
add_rule(0,'P','P');
add_rule(0,'Q','K');
add_rule(0,'R','R');
add_rule(0,'SH','X');
add_rule(0,'SIO','X');
add_rule(0,'SIA','X');
add_rule(0,'S','S');
add_rule(0,'TIA','X');
add_rule(0,'TIO','X');
add_rule(0,'TH','0');
add_rule(0,'TCH',null);
add_rule(0,'T','T');
add_rule(0,'V','F');
add_rule(0,'Wv','W');
add_rule(0,'W',null);
add_rule(0,'X','KS');
add_rule(0,'Yv','Y');
add_rule(0,'Y',null);
add_rule(0,'Z','S');
Metaphone end;
/
display errors; {color}
{color: #993300} source
http://www.zdnetasia.com/Builder/Architect/DB/0, 39044553,39200579,00.htm
Concerning
Vincent...
{color}
Its already a function. Only, it's that its interior of a package. Then you can simply use it in SQL like that.
SELECT package_name.function_name FROM dual;
See below...
SQL> create or replace package metaphone
2 is
3 function generate(s varchar2) return varchar2;
4 end metaphone;
5 /
Package created.
SQL> show errors;
No errors.
SQL>
SQL> create or replace package body metaphone
2 is
3 type rule_rec is record
4 (
5 f_off integer,
6 f_match varchar2(10),
7 f_result varchar2(10)
8 );
9 type rule_tab is table of rule_rec index by binary_integer;
10 g_rules rule_tab;
11 g_vowels constant varchar2(5) := 'AEIOU';
12 --
13 function cmp_rule
14 (
15 p_rule rule_rec,
16 p_off pls_integer,
17 p_str varchar2
18 ) return boolean;
19 --
20 function generate(s varchar2) return varchar2
21 is
22 l_s varchar2(32767);
23 l_r varchar2(32767);
24 begin
25 -- get rid of non-alpha characters
26 for i in 1..length(s) loop
27 if upper(substr(s,i,1)) between 'A' and 'Z' then
28 l_s := l_s || upper(substr(s,i,1));
29 end if;
30 end loop;
31 if l_s is null then
32 return null;
33 end if;
34 -- clean up the word a bit
35 if l_s like 'AE%' or l_s like 'GN%' or l_s like 'KN%'
36 or l_s like 'PN%' or l_s like 'WR%'
37 then
38 l_s := substr(l_s,2); -- drop first letter
39 elsif l_s like 'X%' then
40 l_s := 'S' || substr(l_s,2); -- change to S
41 elsif l_s like 'WH%' then
42 l_s := 'W' || substr(l_s,2); -- change to W
43 end if;
44 for i in 1..length(l_s) loop
45 if i > 1 and substr(l_s,i-1,1) = substr(l_s,i,1)
46 and substr(l_s,i,1) != 'C'
47 then
48 -- drop the second of doubled letter except C
49 null;
50 elsif instr(g_vowels,substr(l_s,i,1)) > 0 then
51 -- ignore all except initial vowels
52 if i = 1 then
53 l_r := l_r || substr(l_s,i,1);
54 end if;
55 elsif substr(l_s,i,2) = 'GH'
56 and i < length(l_s)-2
57 and instr(g_vowels,substr(l_s,i+1,1)) = 0
58 then
59 -- a difficult rule:
60 -- silent if in "gh" and not at end or before a vowel
61 null;
62 else
63 -- scan for word patterns
64 for r in 1..g_rules.count loop
65 if cmp_rule(g_rules(r),i,l_s) then
66 l_r := l_r || g_rules(r).f_result;
67 exit;
68 end if;
69 end loop;
70 end if;
71 end loop;
72 return l_r;
73 end generate;
74 --
75 procedure add_rule(p_off integer,p_match varchar2,p_result varchar2)
76 is
77 l_rule_rec rule_rec;
78 begin
79 l_rule_rec.f_off := p_off;
80 l_rule_rec.f_match := p_match;
81 l_rule_rec.f_result := p_result;
82 g_rules(g_rules.count+1) := l_rule_rec;
83 end add_rule;
84 --
85 function cmp_rule
86 (
87 p_rule rule_rec,
88 p_off pls_integer,
89 p_str varchar2
90 ) return Boolean
91 is
92 ch1 char;
93 ch2 char;
94 begin
95 if p_rule.f_match like '%c%' or p_rule.f_match like '%v%' then
96 for i in 1..length(p_rule.f_match) loop
97 ch1 := substr(p_rule.f_match,i,1);
98 ch2 := substr(p_str,p_off+p_rule.f_off+i,1);
99 if ch2 is null then
100 return false;
101 end if;
102 if ch1 = 'v' then
103 if instr(g_vowels,ch2) = 0 then
104 return false;
105 end if;
106 elsif ch1 = 'c' then
107 if instr(g_vowels,ch2) != 0 then
108 return false;
109 end if;
110 elsif ch1 != ch2 then
111 return false;
112 end if;
113 end loop;
114 return true;
115 end if;
116 if p_off <= -p_rule.f_off then
117 return false;
118 end if;
119 return p_rule.f_match
120 = substr(p_str,p_off+p_rule.f_off,length(p_rule.f_match));
121 end cmp_rule;
122 begin
123 -- initialize the rules table
124 -- order is important
125 add_rule(-1,'MB',null);
126 add_rule(0,'B','B');
127 add_rule(0,'CIA','X');
128 add_rule(0,'CH','X');
129 add_rule(0,'CI','S');
130 add_rule(0,'CE','S');
131 add_rule(0,'CY','S');
132 add_rule(0,'C','K');
133 add_rule(0,'DGE','J');
134 add_rule(0,'DGY','J');
135 add_rule(0,'DGI','J');
136 add_rule(0,'D','T');
137 add_rule(0,'F','F');
138 add_rule(0,'GN',null);
139 add_rule(0,'GNED',null);
140 add_rule(0,'GI','J');
141 add_rule(0,'GE','J');
142 add_rule(0,'GY','J');
143 add_rule(0,'G','K');
144 add_rule(-1,'vHc',null);
145 add_rule(-1,'CH',null);
146 add_rule(-1,'PH',null);
147 add_rule(-1,'SH',null);
148 add_rule(-1,'TH',null);
149 add_rule(0,'H','H');
150 add_rule(0,'J','J');
151 add_rule(-1,'CK',null);
152 add_rule(0,'K','K');
153 add_rule(0,'L','L');
154 add_rule(0,'M','M');
155 add_rule(0,'N','N');
156 add_rule(0,'PH','F');
157 add_rule(0,'P','P');
158 add_rule(0,'Q','K');
159 add_rule(0,'R','R');
160 add_rule(0,'SH','X');
161 add_rule(0,'SIO','X');
162 add_rule(0,'SIA','X');
163 add_rule(0,'S','S');
164 add_rule(0,'TIA','X');
165 add_rule(0,'TIO','X');
166 add_rule(0,'TH','0');
167 add_rule(0,'TCH',null);
168 add_rule(0,'T','T');
169 add_rule(0,'V','F');
170 add_rule(0,'Wv','W');
171 add_rule(0,'W',null);
172 add_rule(0,'X','KS');
173 add_rule(0,'Yv','Y');
174 add_rule(0,'Y',null);
175 add_rule(0,'Z','S');
176 end metaphone;
177 /
Package body created.
SQL> select metaphone.generate('stephens') from dual
2 /
METAPHONE.GENERATE('STEPHENS')
--------------------------------------------------------------------------------
STFNS
Published by: Karthick_Arp on January 14, 2009 23:29
Tags: Database
Similar Questions
-
Convert the function of transfer system model
It is a practice "IF convert to transfer function of CDT.vi" in the system identification toolkit, but is a VI to go the other way? I used the id of system tools to estimate the TF from my system, but I want to compare it to the base of the first order response of the system to my real stimulus data.
I can build a first TF command using the 'create order 1 model.vi CD' but I don't know how do to then turn this into a model of continuous system in which I can plug my real data.
I am able to build a model system using 'IF create system model.vi' but it is a polynomial model, if there is a way to cajole this in the form of an order of 1st exponential base, it would be a great solution as well.
(I'm experienced with LV, but my theory of control is rusty and I am totally new to CD modules and IF - then I apologize if this is a silly question)
Hello
You can use IF partially known continuous transfer (1st order) .vi model function and IF partially assess continuous known model transfer function (1st order SISO) .vi to estimate a 1st order TF, in which the parameters are defined as in CD create 1st order Model.vi
-
is there a way to collect images used similar to the function "package for output?
I would like to collect only the images/assets I use per page in Dreamweaver. Is there a function that automates that?
There are browser add-ons that can help you with it like this for FF.
DownThemAll! : Modules for Firefox
Nancy O.
-
CS6: why package still show stains when I converted the process?
Hi, I wonder why the 'Package' of CS6 function lists both the color and tones, even after I converted the tasks to deal with using the ink Manager? (This means my print job will appear on the printer as needing more that the normal 4 plates CMYK?) (Separations preview displays correctly only to the four-color).
Gary Niemeier says:
Using the package is part of my Quality Assurance process when I prepare general ledger for the PDF export projects. I didn't send a package. I use it to find and eliminate the unwanted colors. Can you think of any other way to quickly assess the presence of spot unwanted in a book containing chapters 20 or 30? I am happy to learn from him.
You can use the preflight Panel to do this. Create a new profile and check the Spot color box, and then set the maximum number of plates of spot colors allowed to 0. That DOES not answer what the ink Manager is doing because it's looking at the generated plates, not the definitions of swatch.
-
Converts the ref cursor effect of function table
I have a function named fn_get_emp(), whose return type is sys_refcursor. When I select fn_get_emp of double; I get the output to the format of the cursor. I want to convert to the table like format so that I can use in my insert statements insert into foo select * from fn_get_emp();
Please note that the columns in the output of the fn_get_emp() is not fixed.
Published by: user10566312 on January 30, 2012 22:25Here are the steps in the package DBMS_SQL, you need to turn your Ref Cursor a cursor DBMS_SQL.
http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25788/d_sql.htm#CHDJDGDG
and then the rest of the documentation of the DBMS_SQL package gives many examples of how to treat this a cursor dbms_sql.
Here is an example to use the package dbms_sql to process a request and produce some projection of sql and the database is in the query to CSV file...
As user sys:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles' / GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser /
As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2 ,p_dir IN VARCHAR2 ,p_header_file IN VARCHAR2 ,p_data_file IN VARCHAR2 := NULL) IS v_finaltxt VARCHAR2(4000); v_v_val VARCHAR2(4000); v_n_val NUMBER; v_d_val DATE; v_ret NUMBER; c NUMBER; d NUMBER; col_cnt INTEGER; f BOOLEAN; rec_tab DBMS_SQL.DESC_TAB; col_num NUMBER; v_fh UTL_FILE.FILE_TYPE; v_samefile BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file); BEGIN c := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE); d := DBMS_SQL.EXECUTE(c); DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab); FOR j in 1..col_cnt LOOP CASE rec_tab(j).col_type WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000); WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val); WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val); ELSE DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000); END CASE; END LOOP; -- This part outputs the HEADER v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767); FOR j in 1..col_cnt LOOP v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),','); END LOOP; -- DBMS_OUTPUT.PUT_LINE(v_finaltxt); UTL_FILE.PUT_LINE(v_fh, v_finaltxt); IF NOT v_samefile THEN UTL_FILE.FCLOSE(v_fh); END IF; -- -- This part outputs the DATA IF NOT v_samefile THEN v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767); END IF; LOOP v_ret := DBMS_SQL.FETCH_ROWS(c); EXIT WHEN v_ret = 0; v_finaltxt := NULL; FOR j in 1..col_cnt LOOP CASE rec_tab(j).col_type WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val); v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',','); WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val); v_finaltxt := ltrim(v_finaltxt||','||v_n_val,','); WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val); v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),','); ELSE v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',','); END CASE; END LOOP; -- DBMS_OUTPUT.PUT_LINE(v_finaltxt); UTL_FILE.PUT_LINE(v_fh, v_finaltxt); END LOOP; UTL_FILE.FCLOSE(v_fh); DBMS_SQL.CLOSE_CURSOR(c); END;
This allows the header line and the data to write into files separate if necessary.
for example
SQL> exec run_query('select * from emp','TEST_DIR','output.txt'); PL/SQL procedure successfully completed.
Output.txt file contains:
empno,ename,job,mgr,hiredate,sal,comm,deptno 7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20 7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30 7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30 7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20 7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30 7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30 7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10 7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20 7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10 7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30 7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20 7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30 7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20 7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10
The procedure allows for the header and the data to separate files if necessary. Just by specifying the file name "header" will put the header and the data in a single file.
Adapt to the exit of styles and different types of data are needed.
-
Hello
SQLDeveloper 4.1.1.19.59
They are a lot of documentation to add the new tab in TableNode.
for example:
elements <>
< item = "Editor" node vertical = "TableNode" type = "true" >
< title > <! [CDATA [SYNONYMS]] > < / title >
< query >
< sql > <! [CDATA[ ..................... ]] > < / sql >
< / query >
< / point >
< / object >
Now, I want to add tabs to other objects as the packages/procedures/functions.
I tried with node = node = 'procedure' or 'procedureNode' or objectType = "OPERATING MODE", but does not work
Sum, we know the 'node name' of these objects.
Thanks in advance
Best regards.
TableNode TABLE
ViewNode REVIEWS
MViewNode MATERIALIZED_VIEW
PlSqlBaseNode BODY OF FUNCTION, PACKAGE, PACKAGE BODY TYPE TYPE
LINK to DATABASE DatabaseLinkNode
MViewLogNode MATERIALIZED VIEW LOG
TriggerNode RELAXATION
IndexNode INDEX
RecycledObjectNode RECYCLEBIN
DirectoryNode DIRECTORY
QueueNode QUEUE
QUEUE QueueTableNode TABLE
JavaNode JAVA
XmlSchemaNode XML SCHEMA
Here is a fool, I did as an example
AND the owner =: proprietaire_objet
AND name =: OBJECT_NAME
]]>
-
Should I compile the whole package in order to compile in a function, or a procedure inside?
Thank you
Yes.
-
How to move the functions and procedures of packages in a schema?
Hello
I have less than the needs for a work at home and my question is if anyone can point me in the right direction to find documentation that can help me solve below. Any information will be appreciated. Thank you.
Write procedures and functions (included or not in packets) as .txt or .sql scripts. Once they have been launched in Developer SQL they should, in addition, the functions and procedures of packages in the current schema. If the current schema contains only 2 packages, pac1 (p11, p12 procedures and functions f11, f12, f13) and pac2 (contains the p21 following procedures, p22, p23 and f21 and functions f21 (case of overload), running the scripts produce the following effects:)
- Procedures p11, p12, p21, p22, p23, and f11, f12 and f13 functions will be created in the current schema.
- PAC2 will contain 2 instances of the function of overload-f21; they will be kept in the package, without be created in the current schema. If all overloaded procedures/functions will be kept in their original packaging
- If pac1 contains variables, cursors, and public types, keep us only the details of the package (and remove the body); usually if the packages contain no overloaded functions or procedures the body will be removed and if no variable, cursors, types of public then we will remove the header.
- If in the triggers, procedures and functions we will call procedures/functions packages (procedures and functions moved into the current schema) they reference will need to be updated (via editing the body or recompilation) for example if pa1.p12 will be replaced with p12.
- Scripts must have numbers in the next series (01... n) and the characters that explain the content.
My only advice would be to remember that these are public forums and if YOU can find them, therefore cannot your instructors.
In addition, those are horrible procedure names and function
This mission seems to be around to overload the pl/sql objects and... prioritize a research on Oracle documentation around overhead and legacy
http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28371/adobjplsql.htm#i21148 -
Hi all! I'm new in this forum, as well as in the use of Muse. I ask if there is a sequence of steps o specific function to convert the Fund size tablet and phone Web site.
Y does it can someone help me? Thank you in advance to all
Good bye
Hello
I would say to start from this article
How to create a mobile website with Adobe Muse | Adobe Muse CC tutorials
Let me know if you have any question.
-
Why am I not given the option to create a pdf file when I want to convert pdf into word document? My plan is the PDF package should do
Hello
I checked your account, you have an active PDF pack.
You must click on export to PDF to convert PDFS into word document.
Kind regards
Florence
-
I already bought Adobe Pro XI, unable to find the function to convert pdf to word?
I already bought Adobe Pro XI, unable to find the function to convert pdf to word?
File--> save as--> Microsoft Word
Mylenium
-
How to convert the request function
Please help convert the below given query to a function:
YogeshSELECT ITEM_CODE, ITEM_NAME, ROUND(OPSTK/CNV/ML,2) OPSTK, ROUND(OPVAL,3)OPVAL, ROUND(INQTY/CNV/ML,2) INQTY, ROUND(INVAL,3) INVAL, ROUND(OUTQTY/CNV/ML,2) OUTQTY,ROUND(OUTVAL,3)OUTVAL, ROUND((NVL(OPSTK,0)+NVL(INQTY,0)-NVL(OUTQTY,0))/CNV/ML,2) CLSTK, ROUND((NVL(OPVAL,0)+NVL(INVAL,0)-NVL(OUTVAL,0)),3) CL_VAL FROM ( SELECT ITEM_CODE, ITEM_NAME, IU_CONV_FACTOR CNV, IU_MAX_LOOSE_1 ML FROM ITEM,ITEM_UOM WHERE ITEM_CODE = IU_ITEM_CODE AND IU_UOM_CODE = ITEM_UOM_CODE ), ( SELECT SL_ITEM_CODE OP_ICODE, SUM(DECODE(RCVD_ISSD,'R',1,'I',-1)*QTY_BU) OPSTK, ROUND(SUM(DECODE(RCVD_ISSD,'R',1,'I',-1)*VAL_1),2) OPVAL FROM STK WHERE DT < TO_DATE(:P249_DATE1,'DD-MM-YYYY') GROUP BY SL_ITEM_CODE ), ( SELECT SL_ITEM_CODE TX_ICODE, SUM(DECODE(RCVD_ISSD,'R',1)*QTY_BU)INQTY, SUM(DECODE(RCVD_ISSD,'R',1)*VAL_1) INVAL, SUM(DECODE(RCVD_ISSD,'I',1)*QTY_BU)OUTQTY, SUM(DECODE(RCVD_ISSD,'I',1)*VAL_1) OUTVAL FROM STK WHERE DT BETWEEN TO_DATE(:P_DATE1,'DD-MM-YYYY') AND TO_DATE(:P249_DATE2,'DD-MM-YYYY') GROUP BY SL_ITEM_CODE ) WHERE ITEM_CODE = OP_ICODE(+) AND ITEM_CODE = TX_ICODE(+) --AND ITEM_CODE LIKE :P_ITEMCODE ORDER BY ITEM_CODE
A function in what version of Oracle that renders what?
Your query selects 7 different values... functions return 1. (do the math).
What you try to do is highly suspicious, given that the functions are generally not used for these purposes. You push away from the keyboard for a
a few minutes and then tell us why a function, how it will be used, and when, in the past, you saw a 7 function return values. -
Convert the equivalent function stragg columns in oracle sql
Hello
Sorry I forgot my version of Oracle:
I searched on google but I have not found the solution.SQL> select * from v$version; BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi PL/SQL Release 10.2.0.3.0 - Production CORE 10.2.0.3.0 Production TNS for 64-bit Windows: Version 10.2.0.3.0 - Production NLSRTL Version 10.2.0.3.0 - Production
I'm looking for a function equivalent to the SQL stragg discoverer.
Note: stragg function convert columns in lines.
Thank you
Published by: Salim champion 2010-01-29 08:32SELECT deptno, stragg ('-' || ename) FROM emp_test GROUP BY deptno; DEPTNO STRAGG_STR ---------- ------------------------------------------------------------ 10 -CLARK-KING-MILLER 20 -SMITH-FORD-ADAMS-SCOTT-JONES 30 -ALLEN-BLAKE-MARTIN-TURNER-JAMES-WARD 3 rows selected.
Hello Salim
This feature does not exist inside the discoverer.My suggestion would be to create a SQL function, then import it in Finder using the System Administration tool. Now, you will be able to pass the deptno to the function and the function returns a single string containing the concatenated names.
This isn't a function difficult to write and if you would like some help please let us know.
Best wishes
Michael -
What is the difference between the function declared in the package and the CIP
What is the difference between the definition of a function in the package and package body?
Published by: user10641405 on November 19, 2009 13:29If you describe a package, you will see only the functions declared in the spec.
If you declare only in the body but are not available to other packages (they are private to the package, non-public) -
Function to convert the Date?
Hai Experts,
I need to write a function,
Input to the function will be a date format.
If I give the date in DD/MM/RR format the return value must be DD/MM/RR HH24
If I give the date format as MM/DD/RR the return value shall be MM/DD/RR HH24
The function may return multiple lines.
Kind regards
Millar
No need for a function. This will do:
Select decode (
, ' DD/MM/RR", to_char (sysdate, ' HH24 JJ/MM/RR ')," DD/MM/RR", to_char (sysdate," DD/MM/RR ' "),"invalid format") of ;
Maybe you are looking for
-
Satellite M50D-A-10W - display driver has stopped working while gaming
Hey guys I just bought a toshiba Satellite M50D-A-10W and I have a very annoying problem...When I play in dota 2 sometimes I get a massage like: "display driver has stopped working" or answer I remember exactly, and the freezing of the game and then
-
HP Pavilion dv6-7136nr: HP Pavilion dv6-7136nr sm bus controller
Loaded Windows 7 Ultimate and now have the following items that are not enabled in the Device Manager USB SM controller Controller USB (two) Not able to use the USB ports
-
HP Envy 13: Temperature CPU HP ENvy 13
Hi all I bought a HP Envy 13 d020 3 days. Today, I launch Kaspersky AV to scan my computer. The CPU usage is 90% and I use HWMonitor to know the temperature of the CPU. The base temperature 0, core 1 and package are always 75-80 ° C. And it's the sam
-
horizontal scrolling in a spreadsheet
When scrolling horizontally in a spreadsheet (e.g. google docs) I want the scroll bar to move left and right, as it is with scrolling vertical, rather than scroll through individual cells. Is this possible in windows 7? This seems the same in chrome
-
Partially completed sync and now I can't find a list of what has not been synchronized
I spent literally two hours selecting songs from my Windows Media Player to sync with my phone. I had just started the synchronization when my phone rang and disconnnected from the computer. The sync pane is now empty and there is no list unsynchroni