How to identify new records in a table using OBIEE
Hi,
I have price change table as and when a record comes into this table i have to generate an alert. Then show a report with the price changes on which i can invoke an action to go into my transactional system to make the chnage. And once the change is made the process again starts to look for any new price chnage records that are recieved.
Could anyone pls tell me how to identify new records in a table.
Rgds
SELECT ID, LastName, FirstName,
RANK() OVER (PARTITION BY LastName,
FirstName ORDER BY ID) AS SeqNumber
FROM
(SELECT ID, LastName, FirstName
FROM Customers
WHERE (LastName, FirstName) IN
(SELECT LastName, FirstName
FROM Customers
GROUP BY LastName, FirstName
HAVING COUNT(*) > 1)
Similar Messages
-
How do you insert new records into multiple tables using the same unique primary key?
I’ve created a PHP site and MySQL server using a free app called XAMPP. I have successfully created a form in Dreamweaver that will write data to a (name) table in the SQL database. Here’s my question: How do you write to two (or more) tables in the same database and pass the same primary key to both tables? In the SQL database, I defined the first field as ID and set it as the primary key with auto update. So, when you insert a new record, it creates a unique primary key for that record. In my form, I’m capturing info that needs to be stored to two tables at the same time; a Name table and Address table. Since the Name and Address tables use the ID field as the primary key, I believe I will need to pass the ID value from the Name table to the insert of the Address table to insure they both have the same primary key, right?
No. You probably need the primary key from one table to be a foreign key in the other tables. In any case, I believe you can use two methods to obtain the auto generated key. First with SQL:
http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html
And the other using a PHP function:
http://us3.php.net/mysql_insert_id -
How to insert new record into altered table
I am using JDBC with MySQL. I altered existing table and want to insert new record using java class. But it is not possible.How to do?
How is it "not possible"?
Either modify the Class for the new fields, or give the new fields default values (if applicable). If the type of an existing column has changed, then only the first option is available.
Where's the problem? -
How to insert new record into oracle table from GridView in VS2005.
I need to insert records into Oracle10g table from VS2005 GridView using the Insert Method in Business Logic Class. The Update and Delete Methods are working fine. What's the best way out?
How is it "not possible"?
Either modify the Class for the new fields, or give the new fields default values (if applicable). If the type of an existing column has changed, then only the first option is available.
Where's the problem? -
How to fetch corresponding records from 2 tables using ADF Toplink & EJB
Hi,
I am unable to fetch records from 2 tables, which has a foregin key.Used the custom query in toplink, But the output is the cartition of the first table draged and the first row of the second table.The output required should be in the form of ADF Table. I am able to find the output in JSF data table.
Two tables:
Table name:Solutions
sol_id varchar2(PK)
sol_name varchar2
Table name:Solution_details
sol_id varchar2(FK)
common_asum_id varchar2(PK)
common_detail varchar2
Output Required:
sol_id,sol_name,common_asum_id,common_detail
Custom query:
SELECT * FROM solutions a
,solution_details b
WHERE a.sol_id=b.sol_idHi,
I am unable to fetch records from 2 tables, which has a foregin key.Used the custom query in toplink, But the output is the cartition of the first table draged and the first row of the second table.The output required should be in the form of ADF Table. I am able to find the output in JSF data table.
Two tables:
Table name:Solutions
sol_id varchar2(PK)
sol_name varchar2
Table name:Solution_details
sol_id varchar2(FK)
common_asum_id varchar2(PK)
common_detail varchar2
Output Required:
sol_id,sol_name,common_asum_id,common_detail
Custom query:
SELECT * FROM solutions a
,solution_details b
WHERE a.sol_id=b.sol_id -
How do I retrieve records from a table using JCO RFC Function Call
Hi
I am totally new to SAP Java Progamming. And I would like to know if I am writing code correctly. I read some tutorials in the Internet but I am still not sure if I am doing it the correct way.
This is what my vendor has given me.
My question is whether this is the correct optimum way to do get the customer detail based on an array of input values for the customer reference number.
Input:
I_CUSTNO - Any number customer IDs. This is a table similar to I_CUSTDETL
Output:
Structure name: I_CUSTDETL
Note: The CUSTID column has been added in the structure to identify the address of the relevant customer id
Field details:
Field Name Data Type Length
CUSTID Character 10
COMPANYNAME Character 40
EMAIL Character 40
This is my code:
JCoFunction function = connect.getFunction("Z_GET_CUSTOMER");
JCoTable cust = function.getTableParameterList().getTable("I_CUSTNO");
cust.appendRow();
cust.setValue("CUSTID", "10000700");
cust.appendRow();
cust.setValue("CUSTID", "10000701");
cust.appendRow();
cust.setValue("CUSTID", "10000702");
connect.execute(function);
JCoTable table = function.getTableParameterList().getTable("I_CUSTDETL");
System.out.println("Table size: " + table.getNumRows());
for (int i = 0; i < table.getNumRows(); i++, table.nextRow()) {
String custid= table.getValue("CUSTID").toString();
String companyname = table.getValue("COMPANYNAME").toString();
String email = table.getValue("EMAIL").toString();
System.out.println("----
System.out.println("Record Number::" + i + "::");
System.out.println("----
System.out.println("Value custidis::" + custid+ "::");
System.out.println("Value companyname is::" + companyname + "::");
System.out.println("Value email is::" + email + "::");Hi,
Answer to your question :whether this is the correct optimum way to do get the customer detail based on an array of input values for the customer reference number? is
YES.
Regards,
Ganga -
How to update multiple records in a table using procedure?
Dear All,
1 am using 11.1.2.1.0
my question is i have a table like
emp id(primary key), empname,location
1 damby blore
2 rocky kormangala
3 biswa india
my question is i need to write one procure that at a time i can update empname and location(wat the value are there in empname and location i need to change at a time).
thanks
DambyHi, Damby,
That sounds like what the UPDATE statement does, exactly. Just use an UPDATE statement to change any number of columns in existing rows. You don't need a procedure, but, if you're using a procedure for some other reason, you can do the UPDATE in the procedure. UPDATE works the same in SQL or PL/SQL.
Sometimes MERGE is more convenient than UPDATE. Like UPDATE, it can change any number of columns, either in SQL or PL/SQL.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
Explain, using specific examples, how you get those results from that data.
See the forum FAQ: https://forums.oracle.com/message/9362002 -
How to update multiple records in the table using POST parameters:
i got this idea from this website:http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-s ingle-sql-query/comment-page-1/#comment-5409. Basically i am trying to update all the status in the results page, and by adding $i in front of the id in the text fields, and checkboxes, i can name the different inputs with different names:
The image of how it takes the inputs is shown here:http://forums.adobe.com/thread/709034?tstart=0
I tried this but got this error:Parse error: syntax error, unexpected T_IF, expecting ')' in C:\xampp\htdocs\Database Query\results_change.php on line 51
will not work in the update code section:
for($i=0;$i<$maxRows_Recordset1;$i++)
{$a=sprintf("%s",GetSQLValueString($_POST['changeid $i'],"int"));
$b=sprintf("%s",GetSQLValueString($_POST['checkbox $i'],"text"));
$display_order .= array(
$a => $b
if($i<$maxRows_Recordset1-1)
$ids = implode(',', array_keys($display_order));
$updateSQL = "UPDATE `change` SET Status = CASE Change_id ";
foreach ($display_order as $a => $b) {
$updateSQL .= sprintf("WHEN %d THEN %s ", $a,$b);
$updateSQL .= sprintf("END WHERE `Change_id` IN ($ids)");Hi,
Try
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
UPDATE xx_test
SET checkbox = 'Y'
WHERE rec_no = APEX_APPLICATION.G_F03(i);
END LOOP;
END;Code loops all checked checkbox. You do not need commit on page process.
Regards,
Jari
http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0 -
How to update multiple records in custom table using checkbox in APEX 4.1?
Hi,
I have a SQL report which brings up all the data records using the following query.
select
"REC_NO" AS hidden_rec_no,
"REC_NO",
APEX_ITEM.CHECKBOX (3,rec_no) AS edit,
"MEETING_TYPE",
"PAGE_NO",
"CHECKBOX"
from "XX_TEST" m
WHERE page_no = :p_page_no
Out of all records, any records which are checked, I only want to update their flag to 'Y' on the database column "Checkbox". For this, I have a SUBMIT button on the report region. The processing code on pressing the SUBMIT button is:
DECLARE.
l_row NUMBER := 1;
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F03.COUNT
LOOP
FOR j IN l_row..APEX_APPLICATION.G_F01.COUNT
LOOP
IF APEX_APPLICATION.G_F01(j) = APEX_APPLICATION.G_F03(i) THEN
UPDATE xx_test
SET checkbox = 'Y', -- APEX_APPLICATION.G_F03(j)
WHERE rec_no = APEX_APPLICATION.G_F03(i);
l_row := j + 1;
EXIT;
END IF;
END LOOP;
END LOOP;
COMMIT;
END;
However, that is not happening. Please help me with this. Any solutions/suggestions are most welcome.
Regards.Hi,
Try
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
UPDATE xx_test
SET checkbox = 'Y'
WHERE rec_no = APEX_APPLICATION.G_F03(i);
END LOOP;
END;Code loops all checked checkbox. You do not need commit on page process.
Regards,
Jari
http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0 -
Add a new record in database table without using table maintance generator
Hi Expart ,
Plz. tell me how to add new record in database table without using table maintance ganerator ....give me one ex.
Regards
BhabaniHi,
The other way to safely handle the modification of tables is through is by programs that can be done with SE38 or SE80.
To insert into database table we use INSERT statement :
1. To insert a single line into a database table, use the following:
INSERT INTO <target> VALUES <wa>.
INSERT <target> FROM <wa>.
2. To insert a several lines into a database table, use the following:
INSERT <target> FROM TABLE <itaba>.
Or even we can use MODIFY statementas this single statement is used to insert as well as update the records of database table.
MODIFY <target> FROM <wa>.
or MODIFY <target> FROM TABLE <itab>.
thanx.
Edited by: Dhanashri Pawar on Sep 10, 2008 12:25 PM
Edited by: Dhanashri Pawar on Sep 10, 2008 12:30 PM -
Inserting new records into database table at runtime
Hi all ,
How to insert new records into database table at runtime on click update?
Thanks.Hi Sasikala,
Just for your understanding am giving a sample code snippet which you can use to read the contents of your Table UI element & save the data on to your database. Suppose you have a button up on pressing which you want to read the data from your screens table & save on to the database then you can proceed as shown below:
1) Obtain the reference of your context node.
2) Fetch all the data present in your table into an internal table using methods of if_wd_context_node
3) Use your normal ABAP logic to update the database table with the data from your internal table
In my example I have a node by name SFLIGHT_NODE and under this I have the desired attributes from SFLIGHT. Am displaying these in an editable table & the user would press up on a push button after making the necessary changes to the tables data. I would then need to obtain the tables information & save on to the database.
data: node_sflight type ref to if_wd_context_node,
elem_sflight type ref to if_wd_context_element,
lt_elements type WDR_CONTEXT_ELEMENT_SET,
stru_sflight type if_main=>element_sflight_node,
it_flights type if_main=>elements_sflight_node.
" navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
node_sflight_node = wd_context->get_child_node( name = 'SFLIGHT_NODE' ).
lt_elements = node_sflight->get_elements( ).
" Get all the rows from the table for saving on to the database
loop at lt_elements into elem_sflight.
elem_sflight->get_static_attributes( importing static_attributes = stru_sflight ).
append stru_sflight to it_flights.
endloop.
" Finally save the entries on to the database
modify ZSFLIGHT99 from table it_flights.
if sy-subrc eq 0.
endif.
However a word of caution here.... SAP doesn't ever recommend directly modifying the database through an SQL query. You would preferably make use of a BAPI for the same. Try go through Thomas Jung's comments in [here|modify the data base table which is comming dynamiclly;.
Regards,
Uday -
How to identify missing records in a single-column table?
How to identify missing records in a single-column table ?
Column consists of numbers in a ordered manner but the some numbers are deleted from the table in random manner and need to identify those rows.Something like:
WITH t AS (
SELECT 1 ID FROM DUAL UNION ALL
SELECT 2 ID FROM DUAL UNION ALL
SELECT 3 ID FROM DUAL UNION ALL
SELECT 5 ID FROM DUAL UNION ALL
SELECT 8 ID FROM DUAL UNION ALL
SELECT 10 ID FROM DUAL UNION ALL
SELECT 11 ID FROM DUAL
-- end of on-the-fly data sample
SELECT '[' || (id + 1) || ' - ' || (next_id - 1) || ']' gap
FROM (
SELECT id,
lead(id,1,id + 1) over(order by id) next_id
FROM t
where id != next_id - 1
GAP
[4 - 4]
[6 - 7]
[9 - 9]
SQL> SY.
P.S. I assume sequence lower and upper limits are always present, otherwise query needs a little adjustment. -
Using combination of insert into and select to create a new record in the table
Hello:
I'm trying to write a stored procedure that receives a record locator parameter
and then uses this parameter to locate the record and then copy this record
into the table with a few columns changed.
I'll use a sample to clarify my question a bit further
-- Create New Amendment
function create_amendment(p_mipr_number in mipr.mipr_number%TYPE, p_new_amendment_number in mipr.amendment_number%TYPE)
return integer is
new_mipr_id integer;
begin
THIS is causing me grief See comments after this block of code
insert into mipr
(select mipr_id from mipr where mipr_number=p_mipr_number),
(select fsc from mipr where mipr_number=p_mipr_number),
45,
(select price from mipr where mipr_number=p_mipr_number),
practical,
(select part_number from mipr where mipr_number=p_mipr_number);
THe above will work if I say the following
insert into mipr
(select * from mipr where mipr_number=p_mipr_number);
BUt, Of course this isn't what I want to do... I want to duplicate a record and change about 3 or 4 fields .
How do I use a combination of more than one select and hard coded values to insert a new record into the table.
/** Ignore below this is fine... I just put a snippet of a function in here ** The above insert statement is what I need help with
select (mipr_id) into new_mipr_id from mipr where mipr_number=p_mipr_number + amendment_number=(select max(amendment_number) + 1);
return new_mipr_id;
end;
THANK YOU IN ADVANCE!
KTfunction create_amendment(p_mipr_number in mipr.mipr_number%TYPE)
return integer is
new_mipr_id integer;
tmp_number number;
tmp_mipr_id integer;
begin
tmp_number :=(select max(amendment_number) from mipr where mipr_number=p_mipr_number);
Question:
tmp_number :=1; works..
tmp_number doesn't work with the select statement?
Obviously I'm a novice! I can't find anything in my book regarding tmp variables... What should I look under is tmp_number a
variable or what? In my Oracle book, variable means something different.
Thanks!
KT
I have the following code in my stored procedure:
Good luck,
Eric Kamradt -
How to identify migrated rows on a table
Hi, folks,
I'm wondering how to identify migrated rows on a table.
I understand that ANALYZE generates data into CHAINED_ROWS. The Oracle document implies that this table has both CHAINED ROWS and MIGRATED ROWS. FYI:
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14231/general.htm#sthref1881
But how can I tell migrated rows from chained rows.
Thanks!
Alexim also not looking to ExporttoExcel feature on ADF just copy all the records displayed on a table
im also not looking to ExporttoExcel feature on ADF just copy all the records displayed on a table ,
Hi you can set the property( exportedRows) of exportListener
you can limit the number of rows to download
chekout documentaion
ADF RichClient API - af:exportCollectionActionListener -
How can i fetch records from 3 tables in a single query without using join
Hi.
Can any body please tell me <b>How can i fetch records from 3 tables with a single query without using joins</b>
Thanx
prabhuduttaHi Prabgudutta,
We can fetch the data by using the views concept.
Go throuth this info we can know the how to create view and same like database table only we can fetch the data.
Views conatin the data at runtime only.
Four different view types are supported. These differ in the
way in which the view is implemented and in the methods
permitted for accessing the view data.
Database views are implemented with an equivalent view on
the database.
Projection views are used to hide fields of a table (only
projection).
Help views can be used as selection method in search helps.
Maintenance views permit you to maintain the data
distributed
on several tables for one application object at one time.
step by step creation of Maintenance view:
With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.
It can be set in transaction SE11 - Tools - Table maintenance generator.
Table maintanance Generator is used to manually input values using transaction sm30
follow below steps
1) go to se11 check table maintanance check box under attributes tab
2) utilities-table maintanance Generator-> create function group and assign it under
function group input box. Also assign authorization group default &NC& .
3) select standard recording routine radio in table table mainitainence generator to move table
contents to quality and production by assigning it to request.
4) select maintaience type as single step.
5) maintainence screen as system generated numbers this dialog box appears when you click on create button
6) save and activate table
One step, two step in Table Maintenance Generator
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
SM30 is used for table maintenance(addition or deletion of records),
For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30
Sm30 is used to maintain the table ,i.e to delete ,insert or modify the field values and all..
It creates the maintenance screen for u for the aprticular table as the maintenance is not allowed for the table..
In the SE11 delivery and maintenance tab, keep the maintenance allowed..
Then come to the SM30 and then enter the table name and press maintain..,
Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..
Then create,,,
Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...
We use SM30 transaction for entering values into any DB table.
First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.
Then it will create a View.
After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.
Hope this resolves your query.
Reward all the helpful answers.
Rgds,
P.Naganjana Reddy
Maybe you are looking for
-
Multiple sets of radio buttons no longer working
Hello All: My first post so I apologize in advance if I don't do it properly. I have a few web forms that have multiple groups of radio buttons on them that are suddenly errorring out since we moved to CF 7. I started tinkering with the one form that
-
Can't change tray/paper size when printing photos
I'm using an HP Photosmart C5200 and I want to print onto 4x6 photo paper, but I can't seem to change from the default tray with 8.5x11 paper. I've played around in the print dialogue box and File>Page Setup but to no avail.
-
Create repeating elements in xml document
Good day, I have a problem with a project I am busy with. I am creating an XML document from a predefined schema. I am able to this with no problem for one level using this method: XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); XmlSerial
-
I have downloaded music videos on my ipad2 they play on it. But they will not play in iTunes on my Mac or pc. The first 10 seconds or so plays, but then video goes black and the bar keeps moving?
-
I enjoyed the Bulletin Board on my Satellite L500 and used all the features; it's great, you can drag gadgets and personalize, I used the To Do list daily. I scheduled it to open on logon and it did. I removed the scheduled task when I found that it