Adding 2 more rows to a select without inserting rows to base table
hello all,
i have a below simple select statement which is querying a table.
select * from STUDY_SCHED_INTERVAL_TEMP
where STUDY_KEY = 1063;
but here is the situations. As you can see its returning 7 rows. But i need to add
2 more rows..with everything else default value or what exist... except adding 2 more rows.
i cannot insert into base table. I want my end results to increment by 2 days in
measurement_date_Taken to 01-apr-09....so basically measurement_date_taken should
end at study_end_Date...
IS THAT EVEN POSSIBLE WITHOUT INSERTING ROWS INTO THE TABLE AND JUST PLAYIHY AROUND WITH
THE SELECT STATEMENT??
sorry if this is confusing...i am on 10.2.0.3
Edited by: S2K on Aug 13, 2009 2:19 PM
Well, I'm not sure if this query looks as good as my lawn, but seems to work anyway ;)
I've used the 'simplified version', but the principle should work for your table to, S2K.
As Frank already pointed out (and I stumbled upon it while clunging): you just select your already existing rows and union them with the 'missing records', you calculate the number of days you're 'missing' based on the study_end_date:
MHO%xe> alter session set nls_date_language='AMERICAN';
Sessie is gewijzigd.
Verstreken: 00:00:00.01
MHO%xe> with t as ( -- generating your data here, simplified by me due to cat and lawn
2 select 1063 study_key
3 , to_date('01-MAR-09', 'dd-mon-rr') phase_start_date
4 , to_date('02-MAR-09', 'dd-mon-rr') measurement_date_taken
5 , to_date('01-APR-09', 'dd-mon-rr') study_end_date
6 from dual union all
7 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('04-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
8 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('09-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
9 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('14-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
10 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('19-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
11 select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('23-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
12 select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('30-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual
13 ) -- actual query:
14 select study_key
15 , phase_start_date
16 , measurement_date_taken
17 , study_end_date
18 from t
19 union all
20 select study_key
21 , phase_start_date
22 , measurement_date_taken + level -- or rownum
23 , study_end_date
24 from ( select study_key
25 , phase_start_date
26 , measurement_date_taken
27 , study_end_date
28 , add_up
29 from (
30 select study_key
31 , phase_start_date
32 , measurement_date_taken
33 , study_end_date
34 , study_end_date - max(measurement_date_taken) over (partition by study_key
35 order by measurement_date_taken ) add_up
36 , lead(measurement_date_taken) over (partition by study_key
37 order by measurement_date_taken ) last_rec
38 from t
39 )
40 where last_rec is null
41 )
42 where rownum <= add_up
43 connect by level <= add_up;
STUDY_KEY PHASE_START_DATE MEASUREMENT_DATE_TA STUDY_END_DATE
1063 01-03-2009 00:00:00 02-03-2009 00:00:00 01-04-2009 00:00:00
1063 03-03-2009 00:00:00 04-03-2009 00:00:00 01-04-2009 00:00:00
1063 03-03-2009 00:00:00 09-03-2009 00:00:00 01-04-2009 00:00:00
1063 03-03-2009 00:00:00 14-03-2009 00:00:00 01-04-2009 00:00:00
1063 03-03-2009 00:00:00 19-03-2009 00:00:00 01-04-2009 00:00:00
1063 22-03-2009 00:00:00 23-03-2009 00:00:00 01-04-2009 00:00:00
1063 22-03-2009 00:00:00 30-03-2009 00:00:00 01-04-2009 00:00:00
1063 22-03-2009 00:00:00 31-03-2009 00:00:00 01-04-2009 00:00:00
1063 22-03-2009 00:00:00 01-04-2009 00:00:00 01-04-2009 00:00:00
9 rijen zijn geselecteerd.If there's a simpler way (in SQL), I hope others will join and share their example/ideas/thoughts.
I have a feeling that this is using more resources than needed.
But I've got to cut the daisies first now, they interfere my 'lawn-green-ess' ;)
Similar Messages
-
Dear All,
I have created a materialized view which refreshes on commit.materialized view is enabled query rewrite.I have created a materialized view log on the base table also While inserting into the base table it takes lot of time................Can u please tell me why?Dear Rahul,
Here is my materialized view..........
create materialized view mv_test on prebuilt table refresh force on commit
enable query rewrite as
SELECT P.PID,
SUM(HH_REGD) AS HH_REGD,
SUM(INPRO_WORKS) AS INPRO_WORKS,
SUM(COMP_WORKS) AS COMP_WORKS,
SUM(SKILL_WAGE) AS SKILL_WAGE,
SUM(UN_SKILL_WAGE) AS UN_SKILL_WAGE,
SUM(WAGE_ADVANCE) AS WAGE_ADVANCE,
SUM(MAT_AMT) AS MAT_AMT,
SUM(DAYS) AS DAYS,
P.INYYYYMM,P.FIN_YEAR
FROM PROG_MONTHLY P
WHERE SUBSTR(PID,5,2)<>'PP'
GROUP BY PID,P.INYYYYMM,P.FIN_YEAR;
Please help me if query enable rewrite does any performance degradation......
Thanks & Regards
Kris -
Different row count for select versus insert in XML query
Hi,
I encounter a situation where a SELECT * returns a different rows count than an INSERT INTO... (SELECT *) by xmltable join. This makes no sense at all!!!
In breif, I tried to convert xml data into traditional relational tables. I wrote an xml query to select data from xmltable... I checked row count. When I used "create table as select" that was the same query above, I got correct row count. However when I used "insert into select" that was the same query above, I got the wrong info in the table I just inserted.
Does any one have any idea what caused this issue? Thanks for your help.DUPLICATE post
count of rows in a schema tables -
Directory being added two times in JTable rows.(JTable Incorrect add. Rows)
hi,
I have a problem, The scenario is that when I click any folder that is in my JTable's row, the table is update by removing all the rows and showing only the contents of my selected folder. If my selected folder contains sub-folders it is some how showing that sub-folder two time and if there are files too that are shown correctly. e.g. If I have a parent folder FG1 and inside that folder I have one more folder FG12 and two .java files then when I click on FG1 my table should show FG12 and two .java files in separate rows, right now it is showing me the contents of FG1 folder but some how FG12 is shown on two rows i.e. first row shows FG12 second row shows FG12 third row shows my .java file and fourth row shows my .java fil. FG12 should be shown only one time. The code is attached. The methods to look are upDateTabel(...) and clearTableData(....), after clearing all my rows then I proceed on adding my data to the Jtable and inserting rows. May be addRow(... method of DefaultTableModel is called two times if it is a directory I don't know why. Please see the code below what I am doing wrong and how to fix it. Any help is appreciated.
Thanks
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.table.*;
import javax.swing.border.*;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
public class SimpleTable extends JPanel {
/** Formats the date */
protected SimpleDateFormat formatter;
/** two-dimensional array to hold the information for each column */
protected Object data[][];
/** variable to hold the date and time in a raw form for the directory*/
protected long dateDirectory;
/** holds the readable form converted date for the directories*/
protected String dirDate;
/** holds the readable form converted date for the files*/
protected String fileDate;
/** variable to hold the date and time in a raw form for the file*/
protected long dateFile;
/** holds the length of the file in bytes */
protected long totalLen;
/** convert the length to the wrapper class */
protected Long longe;
/** Vector to hold the sub directories */
protected Vector subDir;
/** holds the name of the selected directory */
protected String dirNameHold;
/** converting vector to an Array and store the values in this */
protected File directoryArray[];
/** hashtable to store the key-value pair */
protected static Hashtable hashTable = new Hashtable();
/** refer to the TableModel that is the default*/
protected DefaultTableModel model;
/** stores the path of the selected file */
protected static String fullPath;
/** stores the currently selected file */
protected static File selectedFilename;
/** stores the extension of the selected file */
protected static String extension;
/** holds the names of the columns */
protected final String columnNames[] = {"Name", "Size", "Type", "Modified"};
* Default constructor
* @param File the list of files and directories to be shown in the JTable.
public SimpleTable(File directoryArray[])
this.setLayout(new BorderLayout());
this.setBorder( BorderFactory.createEmptyBorder( 0, 0, 0, 0 ) );
(SimpleTable.hashTable).clear();
data = new Object[this.getRowTotal(directoryArray)][this.getColumnTotal()];
formatter = new SimpleDateFormat("mm/dd/yyyy hh:mm aaa");
//this shows the data in the JTable i.e. the primary directory stuff.
for(int k = 0; k < directoryArray.length; k++)
if(directoryArray[k].isDirectory())
data[k][0] = directoryArray[k].getName();
data[k][2] = "File Folder";
dateDirectory = directoryArray[k].lastModified();
dirDate = formatter.format(new java.util.Date(dateDirectory));
data[k][3] = dirDate;
(SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);
else if(directoryArray[k].isFile())
data[k][0] = directoryArray[k].getName();
totalLen = directoryArray[k].length();
longe = new Long(totalLen);
data[k][1] = longe + " Bytes";
dateFile = directoryArray[k].lastModified();
fileDate = formatter.format(new java.util.Date(dateFile));
data[k][3] = fileDate;
(SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);
model = new DefaultTableModel();
model.addTableModelListener( new TableModelListener(){
public void tableChanged( javax.swing.event.TableModelEvent e )
final JTable table = new JTable(model);
table.getTableHeader().setReorderingAllowed(false);
table.setRowSelectionAllowed(false);
table.setBorder( BorderFactory.createEmptyBorder( 0, 0, 0, 0 ) );
table.setShowHorizontalLines(false);
table.setShowVerticalLines(false);
table.addMouseListener(new MouseAdapter()
public void mouseReleased(MouseEvent e)
//TBD:- needs to handle the doubleClick of the mouse.
System.out.println("The clicked component is " + table.rowAtPoint(e.getPoint()) + "AND the number of clicks is " + e.getClickCount());
if(e.getClickCount() >= 2 &&
(table.getSelectedColumn() == 0) &&
((table.getColumnName(0)).equals(columnNames[0])))
System.out.println("The clicked component is " + table.rowAtPoint(e.getPoint()) + "AND the number of clicks is " + e.getClickCount());
upDateTable(table);
upDateTable(table);
/** set the columns */
for(int c = 0; c < columnNames.length; c++)
model.addColumn(columnNames[c]);
/** set the rows */
for(int r = 0; r < data.length; r++)
model.addRow(data[r]);
//this sets the tool-tip on the headers.
DefaultTableCellRenderer D_headerRenderer = (DefaultTableCellRenderer ) table.getTableHeader().getDefaultRenderer();
table.getColumnModel().getColumn(0).setHeaderRenderer(D_headerRenderer );
((DefaultTableCellRenderer)D_headerRenderer).setToolTipText("File and Folder in the Current Folder");
//Create the scroll pane and add the table to it.
JScrollPane scrollPane = new JScrollPane(table);
//Add the scroll pane to this window.
this.add(scrollPane, BorderLayout.CENTER);
* Returns the number of columns
* @return int number of columns
public int getColumnTotal()
return columnNames.length;
* Returns the number of rows
* @return int number of rows
public int getRowTotal(Object directoryArray[])
return directoryArray.length;
* Update the table according to the selection made if a directory then searches and
* shows the contents of the directory, if a file fills the appropriate fields.
* @param JTable table we are working on
* //TBD: handling of the files.
private void upDateTable(JTable table)
if((table.getSelectedColumn() == 0) && ((table.getColumnName(0)).equals(columnNames[0])))
dirNameHold =(String) table.getValueAt(table.getSelectedRow(),table.getSelectedColumn());
File argument = findPath(dirNameHold);
if(argument.isFile())
CMRDialog.fileNameTextField.setText(argument.getName());
try
fullPath = argument.getCanonicalPath();
selectedFilename = argument.getCanonicalFile();
CMRDialog.filtersComboBox.removeAllItems();
extension = fullPath.substring(fullPath.lastIndexOf('.'));
CMRDialog.filtersComboBox.addItem("( " + extension + " )" + " File");
catch(IOException e)
System.out.println("THE ERROR IS " + e);
return;
else if(argument.isDirectory())
String path = argument.getName();
//find the system dependent file separator
//String fileSeparator = System.getProperty("file.separator");
CMRDialog.driveComboBox.addItem(" " + path);
subDir = Search.subDirs(argument);
/**TBD:- needs a method to convert the vector to an array and return the array */
directoryArray = new File[subDir.size()];
int indexCount = 0;
/** TBD:- This is inefficient way of converting a vector to an array */
Iterator e = subDir.iterator();
while( e.hasNext() )
directoryArray[indexCount] = (File)e.next();
indexCount++;
/** now calls this method and clears the previous data */
clearTableData(table);
(SimpleTable.hashTable).clear();
data = new Object[this.getRowTotal(directoryArray)][this.getColumnTotal()];
formatter = new SimpleDateFormat("mm/dd/yyyy hh:mm aaa");
data = null;
data = new Object[this.getRowTotal(directoryArray)][this.getColumnTotal()];
for(int k = 0; k < directoryArray.length; k++)
if(directoryArray[k].isDirectory())
data[k][0] = directoryArray[k].getName();
data[k][2] = "File Folder";
dateDirectory = directoryArray[k].lastModified();
dirDate = formatter.format(new java.util.Date(dateDirectory));
data[k][3] = dirDate;
(SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);
model.addRow(data[k]);
model.fireTableDataChanged();
else if(directoryArray[k].isFile())
data[k][0] = directoryArray[k].getName();
totalLen = directoryArray[k].length();
longe = new Long(totalLen);
data[k][1] = longe + " Bytes";
dateFile = directoryArray[k].lastModified();
fileDate = formatter.format(new java.util.Date(dateFile));
data[k][3] = fileDate;
(SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]); }
model.addRow(data[k]);
model.fireTableDataChanged();
table.revalidate();
table.validate();
* Searches the Hashtable and returns the path of the folder or the value.
* @param String name of the directory or file.
* @return File full-path of the selected file or directory.
public File findPath(String value)
return (File)((SimpleTable.hashTable).get(value));
* This clears the previous data in the JTable and removes the rows.
* @param JTable table we are updating.
public void clearTableData(JTable table)
for(int row = table.getRowCount() - 1; row >= 0; --row)
model.removeRow(row);
model.fireTableStructureChanged();java gurus any idea how ti fix this problem.
thanks -
Insert master column on table not found in NW CE EHP1
I installed SAP Netweaver CE EHP1 sneak preview. I inserted the table UI element. I am trying to insert a master column in the table. But I was not able to find the option to insert master column from the context menu of the table in NW CE EHP1 sneak preview. I was able to do it with previous versions. I am not sure whether it is a bug on this version. Any help is appreciated.
ThanksGo to Context Menu of the table and select to insert Row arrangement then you see tree by nesting table column.
-
I have both safari and chrome, because I'm used to chrome. The only extension I have is Google docs. I started getting green double underline hyperlinks to ads. How can I get rid of this without adding more junk to the computer? People suggest programs to do it, but how do I know they won't make it worse?
Is someone from Apple here and can answer?
Thanks!You may have installed the "VSearch" trojan. Remove it as follows.
Malware is always changing to get around the defenses against it. These instructions are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
Back up all data before proceeding.
Step 1
From the Safari menu bar, select
Safari ▹ Preferences... ▹ Extensions
Uninstall any extensions you don't know you need, including any that have the word "Spigot," "Trovi," or "Conduit" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
Reset the home page and default search engine in all the browsers, if it was changed.
Step 2
Triple-click anywhere in the line below on this page to select it:
/Library/LaunchAgents/com.vsearch.agent.plist
Right-click or control-click the line and select
Services ▹ Reveal in Finder (or just Reveal)
from the contextual menu.* A folder should open with an item named "com.vsearch.agent.plist" selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
Repeat with each of these lines:
/Library/LaunchDaemons/com.vsearch.daemon.plist
/Library/LaunchDaemons/com.vsearch.helper.plist
Restart the computer and empty the Trash. Then delete the following items in the same way:
/Library/Application Support/VSearch
/System/Library/Frameworks/VSearch.framework
~/Library/Internet Plug-Ins/ConduitNPAPIPlugin.plugin
Some of these items may be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
The problem may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow.
You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that the Internet criminal behind VSearch has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing has not done so, even though it's aware of the problem. This failure of oversight has compromised both Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
*If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select
Go ▹ Go to Folder...
from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return. -
Insert rows without care about constrains..
Is this possible to insert rows without care about constrains??
This is important for me, because I try to add data to my tables and during the import console give me an error:
ORA-02291: integrity constraint (ADMIN.FK_LNE_FLOR) violated - parent key not foundAs stated earlier in the thread the constraints exist for a reason. That reason is to protect the integrity of the data.
When you disable the constraints you disable them for all DML activity that takes place until you re-enable them. When you go to re-enable the constraints you will get an error if all violations are not fixed by the end of your processing prior to the enable.
You can tell Oracle to not validate the constraints and put them back anyway however in this case that would mean you have bad data in your tables (rows with column values missing the FK parent value, etc...) Having bad data will result in returning bad results in some of your queries which in turn isn't going to help your application any.
Disabling constraints can be useful as part of maintenance activity and re-enabling them without validation can save a lot of time such as when several columns are added to a table and populated making the row size greatly increase. If this resulted in a lot of migrated rows you might exp/trunc/imp. This would require disableing the FK. Re-validating the FK would take time but you know that all the data is still there so re-validation is not really necessary. This feature is not intended for every day use.
HTH -- Mark D Powell -- -
Sap.m.Table generating first two blank rows after adding more rows.
Hi everyone,
I am stucked in a very bad condition the problem is with the table rows and columns. I am generating dynamic table columns and rows based on searched unit so whenever i am searching i created a function for initializing the table rows and columns i am looping the array for whatever the size of rows and columns it will display up to 5. My issue is with the request going is adding more times then the required one. So if anyone can check for the solution. Only problem is my data is generated correct but next time i call this method again it is hiding the first 2 rows.
function initializeGrid() {
if (SHOPFLOOR_DCS_UNIT_KEY != null) {
var dcsComboBox = sap.ui.getCore().byId("selectDCSName");
var dcsName = dcsComboBox.getValue();
var viewData = {};
viewData.EntityName = "DataCollectionSetAttribute";
viewData.Condition = [{ColumnName : "DcsName",Value :dcsName}];
viewData.Projection = {AttributeName:true,AttributeType:true,Length:true,Precision:true,LowerLimit:true,
UpperLimit:true,DefaultValue:true };
$
.ajax({
type : "POST",
url : "/demo/xsds/designer/SelectByQueryService.xsjs",
contentType : "application/json",
data : JSON.stringify(viewData),
dataType : "json",
success : function(data) {
/*dcDataTable.unbindItems();
dcDataTable.removeAllItems();
dcDataTable.removeAllColumns();*/
var dcsCols = data;
if (data != null
&& data.length > 0) {
var firstColumn = [{
"AttributeName": "SerialNumber",
"ModifiedAttributeName": "SerialNumber"
for (var index = 0; dcsCols.length > index; index++) {
var currentRow = dcsCols[index];
if (currentRow.AttributeName != null
&& currentRow.LowerLimit != null
&& currentRow.UpperLimit != null) {
dcsCols[index].ModifiedAttributeName = currentRow.AttributeName
+ "["
+ currentRow.LowerLimit
+ " - "
+ currentRow.UpperLimit
+ ","
+ "Def:"
+ currentRow.DefaultValue
+ "]";
firstColumn
.push(dcsCols[index]);
} else if (currentRow.AttributeName != null) {
dcsCols[index].ModifiedAttributeName = currentRow.AttributeName
+ "["
+ "Def:"
+ currentRow.DefaultValue
+ "]";
firstColumn
.push(dcsCols[index]);
if (currentRow.AttributeType != null
&& currentRow.AttributeType == "LocalDate")
dateAttributes[dateAttributes.length] = currentRow.AttributeName;
dcsCols = firstColumn;
runtimeDCS = dcsCols;
console.log("dcsCols", dcsCols);
var viewData = {};
viewData.EntityName = dcsName;
viewData.Cmd="GET";
viewData.UnitKey=SHOPFLOOR_DCS_UNIT_KEY;
$.ajax({
type : "POST",
url : "/demo/xsds/designer/AddOrRemoveDCSDataService.xsjs",
contentType : "application/json",
data : JSON.stringify(viewData),
dataType : "json",
success : function(data) {
console.log("dcsVals"+
JSON.stringify(data)+data.length);
dcDataTable.removeAllColumns();
for (var i = 0; i < data.length; i++) {
for (key in data[i]) {
var textValue = data[i][key];
if (typeof textValue !== "object"
&& typeof textValue === "string"
&& textValue
.indexOf("/Date(") > -1) {
var startIndex = textValue
.indexOf("(");
var endIndex = textValue.indexOf(")");
var tempValue = textValue.substring(startIndex + 1,endIndex);
var tempDate = new Date(parseInt(tempValue));
data[i][key] = tempDate.toDateString();
dcsModel.setData({dcsRows : data});
sap.ui.getCore().setModel(dcsModel);
var columnList = new sap.m.ColumnListItem();
dcDataTable.bindItems({
path: "/dcsRows/",
template: columnList,
for (var i = 0; i < dcsCols.length && i<5; i++) {
dcDataTable.addColumn(new sap.m.Column({
header : new sap.m.Label({
text : dcsCols[i].ModifiedAttributeName
columnList.addCell(new sap.m.Text({
text : {
path : dcsCols[i].AttributeName
clearItems();
},error : function(response) {
console.log("Request Failed==>",response);
if (response.responseText.indexOf('<html>') == -1)
console.log(JSON.stringify(response.responseText));
else
console.log("Invalid Service Name");
},error : function(response) {
console.log("Request Failed==>",response);
if (response.responseText.indexOf('<html>') == -1)
console.log(JSON.stringify(response.responseText));
else
console.log("Invalid Service Name");
else {
console.log("Data not found!!!");No, even with the select box gone the table still doesn't show the last two rows, so this seems indeed be irrelevant to the question.
Best Regards,
S.
***update***
I tried to create a simple case in which the same strange behavior occurs but I can't seem to reproduce it. The table that produces the two blank rows is part of a complex application and I tried to extract enough of it for a simple test case that behaves the same way but I can't manage to do that. I guess that once I have the behavior I will also know what causes it.
It seems that the iterator is set to rangesize 10 but the table rests on rangesize 12, when I looked at other tables in the application it seems that if I want to set the rangesize from 57 to 50, it remains on 57.
Can anyone help me with either this limited info or otherwise instruct me to get more info ?
Best Regards,
S.
Edited by: matdoya on Dec 1, 2008 5:51 AM -
Needs help to retrive the last row in a select query without using rownum
Hi ,
i need to retrive the last row from the select sub query without using rownum.
is there any other way to retrive the last row other than the below query.
is that the ROWNUM=1 will always retrive the 1 row of the select query ?
select from*
*(select ename from employee where dept_id=5 order by desc) where rownum=1;*
Please advise.
thanks for your help advance,
regards,
Senthur957595 wrote:
Actually my problem is ithat while selecting the parents hiearchy of the child data using
CONNECT BY PRIOIR query
I need the immediate parent of my child data.
For example my connect BY query returns
AAA --- ROOT
BBB --PARENT -2
CCC --PARENT-1
DDD IS my input child to the connect by query
Immediate parent of my child data "DDD" ---> CCC(parent -1)
i want the data "CCC" from the select query,for that i am taking the last row of the query with rownum.
I got to hear that using ROWNUM to retrive the data will leads to some problem.It is a like a magic number.I am not sure what the problem will be.
So confusing with using this rownum in my query.
Please advice!!!It's not quite clear what you're wanting, but perhaps this may help?
you can select the PRIOR values to get the parent details if you want...
SQL> ed
Wrote file afiedt.buf
1 select empno, lpad(' ',(level-1)*2,' ')||ename as ename, prior empno as mgr
2 from emp
3 connect by mgr = prior empno
4* start with mgr is null
SQL> /
EMPNO ENAME MGR
7839 KING
7566 JONES 7839
7788 SCOTT 7566
7876 ADAMS 7788
7902 FORD 7566
7369 SMITH 7902
7698 BLAKE 7839
7499 ALLEN 7698
7521 WARD 7698
7654 MARTIN 7698
7844 TURNER 7698
7900 JAMES 7698
7782 CLARK 7839
7934 MILLER 7782
14 rows selected.(ok, not the best of examples as the mgr is already known for a row, but it demonstrates you can select prior data) -
How to select data from 3rd row of Excel to insert into Sql server table using ssis
Hi,
Iam having Excel files with headers in first two rows , i want two skip that two rows and select data from 3rd row to insert into Sql Server table using ssis.3rd row is having column names.CUSTOMER DETAILS
REGION
COL1 COL2 COL3 COL4 COL5 COL6 COL7
COL8 COL9 COL10 COL11
1 XXX yyyy zzzz
2 XXX yyyy zzzzz
3 XXX yyyy zzzzz
4 XXX yyyy zzzzz
First two rows having cells merged and with headings in excel , i want two skip the first two rows and select the data from 3rd row and insert into sql server using ssis
Set range within Excel command as per below
See
http://www.joellipman.com/articles/microsoft/sql-server/ssis/646-ssis-skip-rows-in-excel-source-file.html
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
Is it possible to insert row with timestamp field without to TO_TIMESTAMP
hello
is it possible to insert row with timestamp column without using to_timestamp unction
somthing like insert into app.master values (3,333, 'inser tmstmp', 6.7, '2010-11-10 15:14', 'f','9','2010-12-22')784633 wrote:
hello
is it possible to insert row with timestamp column without using to_timestamp unction
somthing like insert into app.master values (3,333, 'inser tmstmp', 6.7, '2010-11-10 15:14', 'f','9','2010-12-22')If you don't like the answers in your previous thread (Re: how can i set timestamp format don't expect to get different answers just because you start a new thread. -
Select not finding previously inserted row
We are using JDBC through the JDBC-ODBC bridge to an Access database
at the moment. In one EJB method, we insert a row and commit it,
then do a select straight after that. The select does not pick
up the row that has just been inserted. However, if we wait for
say 2 seconds in the same method before trying the select, it finds
the row. Could there be some timing issue involving the commit
Any help much appreciated
Dave
Thx for your reply,
If I understand properly, this method is to somehow narrow your search within the rows contained in the VO. I know which colomn i want the value but how can i filter using a value if the value i should use to filter is the one i am looking for?
I think i have some problem understand the use i should make of this method which really seams simple.
In applications i did before using simple ADF (no OA) i used the following code i know that for OA it is useless but maybe this could help clarify my question!
CoreTable table = this.getTable1();
JUCtrlValueBindingRef data = (JUCtrlValueBindingRef)table.getRowData();
String oracleUsername = data.getRow().getAttribute(17).toString();Thank you for being patient with beginners your devotion is greatly appreciated.
Carl -
I have added more songs to my library. Half of the library has selected ticks but when I click on any of the others to select them, the whole song disappears from the list. Why and what can I do to fix?
Hey Paul,
If I understand correctly, it sounds like iTunes is not grouping the songs from a particular CD together. The cause could be something as minor as a misspelling or slight variations. For more information, see the following resource:
Why aren't songs with the same album art grouped together?
http://support.apple.com/kb/TS1468
Thanks,
Matt M. -
How to get the inserted row primary key with out using select statement
how to return the primary key of inserted row ,with out using select statement
Edited by: 849614 on Apr 4, 2011 6:13 AMyes thanks to all ,who helped me .its working fine
getGeneratedKeys
String hh = "INSERT INTO DIPOFFERTE (DIPOFFERTEID,AUDITUSERIDMODIFIED)VALUES(DIPOFFERTE_SEQ.nextval,?)";
String generatedColumns[] = {"DIPOFFERTEID"};
PreparedStatement preparedStatement = null;
try {
//String gen[] = {"DIPOFFERTEID"};
PreparedStatement pstmt = conn.prepareStatement(hh, generatedColumns);
pstmt.setLong(1, 1);
pstmt.executeUpdate();
ResultSet rs = pstmt.getGeneratedKeys();
rs.next();
// The generated order id
long orderId = rs.getLong(1); -
Using XSQL to insert rows in more then one table
I tried to insert rows in one table and it works fine but does anyone know is it possiblle to insert row in two tables using one XML file.
Alem,
Could u please let me know how u achieved this ? I am using xsql servlet too and would be interested in the same. If u have been able to insert/update into more than one table using insert-request let me too know how u did it.
Thanks in advance,
Shanthi
Maybe you are looking for
-
Bex Query Designer not using default browser
hello all, i have disabled my Internet Explorer from being my default browser, however, when i use the Bex query designer and test, it initiates my Internet Explorer, and not my default Safari browser. does anyone know where this setting is made ? th
-
I want my slide show to work without having to click tomake them move..
i have done powerpoint in Microsoft word and it allows the slides to move without having to click.. does anyone know how to do this?
-
IPad2 connects at home, not at work
OK, this is a strange one. We have several users, both Mac and PC using iPad2's as part of our testing before we make them available for anyone to use. One user is having issues when she tries to sync at work. When she takes her work laptop home and
-
What is the exclusive criteria showing the UDB is in on-line backup mode?
We have a DB: 1) DB13 shows no backup scheduled at all; 2) LOGARCHMETH1 is pointing to a disk 3) DB14 shows there is a backup history (do not know is online OR offline); 4) no cron job for db2sid or sidadm defined at all. How to tell 1) is this DB co
-
Unable to install robohelp plugin for framemaker
Hi, I have FM8 and RoboHelp HTML 9. When I open a new project and try to import a FrameMaker document or book I get the "unable to install robohelp plugin for framemaker" error. I tried with FrmaMaker open and closed - same thing. With RH7 it used to