To change entire column value in a single go.
Hi all,
I have a internal table with company as one of the field. The table may contain any company in the company field. I need to change all company values to a single company without looping. For example the company field may contain 030, 032, 036, 010 etc. But these I want to change to single company 030 "without looping". Like as we do for delete without looping, is it possible in my case?
Thanks with regards,
Suresh.
You could try something like
wa-bukrs = '030'.
MODIFY itab FROM wa TRANSPORTING bukrs WHERE bukrs NE '030'.
Look help.sap.com for syntax at [Changing Several Lines Using a Condition|http://help.sap.com/erp2005_ehp_04/helpdata/EN/fc/eb35eb358411d1829f0000e829fbfe/frameset.htm]
Consolidation or just curiosity ?
Regards
Similar Messages
-
How to refer a column value of a single row in conditional column display?
Hello,
does anybody have an idea, how i can refer a column value of a single row in conditional display of a column?
So my idea is, that a report has a column, which value is only displayed, when another column value of this row has a specific value.
I want to solve this problem with condition type: PL/SQL Function Body returning a boolean.
But I do not know how to refer the column value of each single row!
Thank you,
TimHere's a solution that, to me, seems easier to implement but, that's, of course, in the eye of the implementer.
Rather than using APEX to generate a link column for you, actually create the link as part of your SQL.
select '<a href="f?p=102:3:491847682940364::::P3_CONTACT_ID:' || CONTACT_ID || "><img src="/i/themes/theme_1/ed-item.gif" alt="Edit"></a>' CONTACT_LINK, ...
etc.
Test this out. You'll see that it works just like making a column a link using the column attributes.
Next, we'll change the SQL to use a DECODE statement to either display the link or nothing depending on what your criteria is. For example, let's assume you only want a link for active contacts.
select Decode( CONTACT_STATUS, 'A', '<a href="f?p=102:3:491847682940364::::P3_CONTACT_ID:' || CONTACT_ID || "><img src="/i/themes/theme_1/ed-item.gif" alt="Edit"></a>', NULL ) CONTACT_LINK, ...
etc.
This will not display the link in any rows in which the CONTACT_STATUS is not active, i.e. "A"
-Joe -
How to change the column value which is coming from DO by a calculated field?
Hi all,
I want to change a column value based on my calculated field value. I have a column which is coming from DO which is based on External Data Source. I have a calculated field in my report. When there is any change in the calculated field then the column which is coming from DO needs to be changed. It means the DO needs to get updated when there is a change in the calculated field. Or like if the calculated field meets some condition then I need to change/update the same in the DO. This has to be done on the fly. the report should not submitted for this. when there is a change in the calculated column the DO column needs to get updated.
Thanks,
Venky.Ok, I've been a customer for very many years, I'm on a fixed retirement
income. I need to reduce my bills, my contract ends in Dec. I will be
pursuing other options unless I can get some concessions from Verizon. My
future son-in-law was given this loyalty plan, so I know this is a
reasonable request. My phone number is (removed) acct number
(removed)
>> Personal information removed to comply with the Verizon Wireless Terms of Service <<
Edited by: Verizon Moderator -
How to change the column value upto 68000 rows
Hi,
I want to change the column value.
I have table called RefDoc
Select distinct r.int_ref from refdoc r where r.int_ref like '\\dxb%'
Int_Re__f
\\dxb\Sample\BFE B777\2008\PO2025225.tif
\\dxb\Sample\RO\SFR\26-01-2009j\RO2022098.pdf
\\dxb\Sample\RO\SFR\26-01-2009j\RO2040831.pdf
\\dxb\Sample\BFE B777\2008\PO2025253.tif
\\dxb\Sample\RO\UM INV\26-01-2009\RO2018358.pdf
up to 68000 rows
I want to change to \\AUH instead of \\dxb.
I want the table like
Int_Re__f
\\AUH\Sample\BFE B777\2008\PO2025225.tif
\\AUH\Sample\RO\SFR\26-01-2009j\RO2022098.pdf
\\AUH\Sample\RO\SFR\26-01-2009j\RO2040831.pdf
\\AUH\Sample\BFE B777\2008\PO2025253.tif
\\AUH\Sample\RO\UM INV\26-01-2009\RO2018358.pdf
Thanks
Niharuser REPLACE function and change it
UPDATE refdoc
SET int_ref = REPLACE(int_ref, '\\dxb\', '\\AUH\')
WHERE int_ref like '\\dxb\%' -
Hi,
I have to change the column values in a table. The values in the column are to be updated.
For e.g. If the old value is
"xxxxxxxxxx", I need to take that and update into "xxxyyyxxxx".
The column values is so long as its a description field, so its a combination of many other table fields. Its just I need to add one more field.
How can I do that? Any help appreciated.
ThanksHi,
See this:
I have got table with DESCRIPTION column which will be updated. Table structure is:
SQL> DESC SOLD_ITEMS;
Nazwa Wartość NULL? Typ
COMPONENT VARCHAR2(255)
SUBCOMPONENT VARCHAR2(255)
YEAR NUMBER(4)
MONTH NUMBER(2)
DAY NUMBER(2)
DEFECTS NUMBER(10)
DESCRIPTION VARCHAR2(200)
Table description contains values from (component, year, month, day & defects) column. I would like to add subcomponent value to this column.
SQL> SELECT * FROM SOLD_ITEMS;
COMPONENT SUBCOMPONENT YEAR MONTH DAY DEFECTS DESCRIPTION
graph bar 2006 4 3 10 graph 2006/4/3
graph bar 2006 4 1 1 graph 2006/4/1
search user search 2006 4 2 23 search 2006/4/2
search user search 2006 4 1 54 search 2006/4/1
search product search 2006 3 20 0 search 2006/3/20
search product search 2006 3 16 3 search 2006/3/16
6 wierszy zostało wybranych.
SQL> EDIT
Zapisano plik afiedt.buf
I use the SUBSTR and LENGTH function to place SUBCOMPONENT value between COMPONENT value and YEAR value. That's how I done it:
1 UPDATE SOLD_ITEMS
2* SET DESCRIPTION = SUBSTR(DESCRIPTION,1,LENGTH(COMPONENT)) || ' ' || SUBCOMPONENT || ' ' || SUBSTR(DESCRIPTION,LENGTH(YEAR))
SQL> /
6 wierszy zostało zmodyfikowanych.
SQL> SELECT DESCRIPTION FROM SOLD_ITEMS;
DESCRIPTION
graph bar 2006/4/3
graph bar 2006/4/1
search user search 2006/4/2
search user search 2006/4/1
search product search 2006/3/20
search product search 2006/3/16
6 wierszy zostało wybranych.
SQL> SPOOL OFF;
Peter D. -
Changing 'All Column Values' in dashboard prompt
In OBIEE 11g, how to modify the dashboard prompt All label value? I do not want to change value in XML file , because it will impact all dashboard prompt value.
Is it there better method to implement this problem?
For example:
In dashboard prompt-->edit -->options--->tick 'Include "All Column Values" choice in the list', so I can view '(All Column Values)' value in prompt. Customers want to changed this value,such as 'all values'. Is it possible? Thanks.Hi,
Can do it using Union All is prompt SQL and presentation variable in report.
Refer : http://www.varanasisaichand.com/2010/01/editing-all-choices-in-dashboard.html
Regards,
Srikanth -
To get the count of records and able to access the column value in a single
Hi
Is there any way to get the number of records in the query and access the column values
e.g
select count(*)
from
(SELECT department, COUNT(*) as "Number of employees"
FROM employees
WHERE salary > 25000
GROUP BY department ) a
This wil only get the Count, if i want to access each row from the inline view how can i do that.Your question is not clear.
Are you looking for total record count as well as count by department ?
Something like this?
SQL>
SQL> with temp as
2 (
3 select 1 dept ,10000 sal from dual union
4 select 1 dept ,25100 sal from dual union
5 select 1 dept ,30000 sal from dual union
6 select 1 dept ,40000 sal from dual union
7 select 2 dept ,10000 sal from dual union
8 select 2 dept ,25100 sal from dual union
9 select 2 dept ,30000 sal from dual union
10 select 2 dept ,40000 sal from dual )
11 select count(*) over( partition by 1 ) total_count,dept,
12 count(*) over(partition by dept) dept_cnt from temp
13 where sal>25000;
TOTAL_COUNT DEPT DEPT_CNT
6 1 3
6 1 3
6 1 3
6 2 3
6 2 3
6 2 3
6 rows selected
SQL> -
How to store all the columns values into one single column
Hi All,
this is my file layout,i am receiving the data in below format only
emp_no,c1,c2,c3,c4,c5
100 ,1 ,0 ,1 ,0,1
200 ,1 ,0 ,1 ,0,1
300 ,1 ,0 ,1 ,0,1
but i want to store that above data into my table like(from c1 to c5 columns values i want to store in period column)
emp_no,period
100 ,1
100 ,0
100 ,1
100 ,0
100 ,1
200 ,1
200 ,0
200 ,1
200 ,0
200 ,1
300 ,1
300 ,0
300 ,1
300 ,0
300 ,1
please help meStrange but this is it
Processing ...
with original as (
select 100 as id ,1 as v1,0 as v2,1 as v3,0 as v4,1 as v5
from dual
union all
select 200 ,1 ,0 ,1 ,0,1
from dual
union all
select 300 ,1 ,0 ,1 ,0,1
from dual
select id,v1 as res_row
from original
union all
select id,v2
from original
union all
select id,v3
from original
union all
select id,v4
from original
union all
select id,v5
from original
ID RES_ROW
100 1
200 1
300 1
100 0
200 0
300 0
100 1
200 1
300 1
100 0
200 0
300 0
100 1
200 1
300 1
15 row(s) retrievedBye Alessandro -
Comparison of multiple column values with a single column value
I have two separate tables say Tab1 and Tab2
I want to select some datas , which is common to both the tables.
In tab1 , there is a column 'STATE' and it's value is 'A'
In tab2, there are multiple columns for the state, say STATE_A,STATE_B, STATE_C ETC and a row is present with the following details
STATE_A = 1, STATE_B =1 ,STATE_C =0,STATE_D=1
I need to select STATE when STATE_A ='1',
if my STATE='B', this STATE has to be selected since STATE_B =' 1', similraly
if my STATE='D', this STATE has to be selected since STATE_D =' 1',
If my STATE='C', STATE_C should not get selected since it's '0'.
Is it possible to do this in a single SELECT statement, where I have some other checks also or else how can I achieve it?Maybe this will help
Select * from STATE_MAS ;
STATE
A
B
D
F
H
Select * from STATE_CHILD
STATE_A STATE_B STATE_C STATE_D STATE_E STATE_F STATE_G STATE_H STATE_I STATE_J
1 0 0 1 1 0 0 0 0 0
CREATE OR REPLACE FUNCTION GET_STATE (P_VAL VARCHAR) RETURN NUMBER IS
V_SQL VARCHAR2(200);
V_COL VARCHAR2(35);
P_RETURN NUMBER ;
BEGIN
V_COL := 'STATE_'||P_VAL;
V_SQL := 'SELECT 1 FROM STATE_CHILD WHERE '||V_COL||' = 1 ';
EXECUTE IMMEDIATE V_SQL INTO P_RETURN ;
RETURN P_RETURN ;
END;
SELECT STATE FROM STATE_MAS
WHERE GET_STATE(STATE) = 1 ;
STATE
A
D -
Column not showing up in Change Default Column Values settings
There is a column that appears in the view without a problem but we are not seeing the column in the Library settings "Columnd Default Value Settings" We see other similar columns (single line of text) from the same content type but
we are not seeing this one. I am not sure why and and not really sure how to start troubleshooting this. curious.
davidhSeems strange issue, but i have few questions. What is the type of the column which is missing?
Is this content type is custom one and developed using Visual studio? do you see the same behavior when you try to create from UI(I think you should see same behavior)? did you try creating/developing the content type in other site template?
My Blog- http://www.sharepoint-journey.com|
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful -
Get a Column value based on other column value in a single query
Hi All,
I have a problem here -
In Table XYZ I have columns by name A, B, C and COL_I. COL_I has a value A or B or C. Based on the value in COL_I, I need to get the value from the corresponding column in the table.
For Ex: If the COL_I has the value as 'A' then I need to fetch the value from the column A. If it is 'B' then fetch from column B.
This has to be done in a single query.
Thanks,
san_mahHi You can use this query
I have taken this simple case
SQL> desc column_fetch
Name Null? Type
C_FIRST_NAME VARCHAR2(30)
C_MIDDLE_NAME VARCHAR2(30)
C_LAST_NAME VARCHAR2(30)
C_GET_NAME VARCHAR2(30)
based on C_GET_NAME find values in columns C_FIRST_NAME,C_MIDDLE_NAME,C_LAST_NAME
Values in Table
SQL> select * from column_fetch
2 ;
C_FIRST_NAME C_MIDDLE_NAME C_LAST_NAME C_GET_NAME
A B C D
A B C F
A B C F
A B C A
A B C B
A B C C
CASE Statement:
SELECT
CASE WHEN c_first_name=c_get_name THEN c_first_name
WHEN C_MIDDLE_NAME=C_GET_NAME THEN C_MIDDLE_NAME
WHEN C_LAST_NAME=C_GET_NAME THEN C_LAST_NAME
ELSE 'Nothing' END
FROM column_fetch; -
Getting last year column value from a single table
I am having the following columns in my table
BRANCH_CD
YYMM
VNDR#
VGROUP#
SALES_TRGT_AMT
SALES_ACTL_AMT
CUM_TRGT_AMT
CUM_ACTL_AMT
i need to get sales_actl_amt from this year and sales_actl_amt from last year from a single table
pls help
thank you
Edited by: 960991 on Nov 19, 2012 11:13 PMHi ashish,
but i can't use unions in my reports.
once view my query :
select t.branch_cd,b.branch_e_name,t.vndr#,v.vndr_name,
sum(nvl(t.sales_actl_amt,0)) sales_actl_amt
from inv_sales_trgt_val t,branches b,vendor v where
t.branch_cd=b.branch_cd and
t.vndr#=v.vndr# and
(t.yymm between :fiscal_month and :fiscal_month2) and
(:fiscal_month<>trunc(:fiscal_month2,-2)) and :fiscal_month2<>trunc(:fiscal_month2,-2)) and t.branch_cd between :from_branch and to_branch and
t.vndr# between :from_vndr and :to_vndr
group by t.vndr#,v.vndr_name,t.branch_cd,b.branch_e_name
order by t.vndr#,t.branch_cd;
how can i get last year sales_actl_amt . -
Get the column values in a single row seperated by commas
Hi
i have two tables project_baseline and project_resource which have the foreign key project_id from the base table project_details. Now iam trying to retrieve data from these tables using the below query :
select distinct b.TASK_NAME,r.RESOURCE_NAME,() from project_baseline b inner join project_resource r on R.PROJECT_ID=B.PROJECT_ID group by b.TASK_NAME,r.RESOURCE_NAME
Below is the output snippet :
TASK_NAME RESOURCE_NAME
TEST DESIGN PARAGI M
TEST DESIGN RAJAN M S
TEST EXECUTION VIBHU ARMA
TEST EXECUTION PRATHAB GARG
TEST EXECUTION NAGABHUSHAN G K
TEST DATA PREPARATION RAJAN M S
TEST DATA PREPARATION SHIVA MARAN
TEST CASE REWORK VISWAN RAM
TEST CASE REVIEW NAGABHUSHAN G K
REGRESSION SANGEET
PROJECT SUPPORT VIBHU ARMA
PROJECT SUPPORT PRATHAB GARG
PROJECT SUPPORT PARAGI M
PROJECT SUPPORT NAGABHUSHAN G K
PROJECT SUPPORT SANGEET
PROJECT CLOSURE PRATHAB GARG
i need to get the resource_names in a single row seperated by comma for a single task like following:
TASK_NAME RESOURCE_NAME
PROJECT SUPPORT VIBHU ARMA,PRATHAB GARG,PARAGI M,NAGABHUSHAN G K,SANGEET
Could anyone please help me to get the query for the above formated output?
Thanks in advance
Meera
Edited by: 928378 on May 22, 2012 5:20 AMHi,
It can be done using xmlagg function.
For Example :
Table Data..
DEPTNO ENAME
20 WARD Tree
23 Shank
30 BLAKE
10 MILLER
30 MARTIN
10 CLARK
20 SCOTT
30 TURNER
20 ADAMS
30 JAMES
20 FORD
30 BLAKE
Query:
SELECT deptno,
RTRIM (XMLAGG (XMLELEMENT (e, ename || ',')).EXTRACT ('//text()'),
) NAME
FROM emp
GROUP BY deptno;
Output :
DEPTNO NAME
10 MILLER,CLARK
20 WARD Tree,FORD,ADAMS,SCOTT
23 Shank
30 BLAKE,TURNER,BLAKE,JAMES,MARTIN
Thanks,
Shankar
Thanks,
Shankar. -
Can we change filter column values in a union query using Dashboard prompt
Hi,
I have a requirement in which have to draw a chart report for last six months?.
When i query against database, my query got different where clause for open month and close month.
Say for july month bar, it got close month as july and open month as july, june, may. Like this, for june month bar, it has to have close month as june and open month as june, may, april. like this, i created six union queries using repository variable.
Want to give control using dashboard prompt for close month and open month?
my query look like this.
select close month1, fact1 from table1
where close month = july and open month in (july, june, may)
UNION
select close month2, fact2 from table1
where close month = june and open month in (june, may, april)
UNION
select close month3, fact3 from table1
where close month = may and open month in (may, april, march)
UNION
select close month4, fact4 from table1
where close month = april and open month in (april, march, february)
UNION
select close month5, fact5 from table1
where close month = march and open month in (march, february, january)
UNION
select close month6, fact6 from table1
where close month = february and open month in (february, january, december)
Welcome your suggestions on this?.
ThanksHi Karol,
Yes the prompt is working fine when i put this following method under the "Button" Component.
APPLICATION.openPromptDialog(800, 600);
Somehow the when i use the "Input Field" and use the "Button" Component and write this following logic inside it i don't see the prompt is not taking the values what i am entering in input field i assume that its issue with data-source not getting refreshed.
Variable=INPUTFIELD_1.getValue();
APPLICATION.setVariableValue("PercentageIncrease",Variable);
Thanks,
Kumar -
Merge two column value in single column
Team,
I have a requirement where in I need to merge 2 column values in a single column.
ex. I have Percent_complete column in my table. and my table has only one record.
I need to query such that I need to store the values of percent_complete and (100- percent_complete) values in a single column.
ex
Percent complete has 30 value.
I need to select 30 and 70(100-30) both in a single column.
Thanks,SQL> select *
2 from tbl
3 /
PERCENT_COMPLETE
30
SQL> select abs(grouping(1) * 100 - max(percent_complete)) percent_complete
2 from tbl
3 group by rollup(1)
4 /
PERCENT_COMPLETE
30
70
SQL> select nvl(percent_complete,100 - max(percent_complete)) percent_complete
2 from tbl
3 group by rollup(percent_complete)
4 /
PERCENT_COMPLETE
30
70
SQL>
SY.
Maybe you are looking for
-
DMS BAPI_DOCUMENT_CREATE2 Class type Technical Document Category, object ty
Hello Experts! The problem is that DMS import functionality stoped working after supp. pack implementation. The process is based on BAPI_DOCUMENT_CREATE2 functionality. The first problem was an error "The status set requires a previous status" which
-
Hi, Has anyone ever worked with business roles. I am new to the OCM side having worked on the security side for many years. I am working on a project developing business roles and needed more details on how business roles link to security roles?
-
Hello, In our department we always set Flash Player to never check for updates. As admins we wanted to be in control of distributing Flash to avoid any potential issues. There have been 3 Flash updates in the last 2 weeks so we have decided it is bes
-
Need a FM for Updating an Currency field into database table
Hi Friends, i have a problem, i have a field of type currency . the value is 14,150.00 ; while updating or inserting these value to database i am geting an error of " unable to interpret 14,150.00";,,, the problem is with the " , " ( Comma) so
-
Secure empty trash hangs Lion and fans roar like crazy
I have lion and thought they would have fixed this. just as the title says. what gives?