Using Max to return largest Epoch date for a column inside DateAdd function
I am trying to build a query that returns the "last date" associated with a specific user. The "last date" is listed in the table as epoch time and I am attempting to convert the epoch time using DateAdd(). The statement below
generates an Arithmetic overflow error when the statement is executed.
select top 1 (select dateadd(s, (select max(dbo.history.action_created_date)as action_created_date), 19700101)
from dbo.history where dbo.history.ActionTakenBy like 'Nathan%') as MaxDate, dbo.history.act_name, dbo.history.ActionTakenDateText
from dbo.history
where dbo.history.ActionTakenBy like 'Nathan%';
you can simpy do this instead
select dateadd(s, action_created_date, '19700101 00:00:00.000') as MaxDate,act_name,ActionTakenDateText
FROM
select dbo.history.act_name, dbo.history.ActionTakenDateText,
dbo.history.ActionTakenBy,
ROW_NUMBER() OVER (PARTITION BY dbo.history.ActionTakenBy ORDER BY dbo.history.action_created_date DESC) AS Seq
from dbo.history
)t
where ActionTakenBy like 'Nathan%'
AND Seq=1;
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Similar Messages
-
Using the tcode:S_ALR_87013611, no report data for the cost center
Hi,Friends.I need a help.
In the tcode FB60,i entered the following data and then posted the vendor inovice sucessfully.
data:
( Note: G/L acct:55020141 is also a primary cost element)
In the tcode:S_ALR_87013611,I entered the following data and executed.
but the result is:{Report contains no data. Check the selection log}.
data: { Controlling Area: C999, Fiscal Year: 2010, From Period:1, To Period:12,Plan Version:0,
Or value(s):2001}
(Note: Cost center:2001 belongs to Controlling Area: C999)
please tell me how to do,so that using the tcode:S_ALR_87013611, I can see the report data for
the cost center 2001.
sincerely WenYao Ma
Edited by: wenyao ma on Mar 22, 2010 1:09 PMthank you,friends.
I just solved it.
Solution:
1) Maintain Controlling Area
path:spro>Controlling>Organization>Maintian Controlling Area>Maintain Controlling Area. tcode:OKKP
In the {Activate components/control indicators}cost center should be 'component active'
2) Maintain Number Ranges for Controlling Documents
path:spro>Controlling>Organization-->Maintain Number Ranges for Controlling Documents. tcode:KANK
Element { COIN CO Through-postings from FI} should be assigned to one group. -
Is it possible to use an exchange rate of any date for amounts of a cube
Hello experts,
Is it possible or not to use an exchange rate of any date (ex : 23/02/2009) for amounts of a cube where the time are ONLY Fiscal Period.
Thanks in advance.Thanks for the immediate response.
The situation is..
We have the cube , that has only FISCAL PERIODS.
The user want to apply an exchange rate of the date 23/02/2009 (which is NOT the last day of the period !).
See here the values of the table TCURR,, for the dates between 20/02 and 05/03.
Normally, the user wants to use the Rate of the 23.02.2009 --> 0.87800
Currently all the queries gives a calculation based on the rate of 0.89330, which is related to the 1st day AFTER the posting period that correspond to the given key-date.
1.There are 3 fiscal periods ; 001 / 002 / 003.
2.The calculated rate (0.89335) correspond to the TCURR rate of 02.03.2009 (value 0.89330)
which date correspond to the 1st day after the fiscal periods (002) in which the key-date (23/02/2009) was choosen.
Hence, we can say that the key-date is u2018Recognizedu2019 by the system as a true referenceu2026 (the choosen period correspond to the choosen key-date) ;
BUT, it seems impossible to get the rate of a specific date, for a cube that has only FISCAL PERIODS.
I am looking for
1.looking in the literature whether this case is explained clearly ;
2.eventually, finding a way to respons to the useru2019s ,needs
thanks in advance. -
Question about using MAX to get the lastest date.
My question is I need to get the latest erstate.DATE_CREATED.
I thought that I could just do the following max(erstate.DATE_CREATED) but get
this error message (ora-00937: not a single-group group function). Can some explain to me what I am supposed to do. Thanks
select eractivity.er_case_id,
erstate.description as latest_status,
erstate.DATE_CREATED
from dpss_gdats.er_activity eractivity,
dpss_gdats.er_state erstate
where eractivity.ER_STATE_ID = erstate.er_state_id
and eractivity.er_case_id = :p_caseYes max(erstate.DATE_CREATED) will get you the latest erstate.DATE_CREATED. Looking at your query I'm not really sure if you want the latest date for every case_id, description or you want the latest date_created period.
If you want the former:
select eractivity.er_case_id, erstate.description as latest_status,
max(erstate.DATE_CREATED)
from dpss_gdats.er_activity eractivity,
dpss_gdats.er_state erstate
where eractivity.ER_STATE_ID = erstate.er_state_id
and eractivity.er_case_id = :p_case
group by eractivity.er_case_id, erstate.description
for the latter :
select max(erstate.DATE_CREATED)
from dpss_gdats.er_activity eractivity,
dpss_gdats.er_state erstate
where eractivity.ER_STATE_ID = erstate.er_state_id
and eractivity.er_case_id = :p_case -
Problem in Loading data for clob column using sql ldr
Hi,
I am having problem in loading data for tables having clob column.
Could anyone help me in correcting the below script for ctrl file inorder to load the data which is in mentioned format.
Any help really appreciated.
Table Script
Create table samp
no number,
col1 clob,
col2 clob
Ctrl File
options (skip =1)
load data
infile 'c:\1.csv'
Replace into table samp
fields terminated by ","
trailing nullcols
no,
col1 Char(100000000) ,
col2 Char(100000000) enclosed by '"' and '"'
Data File(1.csv)
1,asdf,"assasadsdsdsd""sfasdfadf""sdsdsa,ssfsf"
2,sfjass,"dksadk,kd,ss""dfdfjkdjfdk""sasfjaslaljs"
Error Encountered
ORA-01461: can bind a LONG value only for insert into a LONG column
Table sampThanks in advanceI can't reproduce it on my 10.2.0.4.0. CTL file:
load data
INFILE *
Replace into table samp
fields terminated by ","
trailing nullcols
no,
col1 Char(100000000) ,
col2 Char(100000000) enclosed by '"' and '"'
BEGINDATA
1,asdf,"assasadsdsdsd""sfasdfadf""sdsdsa,ssfsf"
2,sfjass,"dksadk,kd,ss""dfdfjkdjfdk""sasfjaslaljs"Loading:
SQL> Create table samp
2 (
3 no number,
4 col1 clob,
5 col2 clob
6 );
Table created.
SQL> host sqlldr scott/tiger control=c:\temp\samp.ctl log=c:\temp\samp.log
SQL> select * from samp
2 /
NO
COL1
COL2
1
asdf
assasadsdsdsd"sfasdfadf"sdsdsa,ssfsf
2
sfjass
dksadk,kd,ss"dfdfjkdjfdk"sasfjaslaljs
NO
COL1
COL2
SQL> SY. -
Get frequent data for each column of a table
What is the best way to get the most frequent data in each column of a table.
we have around 25 tables and each table has around 20 columns , so rather than writing group by for each column of table , is there any easy way to find this?
example we have table
Column A Column B Column C
Apple Monday Red
orange Tuesday Green
Apple Monday Red
Lemon Wednesday Green
Apple Thursday Red
in this table, column A's frequnt data is Apple , column B's frequent data is Monday , Column C's frequnt data is Red
Apple 3 Monday 2 Red 3
Orange 2 Tuesday 1 Green 2
Lemon 1 Wednesday 1
Thursday 1
Group by kind of query will give this result, but with 20 tables each having 20 - 30 columns if we need similar kind of result .. is there any way to get this data.Hi,
GROUP BY (using aggregate functions) is the best way to do what you described.
PIVOT and UNPIVOT are probably what you'd want in this case. The phrase "GROUP BY" may not actually appear in your code, but you'll essentially be doing a GROUP BY.
Analytic functions (rather than aggregate functions) can do the job, too, but they'll be less efficient. Analytic functions get you results about the groups, without losing each row's identify, but in this case, losing each row's identity is eactly what you want to do. You only want 'Apple' to appear 1 time, not 3 times.
The fact that you need to do the same query on 20 different tables suggests that there's something wrong with your table design. Wouldn't it be better to have 1 big table, with a new column that has 20 unique values instead?
I hope this answers your question.
If not, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
Simplify the problem as much as possible. For example, instead of posting a problem with 20 tables, each having 25 columns, post a similar problem involving, say, 2 tables, each with 3 columns.
Always say which version of Oracle you're using (for example, 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Best practice to upload data for Appraisals: BDC, LSMW or functional module
Hi,
I have heard that BDC and LSMW do not work for data upload in appraisals. Is it true?
Can we use ECATT or SECATT to upload data in appraisals?
I somewhere got the information that functional modules
HRHAP_DOCUMENT_PREPARE
HRHAP_DOC_UPDATE_BODY_AND_SAVE
HRHAP_DOCUMENT_CREATE
are used to upload the data for appraisals?
Many of my earlier clients found it very hectic to create appraisal templates every year (PHAP_CREATE). They needed something automated for this. I managed to suggest them manual upload or SECATT, but I am not sure if BDC/LSMW work for this.
Can somebody throw some light on this?
Best regards,
Veera Sasidhar JangamHi,
You need to write a code for same and use function modules available as those does direct updates to database.
If client is not bothered about look and feel during dataload or do not care about display infotypes during data updates then use above method otherwise BDC needs to be written with screen control programming in it.
Thanks,
Ameet -
Get a quarter out of data for a column chart
Who can help me with this challenge?
I want to create a column chart with four quarters in the current year and one column with the rest later in time.
One project can have multiple output data. They are separated by an ;
The notation of the outputdata can be a date (d-m-yyyy), a month (mm-yyyy) or a quarter (Q1-yyyy).
This is by example the available data.
Project outputdata
Project 1 1-4-2014
Project 2 03-2014;Q4-2014;Q2-2015
Project 3 25-09-2014;Q1-2015
The data I want to get for the column chart is:
Project outputdata columnchart
Project 1 1-4-2014 Q2-2014
Project 2 03-2014 Q1-2014
Project 2 Q4-2014 Q4-2014
Project 2 Q2-2015 2015 and later
Project 3 25-09-2014 Q3-2014
Project 3 Q1-2015 2015 and later
I hope that someone can help me in the right direction.
Thanks in advance,
ElsAdding to what Frank has already suggested, try something on these lines:
Something like this?
SQL> ed
Wrote file afiedt.buf
1 with x2 as(
2 select 'proj1' proj, '1-4-2014' op, NULL chart from dual UNION ALL
3 select 'proj2' proj, '03-2014' op, NULL chart from dual UNION ALL
4 select 'proj2' proj, 'Q4-2014' op, NULL chart from dual UNION ALL
5 select 'proj2' proj, 'Q2-2015' op, NULL chart from dual UNION ALL
6 select 'proj3' proj, '25-09-2014' op, NULL chart from dual UNION ALL
7 select 'proj3' proj, 'Q1-2015' op, NULL chart from dual
8 )
9 select
10 proj,
11 op,
12 case
13 when regexp_like(op,'((\d{1}|\d{2})-(\d{1}|\d{2})-(\d{4}))')
14 then
15 'Q'||TO_CHAR(TO_DATE(op,'dd-mm-yyyy'),'Q')||'-'||TO_CHAR(TO_DATE(op,'dd-mm-yyyy'),'yyyy')
16 when regexp_like(op, 'Q\d{1}-\d{4}')
17 then
18 CASE
19 when SUBSTR(op,-4,4) > 2014
20 then
21 SUBSTR(op,-4,4)||' and later'
22 else
23 op
24 end
25 when regexp_like(op, '\d{2}-\d{4}')
26 then
27 'Q'||TO_CHAR(TO_DATE(op,'mm-yyyy'),'Q')||'-'||TO_CHAR(TO_DATE(op,'mm-yyyy'),'yyyy')
28 end
29* from x2
SQL> /
PROJ OP CASEWHENREGEXP
proj1 1-4-2014 Q2-2014
proj2 03-2014 Q1-2014
proj2 Q4-2014 Q4-2014
proj2 Q2-2015 2015 and later
proj3 25-09-2014 Q3-2014
proj3 Q1-2015 2015 and later
6 rows selected. -
Can I use iphone in BMW via usb interface for phone call and ipod functions
Can I use iphone in BMW via usb interface for phone call and ipod functions
Why don't you check the manual for your car or ask your dealer?
-
How to name the data for each column I am acquiring in lvm file
does anybody hint How to name the data for each cloumn I am acquiring in lvm file.
I want to tag or name ,eg temperature at top of a column which shows the temperature readings .I am writing into a labview measurement file.
ThanksUse Set Waveform Attribute on each channel of your data. Set an attribute with name "NI_ChannelName". The value is a string containing the name you wish to call the channel.
This account is no longer active. Contact ShadesOfGray for current posts and information. -
Hi Guys,
We have a CLOB column in our PNR database with the complete PNR details as below (all information has been changed ):
<PNR><PNR_Body>AXYDFB -ETKT-
REC LOC HDQ1P37EJNM/XAV/24639860/CHI/1P/T/US/USD/GS
HDQ RM 1P 01OCT0000Z
1.1TEST/ONE
1 VS3011N 14DEC SA LHREDI HK1 1950. 2120. 03C*
2 VS3002N 18DEC WE EDILHR HK1 0910. 1040. 03C*
FONE-
1.LHR*[email protected]/N000
2.LHR72582/H530
3.LHR8200144*I24639860 ORBITZ/A877
4.LHR3072582/H415
TKT-T/TBC/CCAX379461823464012/12/72601233655/0001/$
GEN FAX- *TKN/SSR FOR TKT NBRS
1.OSI YY BF0.00 TX141.10 TF141.10 PADT@FSR
2.SSRSEATVSKK1LHREDI3011N14DEC.03CN/RS
3.SSRSEATVSKK1EDILHR3002N18DEC.03CN/RS
4.SSROTHSVSKK1LHREDI3011N14DEC.UNTKTD VS SEGS MAY CANX 141013
5.SSROTHSVSKK1LHREDI3011N14DEC.TKT PER FARE RULES TO AVOID ADM
6.SSROTHSVSKK1EDILHR3002N18DEC.UNTKTD VS SEGS MAY CANX 141013
7.SSROTHSVSKK1EDILHR3002N18DEC.TKT PER FARE RULES TO AVOID ADM
8.SSROTHSVSKK1LHREDI3011N14DEC.UNTKTD VS SEGS MAY CANX 141013
9.SSROTHSVSKK1LHREDI3011N14DEC.TKT PER FARE RULES TO AVOID ADM
10.SSROTHSVSKK1EDILHR3002N18DEC.UNTKTD VS SEGS MAY CANX 141013
11.SSROTHSVSKK1EDILHR3002N18DEC.TKT PER FARE RULES TO AVOID ADM
12.SSROTHSVSKK1LHREDI3011N14DEC.UNTKTD VS SEGS MAY CANX 141013
13.SSROTHSVSKK1LHREDI3011N14DEC.TKT PER FARE RULES TO AVOID ADM
14.SSROTHSVSKK1EDILHR3002N18DEC.UNTKTD VS SEGS MAY CANX 141013
15.SSROTHSVSKK1EDILHR3002N18DEC.TKT PER FARE RULES TO AVOID ADM</PNR_Body><PNR_History>REC LOC AXYDFB7EJNM/XAV/24631260/CHI/1P/T/US/USD/GS
HDQ RM 1P 01OCT0000Z
A3 SSRSEATVSNN1LHREDI3011N14DEC.03C/RS
RCVD-AXYDFB7EJNM/XAV/24612860/CHI/1P/T/US/USD/GS
HDQ RM 1P 01OCT0000Z
X3 SSRSEATVSNN1LHREDI3011N14DEC.03C/RS
A3 SSRSEATVSKK1LHREDI3011N14DEC.03CN/RS
RCVD-
HDQ RM 1P 01OCT0000Z
A3 SSRSEATVSNN1EDILHR3002N18DEC.03C/RS
RCVD-AXYDFB7EJNM/XAV/24612860/CHI/1P/T/US/USD/GS
HDQ RM 1P 01OCT0000Z
X3 SSRSEATVSNN1EDILHR3002N18DEC.03C/RS
A3 SSRSEATVSKK1EDILHR3002N18DEC.03CN/RS
RCVD-
HDQ RM 1P 01OCT0000Z
A3 SSROTHSVSKK1LHREDI3011N14DEC.UNTKTD VS SEGS MAY CANX 142313
A3 SSROTHSVSKK1LHREDI3011N14DEC.TKT PER FARE RULES TO AVOID ADM
A3 SSROTHSVSKK1EDILHR3002N18DEC.UNTKTD VS SEGS MAY CANX 142313
A3 SSROTHSVSKK1EDILHR3002N18DEC.TKT PER FARE RULES TO AVOID ADM
RCVD-VSWEBSERVICE
CRC SU X1 01OCT0001Z D23B06 VS
A3 SSROTHSVSKK1LHREDI3011N14DEC.UNTKTD VS SEGS MAY CANX 142313
A3 SSROTHSVSKK1LHREDI3011N14DEC.TKT PER FARE RULES TO AVOID ADM
A3 SSROTHSVSKK1EDILHR3002N18DEC.UNTKTD VS SEGS MAY CANX 142313
A3 SSROTHSVSKK1EDILHR3002N18DEC.TKT PER FARE RULES TO AVOID ADM
RCVD-VSWEBSERVICE
CRC SU X1 01OCT0001Z AXYDFB VS
A3 SSROTHSVSKK1LHREDI3011N14DEC.UNTKTD VS SEGS MAY CANX 142313
A3 SSROTHSVSKK1LHREDI3011N14DEC.TKT PER FARE RULES TO AVOID ADM
A3 SSROTHSVSKK1EDILHR3002N18DEC.UNTKTD VS SEGS MAY CANX 142313
A3 SSROTHSVSKK1EDILHR3002N18DEC.TKT PER FARE RULES TO AVOID ADM
RCVD-VSWEBSERVICE
CRC SU X1 01OCT0001Z D12B06 VS
A3 SSRTKNEVSHK1LHREDI3011N14DEC-1TEST/ONE.4444123456C1
A3 SSRTKNEVSHK1EDILHR3002N18DEC-1TEST/ONE.4444123456C2
RCVD-AXYDFB7EJNM/XAV/24623860/CHI/1P/T/US/USD/GS
HDQ RM 1P 01OCT0042Z</PNR_History><Seating>SEATS ASSIGNED FLT 3011 14DEC HK1 1950. 2120. X CLASS
B7 * 1TEST/JA LHR TO EDI N 28Z*
NEXT FLIGHT AT EDI FLT 3002 18DEC HK1 0910. 1040. N CLASS
B2 * 1TEST/JA EDI TO LHR N 23D*</Seating><ETicket_Info>AXYDFB -ETKT- CPN FLIGHT DATE CLS FRM TO STATUS ISSUE
1. TEST/ONE 1. VS 3011 14DEC N LHREDI 1P
2. VS 3002 18DEC N EDILHR</ETicket_Info><ETicket_History>TEST/ONE 44443333222211110 $USD 141.10
FP CCAX44443333222211110/9306/142323
CHI 1P RS 01OCT0042Z 999999 VS
***END OF DISPLAY*** </ETicket_History><Fare_Quote>NO FQ DATA EXISTS</Fare_Quote><Fare_History>NO FQ DATA EXISTS</Fare_History><APIS>*NO APIS TO DISPLAY</APIS><Queue_History>SYSQ/IET/00
-Q SSRTKNE 01OCT0042Z </Queue_History></PNR>
Please can somebody suggest how I can browse through each row of the data identify credit card numbers (that we will be doing as per the business requirements from business) mask the numbers and put that back at the orignal location as it was.
Please can somebody explain me considering "44443333222211110" was a credit card number and requires to be masked.
Thanks,
ShazHere's a function you can use on 9i
CREATE OR REPLACE FUNCTION mask_cc_nums(i_clob CLOB)
RETURN CLOB IS
-- function to scan a clob and anywhere it finds a string of 16 consecutive numerics
-- replace then with 16 *'s
v_charpos PLS_INTEGER := 0;
v_outclob CLOB;
v_inlen PLS_INTEGER := dbms_lob.getlength(i_clob);
BEGIN
v_outclob := i_clob;
WHILE v_charpos+16 <= v_inlen LOOP
v_charpos := least(CASE WHEN dbms_lob.instr(v_outclob,'0',v_charpos+1) > 0
THEN dbms_lob.instr(v_outclob,'0',v_charpos+1)
ELSE v_inlen+1
END
,CASE WHEN dbms_lob.instr(v_outclob,'1',v_charpos+1) > 0
THEN dbms_lob.instr(v_outclob,'1',v_charpos+1)
ELSE v_inlen+1
END
,CASE WHEN dbms_lob.instr(v_outclob,'2',v_charpos+1) > 0
THEN dbms_lob.instr(v_outclob,'2',v_charpos+1)
ELSE v_inlen+1
END
,CASE WHEN dbms_lob.instr(v_outclob,'3',v_charpos+1) > 0
THEN dbms_lob.instr(v_outclob,'3',v_charpos+1)
ELSE v_inlen+1
END
,CASE WHEN dbms_lob.instr(v_outclob,'4',v_charpos+1) > 0
THEN dbms_lob.instr(v_outclob,'4',v_charpos+1)
ELSE v_inlen+1
END
,CASE WHEN dbms_lob.instr(v_outclob,'5',v_charpos+1) > 0
THEN dbms_lob.instr(v_outclob,'5',v_charpos+1)
ELSE v_inlen+1
END
,CASE WHEN dbms_lob.instr(v_outclob,'6',v_charpos+1) > 0
THEN dbms_lob.instr(v_outclob,'6',v_charpos+1)
ELSE v_inlen+1
END
,CASE WHEN dbms_lob.instr(v_outclob,'7',v_charpos+1) > 0
THEN dbms_lob.instr(v_outclob,'7',v_charpos+1)
ELSE v_inlen+1
END
,CASE WHEN dbms_lob.instr(v_outclob,'8',v_charpos+1) > 0
THEN dbms_lob.instr(v_outclob,'8',v_charpos+1)
ELSE v_inlen+1
END
,CASE WHEN dbms_lob.instr(v_outclob,'9',v_charpos+1) > 0
THEN dbms_lob.instr(v_outclob,'9',v_charpos+1)
ELSE v_inlen+1
END);
IF v_charpos <= v_inlen-16 AND
TRANSLATE(SUBSTR(v_outclob,v_charpos,16),' 0123456789',' ') IS NULL
THEN
v_outclob := SUBSTR(v_outclob,1,v_charpos-1)||'****************'||SUBSTR(v_outclob,v_charpos+16);
END IF;
END LOOP;
RETURN v_outclob;
END; -
Data loading: formatting data for timestamp column
Hi All,
I have a table with a timestamp column named as created_date. I want to upload data to that table using data loading page. but there is one problem while uploading data, I have a csv file in which the created_date column data in two different format as follows ,
09/03/2013 03:33am
09/02/2013 03:24pm
the above data throws an error ORA-01821: date format not recognized.
In Data / Table Mapping page, I tried with MM/DD/YYYY HH12:MI:SS AM. What format should i use for am and pm??
Please help me to solve....
Thanks in advance
LakshmiI solved by using the format MM/DD/YYYY HH:MIAM.
Thanks
Lakshmi -
Decimal Point data for Stacked Column Chart
Hi,
I use a basic version of a Column chart for one of my projects. I use a stacked column chart with 2 data series namely "Expenses" & "Profit".
I use decimal point numbers (with only two or three places after the decimal point) for both series.
When I mouse over the bars of the output for tool tip, I view more numbers after the decimal point for some data.
How to fix the decimal point to only 2 places & what is the reason for this behaviour?
Attached is the sample output (output.gif) showing the above condition for the mentioned data.
-SenCreate an toolTipShow event handler and use a NumberFormatter to set the precision of the numbers (sample code from LiveDocs):
<?xml version="1.0"?>
<!-- formatters\MainNumberFormatter.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
// Define variable to hold the number.
[Bindable]
private var bigNumber:Number = 6000000000.65;
]]>
</mx:Script>
<!-- Declare and define parameters for the NumberFormatter.-->
<mx:NumberFormatter id="PrepForDisplay"
precision="0"
rounding="up"
decimalSeparatorTo="."
thousandsSeparatorTo=","
useThousandsSeparator="true"
useNegativeSign="true"/>
<!-- Trigger the formatter while populating a string with data.-->
<mx:TextInput text="{PrepForDisplay.format(bigNumber)}"/>
</mx:Application> -
How to Load data for extra columns exist in the dest schema....
Hi Experts,
Please help me.
I need to replicate data from SchemaA to SchemaB.
SchemaB has 3 extra columns. Two are varchar2 type and other is Integer type.
I need to replicate the data from SchemaA to SchemaB in the same database.
When ever i inserted the data in SchemaA, The extra columns should be populated with some default data.
And if we did any update on SchemaA then the extra columns on SchemaB should be populated with other Data.
I wrote some DML_HANDLER but it always populating same data.
I dont know ow to handle this type of situation.
my Handler is:
CREATE OR REPLACE PROCEDURE dml_handler(in_any in sys.anydata)
IS
lcr SYS.LCR$_ROW_RECORD;
rc PLS_INTEGER;
object_owner VARCHAR2(30);
BEGIN
rc := in_any.GETOBJECT(lcr);
object_owner := lcr.GET_OBJECT_OWNER();
IF lcr.get_object_owner() = 'SchemaB' THEN
lcr.add_column('new','SHIP_DATE',sys.anydata.convertvarcahr2('N'));
lcr.add_column('new','SHIP_ZONE',sys.anydata.convertvarchar2('N'));
lcr.add_column('new','SHIP_REACH_BY_DATE',sys.anydata.convertnumber(1));
lcr.EXECUTE(TRUE);
END IF;
END;
BEGIN
DBMS_APPLY_ADM.SET_DML_HANDLER
(object_name => 'SchemaB.TAB_TEST',
object_type => 'TABLE',
operation_name => 'INSERT',
error_handler => FALSE,
user_procedure => 'STRMADMIN.DML_HANDLER');
END;
On extra columns in SChemaB
if its a first insert then the default values are (N,N,1).
If we did any update the values should be (Y,Y,2)
Post any script or give me some idea.
Thanks,
Ray
Edited by: user7423698 on Mar 3, 2009 6:12 PMCREATE OR REPLACE PROCEDURE dml_handler (
in_any IN SYS.ANYDATA
IS
lcr sys.lcr$_row_record;
rc PLS_INTEGER;
cmd_type VARCHAR2 (30);
BEGIN
rc := in_any.getobject (lcr);
cmd_type := lcr.get_command_type;
IF cmd_type = 'INSERT'
THEN
lcr.set_values ('new', lcr.get_values ('new', 'N'));
lcr.add_column ('new', 'type', sys.anydata.convertchar ('I'));
lcr.set_values ('old', NULL);
lcr.add_column ('new', 'time', sys.anydata.converttimestamp (systimestamp));
lcr.execute (TRUE);
END IF;
END;
Set the DML handler for INSERT and write a similar one for UPDATE. -
How to use BAPI_OBJCL* to set classification data for Techn. Objects - PM ?
Good afternoon !
I´m working in a project to integrate some legacy system with the ECC 6.0, and I need to do some activities like, create functional locations and equipments in SAP PM, I have done this creating Z RFC modules that call bapis like BAPI_FUNCLOC_CREATE and BAPI_EQUI_CREATE, but these BAPIs doesn´t fill classification data, so, in a first moment, I solved this using BDC, but I would like to solve these needs using standard BAPIs if possible.
To solve the classification, I tried to do it using the BAPI_OBJCL* BAPIs(BAPI_OBJCL_GET_KEY_OF_OBJECT, BAPI_OBJCL_CREATE_KEY), but I didn´t find any example of using these bapis with technical objects, so I tried to test the BAPI_OBJCL_GET_KEY_OF_OBJECT in a first moment and, when I call it passing '003' as classtype(003 is the classtype for the functional locations), this bapi returns me "Class type 003 requires additional objects"(the same occurs if I try it with 002, for equipment). What means this message ? Need I to do some customization in img/spro, or cannot these bapis be used with PM technical objects ?
Thank you for your attention,
WilsonHi all !
I have found the solution for this problem, I found that I was trying to use the wrong functions for my case, so, to solve my needs here, I will use BAPI_OBJCL_CREATE to set the classification data for Functional Locations and Equipments, and I can use BAPI_OBJCL_GETCLASSES to list all classes assigned for a Technical Object, and BAPI_OBJCL_GETDETAIL to get all characteristics assigned to a Technical Object for a specific class.
Thank you all for your attention !
Wilson
Maybe you are looking for
-
Customer as Vendor_Balance Report Required
Hi, I have some of the customers as vendors also. Assignment of the individual codes has already been in respective master records. I need to check the balance for customer as well as vendor in same report. Let me know is there any reports under whic
-
How do i use data when i'm not connected to wi-fi? it won't work
I have a brand new iPhone 4s. It works fine when I'm at home and its using our wireless. When I leave the house nothing works - imessage, internet, mail... I think I have the settings correct. HELP!
-
Table name to find out the application name
In table WWV_FLOW_USER_ACTIVITY_LOG there is a column called flow_id ,which is the application id .I want to know which is the table to find out the application name for a flow_id. Thanks in advance, Madhuri
-
Telesales Interaction External URL
Hi All, Does anybody have experience in using the JTF_PUB APIS to create interaction history records and can help me with the following: I understand the use of media item records to 'Punch Out' to associated eBusiness Suite documents (i.e. Emails in
-
Billing Status filed FKSTA in table VBUK/VBUP is not updating
Dear All In order to billing scenario, though the cycle is completed as OR-DEL-BIL-ACCT DET. All status shows completed still In place of billing status(FKSTA) it shows blank . Document Status: order completed Delivery completed picking request compl