Number of records in cursor select statement
hi all,
with the cursor i am selecting set of select statement and writing into the .txt file.
its working file, but it should not open the file if the cursor returns nothing.
how to check for the number of records return by the select statement in the cursor.
pls help me.
Thanks..
Hi,
You can use a Cursor for loop (you'll not enter in the loop if the SELECT is retrieving no rows):
begin
for recs in(select * from whatever) loop
null; -- Produce your file
end loop;
end;You can also use a bulk collect and check "yourcollection.count" attribute ... (but don't use it if you are processing a lot of records!)
Similar Messages
-
How to find the number of fetched lines from select statement
Hi Experts,
Can you tell me how to find the number of fetched lines from select statements..
and one more thing is can you tell me how to check the written select statement or written statement is correct or not????
Thanks in advance
santoshHi,
Look for the system field SY_TABIX. That will contain the number of records which have been put into an internal table through a select statement.
For ex:
data: itab type mara occurs 0 with header line.
Select * from mara into table itab.
Write: Sy-tabix.
This will give you the number of entries that has been selected.
I am not sure what you mean by the second question. If you can let me know what you need then we might have a solution.
Hope this helps,
Sudhi
Message was edited by:
Sudhindra Chandrashekar -
Restricting records in the select statement
Hi,
I have one requirement where in i need to restrict my select statement to get only 250 records in the output table.
Here are the select statements i am using....
SELECT a~ebeln
a~lifnr
a~ekgrp
b~werks
b~matnr
FROM ekko AS a INNER JOIN ekpo AS b
ON aebeln = bebeln
INTO TABLE i_ekko
WHERE a~ebeln IN r_ebeln AND
a~lifnr IN r_lifnr AND
a~ekgrp IN r_ekgrp AND
b~werks IN r_ewerk AND
b~matnr IN r_matnr AND
a~bstyp = 'F'.
IF NOT i_ekko[] IS INITIAL.
Select Vendor name
SELECT lifnr
name1
FROM lfa1
INTO TABLE i_lfa1
FOR ALL ENTRIES IN i_ekko
WHERE lifnr = i_ekko-lifnr.
Here if i restrict the first select statement to get only 250 records then i am not getting the desired record in the second select statement.
Could anyone let me know how to write the select statement.
Regards,
Rameshrestric the first select using up to 250.
sort the i_ekko by vendor name.
ex: sort i_ekko by lifnr.
use second select statement here. -
How to get the previous record in the select statement
I am trying to update the parent part number as a parent for component part number. I can assign the main part with level 1 as a parent and it looks like this.
PART_NUMBER PART_LEVEL PART_PARENT
1140000000T 3 1140001755L
1140001755D 2 1140001755L
1140001755L 1
A1010000139 5 1140001755L
A1010015001 4 1140001755L
A1010000139I 4 1140001755L
A40210062 2 1140001755L
A1010001579 4 1140001755L
but, I need to assign the previous level part as the parent part instead of level 1. I can add a new column to store this value. I need the structure as
PART_NUMBER PART_LEVEL PART_PARENT
1140001755L 1
1140001755D 2 1140001755L
A40210062 2 1140001755L
1140000000T 3 A40210062
A1010015001 4 1140000000T
A1010000139I 4 1140000000T
A1010001579 4 1140000000T
A1010000139 5 A1010001579
We might have multiple parts at the same level, so I need to make sure that correct parent is assigned to the part. Anybody has any idea?
ThanksspooHi,
How to do that depends on your data.
Post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data (formatted, within \ tags), if it's not the reuslts you already posted. If you can show what your problem is using commonly available tables (like scott.emp), then you don't have to post any sample data; just the results.
Post your existing query, too;. Always say what version of Oracle you're using.
It looks like you're currently doing something like this:SELECT ename
, LEVEL
, CONNECT_BY_ROOT ename AS root_ename
FROM scott.emp
START WITH mgr IS NULL
CONNECT BY mgr = PRIOR empno
which produces this output:ENAME LEVEL ROOT_ENAME
KING 1 KING
JONES 2 KING
SCOTT 3 KING
ADAMS 4 KING
FORD 3 KING
SMITH 4 KING
BLAKE 2 KING
ALLEN 3 KING
WARD 3 KING
MARTIN 3 KING
TURNER 3 KING
JAMES 3 KING
CLARK 2 KING
MILLER 3 KING
where the last column shows the ancestor *farthest* above the current row.
If I understand you, you want to have output that shows the *nearest* anacestor, like this:NAME LEVEL PARENT_ENA
KING 1
JONES 2 KING
SCOTT 3 JONES
ADAMS 4 SCOTT
FORD 3 JONES
SMITH 4 FORD
BLAKE 2 KING
ALLEN 3 BLAKE
WARD 3 BLAKE
MARTIN 3 BLAKE
TURNER 3 BLAKE
JAMES 3 BLAKE
CLARK 2 KING
MILLER 3 CLARK
You can do that by changing a single line:SELECT ename
, LEVEL
, PRIOR ename AS parent_ename -- Changed
FROM scott.emp
START WITH mgr IS NULL
CONNECT BY mgr = PRIOR empno -
Trying to get newest record using a select statement
Hello everyone.. I'm a bit new at this but I've been teaching myself by trial and error so bear with me.
Using a 'DEDUCTION' table for this example, I am trying to get it to resolve the record that is most current. Since each employee record could have changes, the table could have multiple entries/deductions of which only one is the most current.
Ok, so medical deductions are like DEDUCTIONS 700-715 while dental deductions are 730-737. Initially, I was trying to figure out how to pull the deductions based on an employee and have it compare which is newer and report the newest one for each medical and then the dental deduction. If there is not a type of deduction for someone, it should report zero like a NVL I think. See example:
EMP_ID DEDUCTIONS EFF_DATE AMT
1 710 2000/12/01 85.39
1 735 2000/12/01 8.31
9 701 2001/08/29 12
9 707 2000/12/01 12
9 730 2000/12/01 .23
10 700 2001/02/25 .46
10 730 2001/02/25 .23
The record that stands out in this example is employee #9 with two medical deduction, one that supersedes the other - 701 and 707. Because 701 is newer it should ignore the 707 deduction.
Any ideas? Thank you!
kenHere are a couple of methods. The second one should run faster, but requires Oracle 8i.
SQL> SELECT emp_id, deductions, eff_date, amt,
2 'MEDICAL' AS type
3 FROM deduction
4 WHERE (emp_id, eff_date) IN
5 (SELECT emp_id, MAX (eff_date)
6 FROM deduction
7 WHERE deductions BETWEEN 700 AND 715
8 GROUP BY emp_id)
9 AND deductions BETWEEN 700 AND 715
10 UNION
11 SELECT emp_id, deductions, eff_date, amt,
12 'DENTAL' AS type
13 FROM deduction
14 WHERE (emp_id, eff_date) IN
15 (SELECT emp_id, MAX (eff_date)
16 FROM deduction
17 WHERE deductions BETWEEN 730 AND 737
18 GROUP BY emp_id)
19 AND deductions BETWEEN 730 AND 737
20 ORDER BY emp_id, deductions
21 /
EMP_ID DEDUCTIONS EFF_DATE AMT TYPE
1 710 2000/12/01 85.39 MEDICAL
1 735 2000/12/01 8.31 DENTAL
9 701 2001/08/29 12 MEDICAL
9 730 2000/12/01 .23 DENTAL
10 700 2001/02/25 .46 MEDICAL
10 730 2001/02/25 .23 DENTAL
6 rows selected.
SQL> SELECT emp_id, deductions, eff_date, amt,
2 'MEDICAL' AS type
3 FROM (SELECT emp_id, deductions, eff_date, amt,
4 RANK () OVER
5 (PARTITION BY emp_id
6 ORDER BY eff_date DESC) AS rk
7 FROM deduction
8 WHERE deductions BETWEEN 700 AND 715)
9 WHERE rk = 1
10 UNION
11 SELECT emp_id, deductions, eff_date, amt,
12 'DENTAL' AS type
13 FROM (SELECT emp_id, deductions, eff_date, amt,
14 RANK () OVER
15 (PARTITION BY emp_id
16 ORDER BY eff_date DESC) AS rk
17 FROM deduction
18 WHERE deductions BETWEEN 730 AND 737)
19 WHERE rk = 1
20 ORDER BY emp_id, deductions
21 /
EMP_ID DEDUCTIONS EFF_DATE AMT TYPE
1 710 2000/12/01 85.39 MEDICAL
1 735 2000/12/01 8.31 DENTAL
9 701 2001/08/29 12 MEDICAL
9 730 2000/12/01 .23 DENTAL
10 700 2001/02/25 .46 MEDICAL
10 730 2001/02/25 .23 DENTAL
6 rows selected. -
How to Get Top 10 records using SQL select statement.
:-) Hiee E'body,
I want to generate a sql report in which I only want the top 10 records based on the numeric value of a column.
For Example,
To generate a Location Wise, Employee Wise Years of Service Report.
Here I need the Top 10 Employees according to their No. of Years of Service for all the existing locations using a single query.
eg.
Location Emp No. YOS
India - 22 30
212 28
819 24 ...
US 123 40
312 33
90 33
144 30 ...
UK 77 20
79 20
331 18
109 16 ...
Every Location should display their respective Top 10 Employees
regarding their No. of Years of Service.
Please let me the know the solution to this.
Have a nice day.
Thanking You,
Vivek Kapoor.For example if the table contained (India rows only shown) :
India 202 30
India 212 28
India 819 24
India 820 24
India 900 20
India 920 18
India 922 17
India 925 16
India 926 15
India 927 14
India 928 13
India 929 13
India 930 12
do you want to see
India 202 30
India 212 28
India 819 24
India 820 24
India 900 20
India 920 18
India 922 17
India 925 16
India 926 15
India 927 14
or
India 202 30
India 212 28
India 819 24
India 820 24
India 900 20
India 920 18
India 922 17
India 925 16
India 926 15
India 927 14
India 928 13
India 929 13
Also if the India rows were
India 202 30
India 212 30
India 819 30
India 820 30
India 900 30
India 920 30
India 922 30
India 925 30
India 926 30
India 927 30
India 928 30
India 929 30
do you want to see
India 202 30
India 212 30
India 819 30
India 820 30
India 900 30
India 920 30
India 922 30
India 925 30
India 926 30
India 927 30
or
India 202 30
India 212 30
India 819 30
India 820 30
India 900 30
India 920 30
India 922 30
India 925 30
India 926 30
India 927 30
India 928 30
India 929 30
Please clarify.
Thanks,
Partha -
Gettingant to row number in select statement
Hello,
I want to retrieve the row number of a record in the select statement. Can anybody help me in writing a query for this in php.
Thanks
Omkarsoft<a> developerLookup ROWNUM.
Followup questions belong in a SQL forum, not the PHP forum :) -
Order of records in o/p of select statement
Hi all
I have doubt regarding the select statement. I need to execute a select statement (with out any order ie with out "order by") which searchs a table. I want to know whether in any
circumstances the order of the records of the select statement is different.
sample select statement which I need to execute
select emp_no from emplyees where designation = 'programer'
in one word order of records of in the o/p of a select statement will be unique ?
(provided same query same, table,)
can u plz quote the link to get more information
regards
RenjithHi,
YES, you can
Do Order By Without Using Order By Clause
in your select statement.
I assume that you have unique data ( e.g. emp_no in Emp Table ) and you you do not want to use Order by clause.
Solution 1:
Select Emp_no
from Emp
group by Emp_no;
the o/p will be in the sorted in the Ascending order.
Solution 2: ( Only for columns holding Numeric Values )
Select Emp_No
From Emp
Where 99999 - Emp_no in ( Select 99999 - Emp_no from Emp );
Again this will sort the result will be in the Descending Order. you can use any big number instead of 99999 but it should be greater than Emp_no value.
Note: You Should only use this method on not very large tables coz of performance issue.
Hope this will solve your problem.
Any Comment on this, any body.
Thanks and Regards
There is always a solution to the problem, And if there is no solution of a problem then problem is not a problem. -
Hello Colleagues,
Please assist me in optimizing the two SELECT statement which is taking too much time
1. SELECT SINGLE COUNT(*) FROM j_3abdsi
WHERE matnr IN r_matnr
AND j_4krcat EQ im_valcat.
-- I just need to check whether there are entries in the table with this criteria.
2. SELECT e~vbeln FROM ( vbep AS e
INNER JOIN vbap AS p ON pvbeln = evbeln
AND pposnr = eposnr )
INTO lv_vbeln
WHERE p~matnr IN r_matnr
AND e~j_4krcat eq im_valcat.
EXIT.
ENDSELECT.
-- here also the case is same. Just need to check whether any value exist.
Kindly help.
Regards
Sudha
Edited by: Sudha Naik on Oct 8, 2009 7:32 AMHi Sudha,
1) I do not understand why you would say SELECT SINGLE COUNT(). If you know the entire primary key and would like to retrieve a record you will use SELECT SINGLE to retrieve just that single record. SELECT COUNT() returns the number of records meeting your selection criteria in the system field SY-DBCNT. SELECT COUNT(*) is generally used to check for the existance of the record because this construct just check the number of qualifying records and does not retrieve any data fields from the table. You seem to have merged both these statements and have created something I have never seen before. If you are only interested in finding the existance of the record may I suggest that you use the following.
DATA: w_matnr TYPE mara-matnr.
SELECT matnr
UP TO 1 ROWS
FROM j_3abdsi
WHERE matnr IN r_matnr
AND j_4krcat EQ im_valcat.
ENDSELECT.
SELECT COUNT(*) is good if you are using an index. If not you will be trying to count the records without an index. This can be time consuming. If you are not interested in the record count and only want to know if a qualifying record exist the above option will be faster because SAP check for the first instance and then returns SY-SUBRC = 0.
2) Use the following code.
SELECT e~vbeln
UP TO 1 ROWS
FROM vbap AS p
INNER JOIN vbep AS e
ON p~vbeln = e~vbeln
AND p~posnr = e~posnr )
INTO lv_vbeln
WHERE p~matnr IN r_matnr
AND e~j_4krcat EQ im_valcat.
ENDSELECT. -
Maximum number of records for usage of "For all entries"
Hi,
Is there a limit on maximum number of records to be selected from the database using "For all entries" statement ?
Thanks in advanceThere is a UNDOCUMENTED(??) behaviousr
FOR ALL ENTRIES does ahidden SELECT DISTINCT & drops duplicates.
http://web.mit.edu/fss/dev/abap_review_check_list.htm
3 pitfalls
"FOR ALL ENTRIES IN..." (outer join) are very fast but keep in the mind the special features and 3 pitfalls of using it.
(a) Duplicates are removed from the answer set as if you had specified "SELECT DISTINCT"... So unless you intend for duplicates to be deleted include the unique key of the detail line items in your select statement. In the data dictionary (SE11) the fields belonging to the unique key are marked with an "X" in the key column.
^^!!!!
(b) If the "one" table (the table that appears in the clause FOR ALL ENTRIES IN) is empty, all rows in the "many" table (the table that appears in the SELECT INTO clause ) are selected. Therefore make sure you check that the "one" table has rows before issuing a select with the "FOR ALL ENTRIES IN..." clause.
(c) If the 'one' table (the table that appears in the clause FOR ALL ENTRIES IN) is very large there is performance degradation Steven Buttiglieri created sample code to illustrate this. -
DBMS_XMLQuery behavior when using stored function within cursor select
Consider the following SQL Statement
select t1.id
, t1.name
, cursor ( select t2.id
from tab t2
where t2.t1_id
= t1.id
and validate(t2.xyz,:bd1)
= 1
from tab t1
where t1.id = :bd2
DBMS_XMLQuery is used to create a context and to bind the appropriate values. In this case 'validate' is a stored function. I get the following error message upon execution:
ORA-29532: Java call terminated by uncaught Java exception:
java.sql.SQLException: Missing IN or OUT parameter at index:: 1
Issuing a similar statement in SQL*Plus works fine. I was wondering whether this is a known issue when using a stored function in the cursor select statement in the context of DBMS_XMLQuery or whether I'm doing something wrong.Hi Jan,
This problem has been identified and fixed. The fix should be available in the next release. Thank you for bringing this up to our attention.
visar -
Hi everybody,
how can I check the number of records in a Cube to some selection e.g. Fiscal Year 2010.
Regards
ErwinHi
You can also go for the below option..
1. Go to cube -> Display Data
Select the Info Objects on which you want to set filter.
On the next screen you will get an option to pas the filter values for the selcted info objects.
in the below part of the screen, mark the option out put number of hits.
Exeucte it after removing the restrction of 200 hits.
In the output there will be one column which will have 1 value for each row. Sum up it.
You will get the number of records in a cube for a particular selection.
2. One other way is write a small ABAP program.
Read data from the fact table of the cube into an internal table by firing a select query for the particular selction .In your case fiscal year .
describe the internal table to an integer varaible and display that variable.
It will display the total number of records for that selection in the cube.
You can use this program for other cube also by passing the name of the cube as a parameter.
- Jaimin -
Cascading Select Statements - problem with blank drop-downs
Hello,
I have posted a number of questions about Cascading Select Statements in APEX and though I've received some good information, I still get a blank drop-down when I select the first LOV.
I also found "How to test an On-Demand Process used for AJAX" on the web. Here is the link to the web page:
http://www.inside-oracle-apex.com/2006/12/how-to-test-on-demand-process.html
When I try to test the ON-DEMAND Application Process in the Address Bar of my browser by typing the following, I get an error:
http://beta.biztech.net:2020/pls/apex/f?p=4000:0:211233229176642:APPLICATION_PROCESS=CASCADING_SELECT_LIST:::P6_PROJECT_ID:CASCADING_SELECTLIST_ITEM_1
The error I get is:
Unexpected error, unable to find item name at application or page level.
ERR-1002 Unable to find item ID for item "P6_PROJECT_ID" in application "4000".
As perhaps a last ditch effort, I will post all the steps, all the code and a link to my application.
Here is a link you can visit to view my application:
http://beta.biztech.net:2020/pls/apex/f?p=112:1
You can log in with the following ID and Password
ID: tsimkiss
PW: TS92
Here are the steps that I have followed and the code that I have used.
++++++++++++++++++++++++++++++++++++++++++++++++++
1. Create an application process in Shared Components
- On Demand CASCADING_SELECT_LIST - like this:
Process Point: On Demand
Name: CASCADING_SELECT_LIST
TYPE: PL/SQL Anonymous Block
BEGIN
OWA_UTIL.mime_header ('text/xml', FALSE);
HTP.p ('Cache-Control: no-cache');
HTP.p ('Pragma: no-cache');
OWA_UTIL.http_header_close;
HTP.prn ('<select>');
HTP.prn ('<option value="' || 1 || '">' || '- select tasks -' || '</option>');
FOR c IN (SELECT newops.task_name AS task_name,
newops.task_id AS task_id
FROM NEW_OPPORTUNITIES newops
UNION
SELECT DISTINCT pt.task_name AS task_name,
pt.task_id AS task_id
FROM pa_tasks@bizdev pt,
pa.pa_projects_all@bizdev prj
WHERE prj.project_id = pt.project_id
AND prj.project_id =
CASE
WHEN TO_NUMBER(:cascading_selectlist_item_1)=1
THEN prj.project_id
ELSE TO_NUMBER(:cascading_selectlist_item_1)
END)
LOOP
HTP.prn ('<option value="' || c.task_id || '">' || c.task_name || '</option>');
END LOOP;
HTP.prn ('</select>');
END;
2. Create an application item in Shared Components:
Name: CASCADING_SELECTLIST_ITEM_1
3. Create an LOV in Shared Components
- This is the Primary LOV (name it similar to it's select list page item):
List of Values Name: PROJECT_ID
Source: Lists of Values Query
SELECT newops.CLIENT AS project_name, newops.PROJECT_ID AS project_id FROM NEW_OPPORTUNITIES newops
UNION
SELECT ppa.NAME AS project_name, ppa.PROJECT_ID AS project_id FROM pa.pa_projects_all@bizdev ppa
WHERE ppa.project_status_code='APPROVED'
AND (ppa.COMPLETION_DATE IS NULL or ppa.completion_date > sysdate)
AND (ppa.CLOSED_DATE IS NULL or ppa.closed_date > sysdate)
ORDER BY project_name asc
4. Create a javascript and put it in the header of the page where cascading drop-downs are:
<script>
function get_select_list_xml(pThis,pSelect){
var l_Return = null;
var l_Select = html_GetElement(pSelect);
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
'APPLICATION_PROCESS=CASCADING_SELECT_LIST',0);
get.add('CASCADING_SELECTLIST_ITEM_1',pThis.value);
gReturn = get.get('XML');
if(gReturn && l_Select){
var l_Count = gReturn.getElementsByTagName("option").length;
l_Select.length = 0;
for(var i=0;i<l_Count;i++){
var l_Opt_Xml = gReturn.getElementsByTagName("option");
appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
l_Opt_Xml.firstChild.nodeValue)
get = null;
function appendToSelect(pSelect, pValue, pContent) {
var l_Opt = document.createElement("option");
l_Opt.value = pValue;
if(document.all){
pSelect.options.add(l_Opt);
l_Opt.innerText = pContent;
}else{
l_Opt.appendChild(document.createTextNode(pContent));
pSelect.appendChild(l_Opt);
</script>
5. Create two Select List page items:
P6_PROJECT_ID <-- This is the primary drop-down
P6_TASK_ID <-- This is the secondary drop-down
6. In your primary select list, put the following into HTML Form Element Attributes:
HTML Form Element Attributes: onchange="get_select_list_xml(this,'P6_TASK_ID')"
Other settings on the page:
Name: P6_PROJECT_ID
Display As: Select List
Source Used: Always, replacing any existing values in session state
Source Type: Database Column
Source value or expression: PROJECT_ID
Named LOV: PROJECT_ID <--- Choose from drop-down (this is the Application LOV created earlier)
Null display values: - select project -
Display Null: Yes
7. The second select list is based on an LOV and depends on the value of the first select list:
Name: P6_TASK_ID
Display As: Select List
Source Used: Always, replacing any existing values in session state
Source Type: Database Column
Source value or expression: TASK_ID
Null display values: - select project -
Display Null: Yes
List of values definition:
SELECT newops.task_name AS task_name,
newops.task_id AS task_id
FROM NEW_OPPORTUNITIES newops
UNION
SELECT DISTINCT pt.task_name AS task_name,
pt.task_id AS task_id
FROM pa_tasks@bizdev pt,
pa.pa_projects_all@bizdev prj
WHERE prj.project_id=pt.project_id
AND prj.project_id=:P6_PROJECT_ID
ORDER BY task_name asc
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
If you need an actual running copy of my application, I'm not sure I can upload to the Oracle APEX website since uses datalinks to some tables. If necessary, I will give you my login into if you email me directly, however.
If someone could just straighten my code out especially on the ON-DEMAND Application Process, I think that would really help me out.
Hope someone out there can help me.
Thanks
LEHSorry, looking at your code that testing URL is still incorrect. You should be passing name / value pairs in the last arguments, and your passing P6_PROJECT_ID as the name part and CASCADING_SELECTLIST_1 as the value part. In your application process you are using CASCADING_SELECTLIST_1 as the parent ID for the P6_TASK_ID dropdown, so it is this name / value pair that you'll need to test. So your URL should look something like this...
http://beta.biztech.net:2020/pls/apex/f?p=112:0:211233229176642:APPLICATION_PROCESS=CASCADING_SELECT_LIST:::CASCADING_SELECTLIST_ITEM_1:[some project id]
(Note: Where [some project id] should be an ID for a project in your database, that has tasks.)
And I'm with Dan here, I still can't access that link you provided. apex.oracle.com should be your next move if you can't resolve it, as you've got at least two people willing to go and have a look at your code.
Hope it helps,
Anthony. -
Hi all,
I have a BEx report that displays a list of empnos and their details based on a selection. Now I want to count the number of recrods that were selected and display the total number of records that were selected. How can this be done?
Thanks,
SamDear all,
Thanks for the suggestions. Actially I had solved it in another way.
As suggested by Sharma, I had used a CKF as count, But i did not want the empnos to come as the rows with 1 displayed across each row.
I was trying to bring a summary in there.
So I had created a structure in Rows and in the structure created a new selection and in that selection included Employee.
This solved the problem that I was facing.
Thanks everyone for your time and effort!!
Cheers,
Sam -
Hey,
Is there a limit on the number of characters in a select statement? I have a select statement that's nearly 2500 characters. I wonder if it is going to run.
TIAYes.
CREATE TABLE your_lookups AS
SELECT MAX(code) AS code,
MAX(value) AS value
FROM (
SELECT count(code) over (order by rnum) AS code_num,
v.*
FROM (
SELECT rownum AS rnum,
DECODE (MOD (ROWNUM, 2), 1, column_value) AS code,
DECODE (MOD (ROWNUM, 2), 0, column_value) AS VALUE
FROM TABLE (varchar2_array ('01', '01/19', '02', '02/20', '03', '03/21', '04', '04/22', '05', '05/23', '06', '06/24', '07', '07/25', '08', '08/26', '09', '09/27', '10', '10/28', '11', '11/29', '12', '12/30', '13', '13/31', '14', '14/32', '15', '15/33', '16', '16/34', '17', '17/35', '18', '18/36', '19', '19/01', '20', '20/02', '21', '21/03', '22', '22/04', '23', '23/05', '24', '24/06', '25', '25/07', '26', '26/08', '27', '27/09', '28', '28/10', '29', '29/11', '30', '30/12', '31', '31/13', '32', '32/14', '33', '33/15', '34', '34/16', '35', '35/17', '36', '36/18','01L', '01L/19R', '02L', '02L/20R', '03L', '03L/21R', '04L', '04L/22R', '05L', '05L/23R', '06L', '06L/24R', '07L', '07L/25R', '08L', '08L/26R', '09L', '09L/27R', '10L', '10L/28R', '11L', '11L/29R', '12L', '12L/30R', '13L', '13L/31R', '14L', '14L/32R', '15L', '15L/33R', '16L', '16L/34R', '17L', '17L/35R', '18L', '18L/36R', '19L', '19L/01R', '20L', '20L/02R', '21L', '21L/03R', '22L', '22L/04R', '23L', '23L/05R', '24L', '24L/06R', '25L', '25L/07R', '26L', '26L/08R', '27L', '27L/09R', '28L', '28L/10R', '29L', '29L/11R', '30L', '30L/12R', '31L', '31L/13R', '32L', '32L/14R', '33L', '33L/15R', '34L', '34L/16R', '35L', '35L/17R', '36L', '36L/18R','01R', '01R/19L', '02R', '02R/20L', '03R', '03R/21L', '04R', '04R/22L', '05R', '05R/23L', '06R', '06R/24L', '07R', '07R/25L', '08R', '08R/26L', '09R', '09R/27L', '10R', '10R/28L', '11R', '11R/29L', '12R', '12R/30L', '13R', '13R/31L', '14R', '14R/32L', '15R', '15R/33L', '16R', '16R/34L', '17R', '17R/35L', '18R', '18R/36L', '19R', '19R/01L', '20R', '20R/02L', '21R', '21R/03L', '22R', '22R/04L', '23R', '23R/05L', '24R', '24R/06L', '25R', '25R/07L', '26R', '26R/08L', '27R', '27R/09L', '28R', '28R/10L', '29R', '29R/11L', '30R', '30R/12L', '31R', '31R/13L', '32R', '32R/14L', '33R', '33R/15L', '34R', '34R/16L', '35R', '35R/17L', '36R', '36R/18L'))
) v
GROUP BY code_num;Message was edited by:
scott.swank
Maybe you are looking for
-
Can't connect HP Photosmart C4780 to my wireless network
Evertime I try to connect my HP Photosmart C4780 to my wireless network I get this message: "Your computer is unable to communicate with your printer at 192.168.1.127. This may be caused by firewall software. If you are using firewall software, verif
-
ABAP development license for integration certification
Hello to all the forum members, My company is interested in certification some ABAP development that was developed for one of our costumers. The development was done using a developer license of the costumer and as we understood, ABAP development lic
-
How to extract HR Position series to BW
In the case of our project, we can find one position series in R/3 like below, using PPOME. Now we want to get it for reporting purpose in BW side. Position series --Management catagory Leader Speciality management --Engineering technical catagory De
-
I'm the author of many PDF documents used throughout my company. These PDF's are centrally located on a web server and employees typically DL them and store them on their PC's for later use. Unfortunately these PDF's often change and there's no way
-
IMac crashes multiple times a day
I need help. I bought my iMac in December 2013 and I've gotten multiple crashes and kernel panicks. Below is the report from the most recent one. Anonymous UUID: DC1A408B-1D2B-5C60-75D4-47D314ED1F9D Wed Feb 19 06:06:37 2014 panic(cpu 2 caller 0