Data change query
hi all... i have a query...
i have the following detail with me....
Numbers Key abc column date
12345 Y JVN 7/30/2010 20:45
12345 N YVM 4/30/2011 1:45
12354 Y JVN 6/18/2007 14:37
12345 N YVM 5/13/2008 16:28
i have N no of records like this. I need to write a query to find when the key underwent any change (from Y to N and from N to Y).
This is for a single Numbers column(eg:12345). I have several numbers like this.
Can someone help me with a querry for this???
Thanks in advance
Rajesh
Hello Rajesh,
this is the forum for the tool SQL Developer. Your question should be placed at {forum:id=75}.
Please mark this question (and the second posting) as answered and post again in the other forum.
Best regards
Marcus
Similar Messages
-
Where to get BW Metadata: owner, creation date, change date of a query / WS
Hello,
I need a report over the existing queries / worksheets and the owner, creation date, change date of a query etc.
You see some of the information when you go over query properties in the query designer. But you see only the information of one (the opened) query. And you have to do this for every query ...
My idea is to go over BW Metadata in the technical content.
Here is the cube BW Metadata 0BWTC_C08
(The InfoCube BW Statistics u2013 Metadata contains metadata from the Metadata Repository.)
Is this the way to do it? Or any other suggestions u2026
Can I get infos about used structures , etc over this way
Thanks MarkusI had to work on an other subject:
But now the source of information is clear:
RSRREPDIR - index of all queries
RSZELTDIR - index of all queries-components
RSRWORKBOOK - Verwendungsnachweis für Berichte in Workbooks
RSRWBINDEX - List of binary large objects (Excel workbooks)
RSRWBINDEXT - Titles of binary objects (Excel workbooks) in InfoCatalog
The tables are to join over
RSRREPDIR.COMPUID = RSZELTDIR.ELTUID
RSZELTDIR.TEXTLG contains the description
RSRWORKBOOK.GENUID = RSRREPDIR.GENUID
RSRWBINDEXT and RSRWBINDEX are connected over WORKBOOKID
I'd like to put the information of all of this tables in a cube and define a query on it.
I have to define new datasource, infosource to get the data in the cube.
Right?
Now i see some existing datasource objects in the technical content.
0TCTQUERID, 0TCTQUERID_TEXT, 0TCTQUERY, 0TCTQUERY_TEXT
I can't open them to look in. But they might be helpfull. Anybody used them?
Markus -
Pre-fill the OLAP cache for a query on Data change event of infoprovider
Hi Gurus,
I have to pre-fill the OLAP cache for a query,which has bad performance.
I read a doc 'Periodic Jobs and Tasks in SAP BW'
which suggested sum steps to do this
i hav created the setting for Bex broadcasting for scheduling job Execution with data change in info provider
thereafter doc says "an event has to be raised in the process chain which loads the data to this InfoProvider.When the process chain executes the process u201CTrigger Event Data Change (for Broadcaster)u201D, an event is raised to inform the Broadcaster that the query can be filled in the OLAP cache."
how can this b done please provide with sum proper steps
Answers are always appreciated.
Thanks.Hi
U need to create a process chain or use the existing process chain which you are using to load your current solution, just add event change process type in the process chian and inside it add the info provider which are going to be affected.
Once you are done with this go to the broadcaster and create new setting for that query...you will see the option for event data chainge in infoprovider just choose that and create the settings.
hope it helps -
hi experts
I got request to change one data validation query.
In the existing query,I see three parts...in top(first part) part,we have one query view from One cube.....when we come to middle part(second)..it has one query view from second cube.....finally,the third and bottom part contains some excel formulas which substract middle part(second) total from top part(first) total and shows the result....
so when I run the query it automatically populates top part(first) from one cube and second part(middle) from other cube and shows result in third and bottom part...
my change request is:
I donot need to change the top part(first)...I need to change middle part(second view from top)....but I donot know how to change this one....if I search on technical name of this whole Datavalidation query ...it just shows query corresponding the top part of this data validation query....
Please advise how to do this if any of you have idea
Regards,
SChand
Edited by: SChandx200 on Aug 10, 2010 8:10 AMHi,
There can be one of the two erason,
Either source data got corrupt. In your case the data in fltfile was not appropriate yesterday,, May be..
Or someone has change the Info package/Process chain for load the data and change that again today. (Check if is there any Info Package routine is written and got changed recently.
I hope it will help.
Thanks,
S -
How to execute a update query when the particular date changes
hi all,
i am using date base 11.1.0.6.0,
i am trying a small update query it should fire when particular date changes in year.
i think for trigger but i didn't get how to execute it.
Regards,
PavanHi, Pavan,
Use dbms_scheduler to run a procedure at a given time (or at repeatedly, at given times).
A trigger is good for re-acting to certain actions in the database, someone INSERTing a row in a given table, for example. Nothing will necessarily be happening when you want your procedure to run, so a trigger is not good in this case. -
Last changed date of query showing old date
Hi All,
We have made a change to a query (description change) and saved. When we open the Analyzer we still see the old description and also the last changed date shows an old date. Not the latest date the query was last changed on. We tried generating the query in RSRT, but no luck.
Can someone let us know what we can do?
Thanks!Hi Kams,
We are using the Analyzer, log out back in, etc...
As mentioned we did a regenerate by RSRT 'generate'
any other ideas? -
Sql query to bind data from grid and print total count and amount total when date changes
SELECT SLHD.VOUCH_CODE,SLHD.VOUCH_DATE,SLHD.VOUCH_NUM,SUM(SLTXN.CALC_NET_AMT) AS AMT,ACT.ACT_NAME,SUM(SLTXN.TOT_QTY) AS QTY
FROM SL_HEAD20132014 AS SLHD,ACCOUNTS AS ACT,SL_TXN20132014 AS SLTXN
WHERE SLHD.ACT_CODE=ACT.ACT_CODE AND SLTXN.VOUCH_CODE=SLHD.VOUCH_CODE
GROUP BY SLHD.VOUCH_CODE,SLHD.VOUCH_DATE,SLHD.VOUCH_NUM,ACT.ACT_NAME
ORDER BY SLHD.VOUCH_DATE
i want to print total quatity and total sale in grid when data changes
like
date amount quantity
01/02/2013 1200 1
01/02/2013 200 1
01/02/2013 1400 2 // date changes here
02/03/2013 100 1
02/03/2013 50 4
02/03/2013 150 5 // date changes and so onthis query only print all the data from table i want total quantity and total amount of daily sale in same grid when ever date changes
You may add the date filter to Visakh's query:
SELECT SLHD.VOUCH_DATE,SUM(SLTXN.CALC_NET_AMT) AS AMT,SUM(SLTXN.TOT_QTY) AS QTY
FROM SL_HEAD20132014 AS SLHD,ACCOUNTS AS ACT,SL_TXN20132014 AS SLTXN
WHERE SLHD.ACT_CODE=ACT.ACT_CODE AND SLTXN.VOUCH_CODE=SLHD.VOUCH_CODEand SLHD.VOUCH_DATE = @yourdate --passed from the front end application
GROUP BY SLHD.VOUCH_DATE
WITH CUBE
ORDER BY SLHD.VOUCH_DATE
Having said, each time when you select the date, you query the table would be expensive method. May be you can filter the date within your dataset already populated if you have entire data in the dataset. -
Can you change the data model query dynamically based on its parent query
Hi
Question:
I have a data model query q1 and q2 is the child of q1
Say q1 returns 2 rows and and
for the first row
i want q2 to be select 1 from table1
for the second row
i want q2 to be select 1 from table2
Basically i want to build the q2 dynamically
for each row fetched in q1.
Can this be done?
If so where do i write the code to achieve this
Thanx in advance.
SureshOne simple (but not very realistic) example:
1. DATABASE TABLES AND DATA
CREATE TABLE dept_all (
deptno NUMBER (2),
dname VARCHAR2 (20),
in_usa CHAR (1) DEFAULT 'Y')
INSERT INTO dept_all VALUES (10, 'DEPT 10', 'Y');
INSERT INTO dept_all VALUES (20, 'DEPT 20', 'N');
INSERT INTO dept_all VALUES (30, 'DEPT 30', 'Y');
CREATE TABLE emp_usa (
empno NUMBER (4),
ename VARCHAR2 (20),
deptno NUMBER (2))
INSERT INTO emp_usa VALUES (1001, 'EMP 1001', 10);
INSERT INTO emp_usa VALUES (1002, 'EMP 1002', 10);
INSERT INTO emp_usa VALUES (3001, 'EMP 3001', 30);
INSERT INTO emp_usa VALUES (3002, 'EMP 3002', 30);
CREATE TABLE emp_non_usa (
empno NUMBER (4),
ename VARCHAR2 (20),
deptno NUMBER (2))
INSERT INTO emp_non_usa VALUES (2001, 'EMP 2001', 20);
INSERT INTO emp_non_usa VALUES (2002, 'EMP 2002', 20);
2. DATABASE PACKAGE
Note that Oracle Reports 3.0 / 6i needs 'static' ref cursor type for building Report Layout.
So, in package specification we must have both ref cursor types, static for Report Layout
and dynamic for ref cursor query.
CREATE OR REPLACE PACKAGE example IS
TYPE t_dept_static_rc IS REF CURSOR RETURN dept_all%ROWTYPE;
TYPE t_dept_rc IS REF CURSOR;
FUNCTION dept_query (p_where VARCHAR2) RETURN t_dept_rc;
TYPE t_emp_rec IS RECORD (
empno emp_usa.empno%TYPE,
ename emp_usa.ename%TYPE);
TYPE t_emp_static_rc IS REF CURSOR RETURN t_emp_rec;
TYPE t_emp_rc IS REF CURSOR;
FUNCTION emp_query (
p_in_usa dept_all.in_usa%TYPE,
p_deptno dept_all.deptno%TYPE)
RETURN t_emp_rc;
END;
CREATE OR REPLACE PACKAGE BODY example IS
FUNCTION dept_query (p_where VARCHAR2) RETURN t_dept_rc IS
l_dept_rc t_dept_rc;
BEGIN
OPEN l_dept_rc FOR
'SELECT * FROM dept_all WHERE ' || NVL (p_where, '1 = 1') || ' ORDER BY deptno';
RETURN l_dept_rc;
END;
FUNCTION emp_query (
p_in_usa dept_all.in_usa%TYPE,
p_deptno dept_all.deptno%TYPE)
RETURN t_emp_rc
IS
l_emp_rc t_emp_rc;
l_table VARCHAR2 (30);
BEGIN
IF p_in_usa = 'Y' THEN
l_table := 'emp_usa';
ELSE
l_table := 'emp_non_usa';
END IF;
OPEN l_emp_rc FOR
'SELECT * FROM ' || l_table || ' WHERE deptno = :p_deptno ORDER BY empno'
USING p_deptno;
RETURN l_emp_rc;
END;
END;
3. REPORT - QUERY FUNCTIONS AND DATA LINK
FUNCTION q_dept RETURN example.t_dept_static_rc IS
BEGIN
-- "p_where" is a User Parameter
RETURN example.dept_query (:p_where);
END;
FUNCTION q_emp RETURN example.t_emp_static_rc IS
BEGIN
-- "in_usa" and "deptno" are columns from Parent Group (G_DEPT)
RETURN example.emp_query (:in_usa, :deptno);
END;
Of course, we must create Data Link between Parent Group (G_DEPT) and Child Query (Q_EMP).
Regards
Zlatko Sirotic -
Can not see the option Execution with Data Change in the infoprovider?
Hi team,
i am using query designer 3.x, when i go into my bex brodcaster settings and schedule my report
i can not see the option "Execution with Data Change in the infoprovider",
i can only see 2 options
Direct scheduling in background process
create new scheduling
periodic,
is there any setting which i would be able to see the option "Execution with Data Change in the infoprovider"?
kindly assistHi Blusky ,
check the below given link.
http://help.sap.com/saphelp_nw04/Helpdata/EN/ec/0d0e405c538f5ce10000000a155106/frameset.htm
Regards,
Rohit Garg -
Track Master Data Changes for Multiple countries
Hi experts,
I am in a Global HR Implementation & Rollout Project. We are creating Outbound Interfaces for 3 countries to export pay, time and general data to the 3rd party systems in those local countries. (Payroll is outsourced there).
As well as sending New Joiners data every month, we need to send Changers data also to all those 3rd partys every month before the Payroll runs.
I know 2 solution for this :
a). Using Change Documents - Tcode : SCDO ..etc
b). Using the report RPUAUD00.
c). Using RBDMIDOC.
Query :
1). Are these the only solutions ?
2). Whats the best solution for doing this for a Global Rollout project ? I need to track master data change for different countries for different set of Infotypes and fields. I need to send those Changers data as well as the New Joiners data through the Outbound Interface to all the local countries.
This year we are doing for 3 countires, next year for 9 more countries, etc. Whats the best solution keeping this in mind ?
Restrictions :
1). Our Client HRs dont want us to disturb the report RPUAUD00 as they use that regularlly and want the flexibility to configure the configs themselves.
2). If I must need to create and activate Change Documents for ALL individual fields, is there an easy way of doing this ?
3). I need to send this Changers data from SAP to Legacy system, so dont know if RBDMIDOC will be a good solution for this. Any comments ?
Just want the best possible and feasible solution for this issue.
I will be please to allot point to anyone who gives a good solution.
Moreover will be Thankfull also !!
Cheers.Please try with transaction code "PC00_M02_LINF0"
Cheers
Suresh.KK -
Hi all,
Please help me with some useful information regarding the history of master data creationa and changes. I need to create a query for creation and changes of vendor master data. Data for creation of the vendor master data are saved in LFA1 but for changes I cannot find table.
Thank you,
DesimiraHi,
You can use the standard report for Vendor master data changes, S_ALR_87012089 - Display Changes to Vendors.
Regards,
SAPFICO -
PJC Calendar setDate Wrong date format. Date change failed?
Forms 10.1.2 using forms demos pjc code.
The calendar pjc I added to my form works except I can't initialize it with a date. If I try to initialize a date it always produces 'Wrong date format. Date change failed.' error.
In a post-query trigger, I initialize the calendar's date using:
SET_CUSTOM_PROPERTY('PJC.CALENDAR',1,'setDate',to_char(:lead.date_received,'DD.MM.YYYY'));
In the java console, this yields:
Warning: Wrong date format. Date change failed.
Warning: Wrong date format. Date change failed.
I get the same result when using a hardcoded date like:
SET_CUSTOM_PROPERTY('PJC.CALENDAR',1,'setDate','01.12.2006');
What is the flaw in my incantation?Hello,
This is the syntax used in the calendarpjc Forms demo:
call the setDate method on the calendar PJC via the PL/SQL built in
set_custom_item_property
convert Oracle date to String recognised by Java
procedure setDate(d in date) is
begin
set_custom_property(lGlobals.hCalendar,1,'setDate',to_char(d,'Mon DD, YYYY'));
end; Francois -
Hi Gurus,
I am trying to include Event data changes in Process chain and as soon as data load completes want trigger a report with broadcast settings. When i execute process chain, Chain is failing at Event data changes process type with below error.
<i><i>Error log:
Java system error: call FM RSRD_X_PRODUCE_PROXY to ProgId BP1TULAP424_PORTAL_WSH on host BP1TULAP424 with SSO not authorized: Missing Password
Message no. RSBOLAP018
Diagnosis
An error occurred in the BI components on the SAP J2EE Engine.
Procedure
Contact your system administrator to have the error analyzed in detail.
Procedure for System Administration
Start the Visual Administrator, log on to the SAP J2EE Engine and choose "<J2EE_SID>" ->"Server" -> "Services" -> "Log Viewer".
The file "defaultTrace.trc" includes detailed information about the error that occurred. In Windows, you can find this file in the Log Viewer under "Cluster <computer name>" -> "Server <server number>" -> "<drive>:\usr\sap\<SID>\JC<INSTANCE>\j2ee\cluster\server<NUMBER>\log". ". In Unix, the file is located under "/usr/sap/<SID>/JC<INSTANCE>/j2ee/cluster/server<NUMBER>/log".
If the file does not include enough detail about the error, you can increase the log level to obtain more information. To do this, choose "<J2EE_SID>" -> "Server" -> "Services" -> "Log Configurator". On the "Locations" tab page, choose "com" -> "sap" -> "ip" -> "bi" -> "webapplications". Using the selection list on the right side of the screen, you can increase the log level, whereby "DEBUG" represents the log level with the most information. You can save your settings by choosing the "Save" icon. The change to the log level is active immediately. Once you have successfully analyzed the error, you should set the log level back to its default value using the appropriate pushbutton; continuous writing to the log file negatively affects the overall performance of the system.</i></i>
Am i missing some step, i already have Help SAP link, But all steps defined in the process are configured already. Any help greatly appreciated.
Best Regards,
Reddy.Hi,
Have you checked the authorization for scheduling the broadcaster??
Check the below authorization object ..
S_RS_BCS :
(RS_OBJTYPE )ObjectType: Query/Template/Workbook
(RS_OBJID )ObjectID : QueryID/TemplateID/WorkbookID
(RS_EVTYPE)EventType : DataChange or Timepoint
(RS_EVID )EventID : Infoprovider or Timepoint name
are you sending anyworkbook through broadcaster? if so, you have to install precalculation server..
Regards,
Siva. -
HR ABAP : Track Master Data changes for multiple countries
Hi experts,
I am in a Global HR Implementation & Rollout Project. We are creating Outbound Interfaces for 3 countries to export pay, time and general data to the 3rd party systems in those local countries. (Payroll is outsourced there).
As well as sending New Joiners data every month, we need to send Changers data also to all those 3rd partys every month before the Payroll runs.
I know 2 solution for this :
a). Using Change Documents - Tcode : SCDO ..etc
b). Using the report RPUAUD00.
c). Using RBDMIDOC.
Query :
1). Are these the only solutions ?
2). Whats the best solution for doing this for a Global Rollout project ? I need to track master data change for different countries for different set of Infotypes and fields. I need to send those Changers data as well as the New Joiners data through the Outbound Interface to all the local countries.
This year we are doing for 3 countires, next year for 9 more countries, etc. Whats the best solution keeping this in mind ?
Restrictions :
1). Our Client HRs dont want us to disturb the report RPUAUD00 as they use that regularlly and want the flexibility to configure the configs themselves.
2). If I must need to create and activate Change Documents for ALL individual fields, is there an easy way of doing this ?
3). I need to send this Changers data from SAP to Legacy system, so dont know if RBDMIDOC will be a good solution for this. Any comments ?
Just want the best possible and feasible solution for this issue.
I will be please to allot point to anyone who gives a good solution.
Moreover will be Thankfull also !!
Cheers.I have used PU12 for same purpose at a similar client. It will fulfill all your needs I guess, but the learning curve is big. Search for "Interface Toolbox" or "PU12". Basically your search will end-up in these two links:
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAXX/PYSOME_INTERFACE.pdf
HR Interface Toolbox - PU12 -
hi experts
i'm tring to detect the data change in the JTable. The java.sun.com
gives one ex on this using "TableModelListener". but the program is
giving errors on using that. I want to detect the data changes
and also to save the data in its new form. how can i do it??
Also, if ur having a large table data and the user changes only one cell , do i have to write the whole table back to the database ???
Ashishhere is the code. if i write "implements TableModelListener" then
an error occurs
import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class TableDisplay extends JFrame implements TableModelListener{
private Connection connection;
private JTable table;
public TableDisplay()
//using JDBC to connect to a Microsoft ODBC database.
String url = "jdbc:odbc:trial";
String username = "ashish";
String password = "ashish";
// Load the driver to allow connection to the database
try {
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
connection = DriverManager.getConnection(
url, username, password );
catch ( ClassNotFoundException cnfex ) {
System.err.println(
"Failed to load JDBC/ODBC driver." );
cnfex.printStackTrace();
System.exit( 1 ); // terminate program
catch ( SQLException sqlex ) {
System.err.println( "Unable to connect" );
sqlex.printStackTrace();
getTable();
setSize( 500, 350 );
show();
private void getTable()
Statement statement;
ResultSet resultSet;
try {
String query = "SELECT * FROM shippers";
statement = connection.createStatement();
resultSet = statement.executeQuery( query );
displayResultSet( resultSet );
statement.close();
catch ( SQLException sqlex ) {
sqlex.printStackTrace();
private void displayResultSet( ResultSet rs )
throws SQLException
// position to first record
boolean moreRecords = rs.next();
// If there are no records, display a message
if ( ! moreRecords ) {
JOptionPane.showMessageDialog( this,
"ResultSet contained no records" );
setTitle( "No records to display" );
return;
Vector columnHeads = new Vector();
Vector rows = new Vector();
try {
// get column heads
ResultSetMetaData rsmd = rs.getMetaData();
for ( int i = 1; i <= rsmd.getColumnCount(); ++i )
columnHeads.addElement( rsmd.getColumnName( i ) );
// get row data
do {
rows.addElement( getNextRow( rs, rsmd ) );
} while ( rs.next() );
// display table with ResultSet contents
table = new JTable( rows, columnHeads );
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane scroller = new JScrollPane( table );
getContentPane().add(
scroller, BorderLayout.CENTER );
validate();
catch ( SQLException sqlex ) {
sqlex.printStackTrace();
private Vector getNextRow( ResultSet rs,
ResultSetMetaData rsmd )
throws SQLException
Vector currentRow = new Vector();
for ( int i = 1; i <= rsmd.getColumnCount(); ++i )
/* switch( rsmd.getColumnType( i ) ) {
case Types.VARCHAR:
currentRow.addElement( rs.getString( i ) );
break;
case Types.INTEGER:
currentRow.addElement(
new Long( rs.getLong( i ) ) );
break;
default:
System.out.println( "Type was: " +
rsmd.getColumnTypeName( i ) );
currentRow.addElement( rs.getString( i ) );
return currentRow;
public void shutDown()
try {
connection.close();
catch ( SQLException sqlex ) {
System.err.println( "Unable to disconnect" );
sqlex.printStackTrace();
public static void main( String args[] )
final TableDisplay app = new TableDisplay();
app.addWindowListener(
new WindowAdapter() {
public void windowClosing( WindowEvent e )
app.shutDown();
System.exit( 0 );
Maybe you are looking for
-
I am locked out of IMAP for want of a password and I don't know what password is required.
I had an unauthorized attempt to login to my Gmail account which was blocked. Gmail wanted me to change my Google password, which I did. Gmail now works fine, but Thunderbird now asks for: "Enter your password for -- [email protected]@imap.gmail.com:
-
Basic questions regarding installing Forefront EP Client 2010 on Windows 2012 R2
Hi, We have a handful of servers and client machines (although these always seem to be expanding) and as such have previously just installed the Forefront Endpoint 2010 Client manually onto the various endpoints with updates being pushed via WSUS fro
-
Is there a way to restore deleted voice overs in iMovie 11?
I recorded something through iMovie 11 once and then accidentally deleted it. It's no longer in my project. Is there a way to somehow retrieve this audio file? Does a voice over file even exist on the mac, or does it only exist on the project screen,
-
New Service tax mapping effective from April 2011
HI Experts, Service tax rule has changed wef from 1st April, 2011 on foreign exchange related transactions. The Notification No 26/2011 Below given are the slabs for calculating the new service tax Gross amount of currency exchanged % of service tax
-
Listview for new sheets and tables in numbers 3.0
Hi there, when adding a new sheet or table in numbers 3.0 you get them in a horizontal bar under the symbol-bar. If you need severals sheets it directly get confusing. In numbers 09 numbers used to add new sheets in a list view on the left side of th