Ability to query on all columns from a view with multiple tables
I have view with 4 tables. view has about 50 columns.
hypothetically, I want to build a form to give the user an ability to query on any of those 50 columns. user can search on one or more fields.
what is the best way to write the query to retrieve the results without performance impact.
please let me know if the question is not clear.
If you want to permit them to query any of 10 fields with no restrictions, you could create 10 separate single-column indexes. The optimizer would have to try to pick the best of these indexes if you specified multiple search criteria. But since you have a view which presumably means that you've got multiple other indexes involved for the underlying join conditions, you'd probably want/need to combine the column lists of the indexes you're adding for searches with the indexes you've created for joins, which requires looking at the text of the view and figuring out the best way to optimize the 10 single-column searches. Of course, it is possible that the optimizer could chose to do something like a b-tree to bitmap conversion on multiple indexes which could allow it to use multiple independent indexes for your queries, but that's generally not ideal performance-wise.
All this is a fancy way of saying that there probably isn't a cut and dried answer to your question. You need to figure out the queries you're trying to optimize (say, the 10 single-condition queries) and you need to figure out what set of indexes on the various underlying tables provides the best performance weighing those benefits against the cost on other side of maintenance during DML. Which is going to depend on the text of the view, the underlying tables, the existing indexes, etc.
Justin
Similar Messages
-
How to insert records in database from a dataset with multiple tables
Hi,
I'm struggling with the following problem:
I have saved a dataset to an XML file by executing the following statement:
ds.WriteXml( "Export\\ModuleChain_Mdata.xml" );The dataset, ds, includes records from several tables.
Is there an easy way to retrieve those records to the database, I.E inserting them again?
regards Peteryou can try Associative Arrays:
http://www.oracle.com/technology/oramag/oracle/07-jan/o17odp.html
you need to convert yore DataTables to array first and than pass them in to the associative array procedure. -
DB Adapter not returning all columns from a sql table type
Using Soa Suite 10.1.3.4.
Calling DB Adapter from bpel to a database package procedure with an OUT NOCOPY parameter based on a TABLE OF type.
It works fine except that I only get the first 14 columns out of 55.
Can query all columns from Sqldeveloper or Sqlplus.
XML skema reflects all columns correct.
Same result without NOCOPY in parameter.
HaveI missed some details/limitations?hi
here is how I solved it.
first create custom view that will find all requred data.
in my case it was
tables :
ADRCITYT
ADRCITY
ADRPCDCITY
T005S
T005U
joins :
ADRCITY CLIENT = ADRCITYT CLIENT
ADRCITY COUNTRY = ADRCITYT COUNTRY
ADRCITY CITY_CODE = ADRCITYT CITY_CODE
ADRCITY CLIENT = ADRPCDCITY CLIENT
ADRCITY COUNTRY = ADRPCDCITY COUNTRY
ADRCITY CITY_CODE = ADRPCDCITY CITY_CODE
T005S MANDT = ADRCITY CLIENT
T005S BLAND = ADRCITY REGION
T005S MANDT = T005U MANDT
T005S LAND1 = T005U LAND1
T005S BLAND = T005U BLAND
and finaly searh help
ORT01 3 3 PAD_ORT01
CITY_CODE 0 2 CITY_CODE
PSTLZ 1 1 PSTLZ_HR
STATE 4 4 REGIO
BEZEI 5 5 BEZEI20
COUNTRY 0 6 LAND1
LANGU 0 7 LANGU -
Unable to export all columns from sharepoint 2010 survey
Have a user that cannot export all columns from a sharepoint survey. When exported, he only gets 3 columns. We've tried a number of things, including exporting from the overview view. We've also made sure that readers had full edit rights, etc. Just for
background, this survey does contain branching logic. Any ideas?I have had
exactly the same problem before.
There's already a ton of suggestions on these blogs, and I suspect there is a bug somewhere.
As I'm lucky to have Reporting Services in SharePoint mode, I've been using it to export Survey data, pre-process it, and export it to Excel or PDF. -
Issue in loading specific columns from a file to teradata table using IKM
Hi,
Can any one help to resolve the issue in loading specific columns from text file to teradata table.
i tried using IKM file teradata and columns are getting displaced.
my requirement suppose i have 5 columns in file and i have to load only 3columns to table using IKM.
same thing can be achived using LKM file to teradata but i want use IKM.
please suggest me on this
Regards
VinodHi,
I believe that the problem you are having is that you have a delimited file, of which you want to pick columns from position 2,3,5. In this case, ODI will pick the first 3 columns of a delimited file regardless of position.
For example, if you a tab delimited file with c1,c2,c3,c4,c5 columns, and you want only columns c2,c3,c5 - when mapping these in an ODI interface, and executing, you will actually pick up the data from c1,c2,c3 as these are the first three columns in the file (reading from left to right). You can ignore "columns" on the right hand side of a file, but not the left. E.g delimited file with c1,c2,c3,c4,c5. Only pick columns c1,c2 will give you data for the first 2 columns
Create a temporary table to load all the data from the file, and use you temp table to extract the data you require. Or you could get the file created with the first three columns as the columns you require.
Cheers
Bos
Edited by: Bos on Jan 18, 2011 1:06 PM -
How to get string (specified by line and column) from txt file with labview
Hi everyone
How to get string (specified by line and column) from txt file with labview
thx
Solved!
Go to Solution.As far as I know, a text file has no columns. Please be more specific. Do you mean something like the 5th word on line 4, where words are separated by a space, and lines are separated by a newline character? You could the Read from Spreadsheet String function and set the delimiter to a space. This will produce a 2D array of strings. Then use index array and give the line number and column number.
- tbob
Inventor of the WORM Global -
Write Back from OBIEE 11g to multiple tables in DB
Hi All,
We have requirement to write-back from OBIEE 11g to multiple tables in DB.
1) Inserting a new row in report. Inserting record into multiple tables through OBIEE?
2) In report we have fields like Region Id, Product Id, Date, Quantity. Region Id, Product Id, Date are dimension fields and Quantity is Fact measure while inserting row in report does OBIEE checks Refrential Integrity Constraint during Write Back on DB.
Let me know if you need more details on this. Thanks in Advance.
Regards,
Rajkumar.Hi,
1) With regard to inserts into multiple tables, try using multiple insert tags (I haven't tried it) but I think it should work.
2) I don't think OBIEE would check referential integrity , but DB would and give you appropriate response.
Let us know how you got on...
Thanks & Regards -
BaseTableName blank when calling GetSchema on a query with multiple tables
I am using ODP.NET 11.2.0.3.0 and when calling GetSchemaTable on a DataReader that contains a join the returned SchemaTable has the BaseTableName and BaseColumnName fields blank - this is different than what I see with the Oracle OLE DB Provider and with how SQL Server's native provider works. I can't find any discussion of this - is this on purpose or is it a bug? why does the available schema information vary so drastically between a single table query and a query with multiple tables joined?
Thanks,
Bryan HintonHi Bryan,
I am also facing the same issue. Did u find any work around or any suggestions will be well appreciated.
Thanks,
Naresh. -
Cannot export all columns from ALV
Hi ,
I copied a standard report into a custom report and added few columns to it.
Now my issue is the alv ouput doesnot have any direct export button on it , so we are using the menu option LIST --> Spreadsheet, to export the report in to excel sheet. now the problem is all the columns from the alv are not getting download to excel , i thing it depends upon the layout setting but not sure. i even removed the layout setting and checked but still not all the columns are getting downloaded.
Please help me on this...
Thanks
Fardeedone
-
How to compare all columns in a SELECT with all columns in a Cursor ?
Hi All,
I would like to know if something like this is possible in PL/SQL
I have a cursor CUR1 which is a SELECT * FROM T1.
And in my loop for every record found in CUR1 I am trying to retrieve its consecutive record in the table T2. Unfortunately T1 and T2 do not have a primary key so there are duplicates. But if I can compare each column of CUR1 with its respective column in T2, I can find the record. But the question is how ?
So I tried something like this, but of course this is wrong, but hope this would give you an idea of what I trying
VAR_T2 T2%ROWTYPE;
CUR_T1 IS SELECT * FROM T1
LOOP CUR_TI
SELECT * INTO VAR_T2
FROM T2 WHERE
‘ALL COLUMNS OF T2’ = ALL COLUMNS OF CUR1;
So is there a easy way to accomplish this. Thank you, AJAs Walter says, this is simply an intersect if you are comparing all the columns.
However, if you really must do it in a slow by slow, PL/SQL loop (no real valid reason why you would though)...
DECLARE
VAR_T2 T2%ROWTYPE;
CUR_T1 IS
SELECT * FROM T1;
BEGIN
FOR i IN CUR_TI
LOOP
SELECT * INTO VAR_T2
FROM T2
WHERE T2.col1 = i.col1
AND T2.col2 = i.col2
AND T2.col3 = i.col3
AND T2.colN = i.colN;
END LOOP;
END;There is no simple mechanism for just saying "compare all the columns", you will have to specify each one individually in the WHERE clause. -
Hiding a column from materialized view
Hello All,
I have created a materialized view which aggregates the monthly wise data, as we know, for refresh on commit of this view i have selected count(*) and count(col).
My problem is i don't want these columns to appear in the materialized view.
regardsIf you include the columns in the select statement that generates the materialized view they will be visible. So your choices are:
(1) don't include them in the query
(2) overley the materialized view with a plain view.
Apparently you don't like option 2, which leaves option 1. I must confess I don't understand your original post, so maybe you could explain in more depth why you have these columns you don't want. There may be some other way of achieving your aim.
Cheers, APC -
Extract Data from a View into multiple columns
fairly new sql person here, I have a question on extracting data from a View that I have created and formatting it in a way that the user needs.
My View has the following columns:
Account
Department
Budget
Spent
Values would be such as:
Account Department Budget Spent
1 A 1.00 1.00
1 B 2.50 1.45
1 C 3.00 4.00
2 A 4.00 1.00
2 B 2.00 1.00
What I'm wanting to do is extract the data out in the following format:
<dept> <account> 1 <account> 2
<budget> <spent> <budget> <spent>
A 1.00 1.00 4.00 1.00
B 2.50 1.45 2.00 1.00
C 3.00 4.00
basically dept as a column and then separate columns for each accounts budget and spent values going across
thanks!Search for pivot queries in this forum.
However, you need to have finite number of accounts in Account column, otherwise output will be, i must say, non-readable and the query to be written would be unrealistic. -
SQL* Loader Loading specific column from CSV file to the table
Dear All,
Iam Loading specific column from .CSV file to the oracle table.
Could pls help how i can load only that cols into the table
Eg: CSV file having id, Frst_name,Last_name, Address,Phone,Insurance etc
out of this I want to load only Frst_name,Last_name columns to oracle table say fname and lname.
Thanks in Adv.
JunuLily,
I made some changes to your table def but you will get the idea
-- Table EMPLOYEE
CREATE TABLE EMPLOYEE
EMPID NUMBER NOT NULL,
EMPNICKNAME VARCHAR2(10 BYTE) NULL,
FNAME VARCHAR2(20 BYTE) NOT NULL,
MI VARCHAR2(20 BYTE) NULL,
LNAME VARCHAR2(20 BYTE) NOT NULL,
FULLNAME VARCHAR2(20 BYTE) NOT NULL,
HIREDATE DATE DEFAULT SYSDATE NOT NULL
-- data file employee.dat
1,amy,b,amy b
2,cindy,d,cindy d
3,eric,f,eric f
4,gary,h,gary
-- Control file : Employee.ctl ( you can use truncate, replace or append , see sqlldr for more options)
load data
Truncate into table employee
fields terminated by ","
optionally enclosed by '"'
TRAILING NULLCOLS
empId INTEGER EXTERNAL,
FName char(20),
LName char(20),
FullName char(30)
now to load use following or you can speicify infile in control fle
sqlldr username/passowrd control=employee.ctl data=employee.dat log=employee.log
{code}
Hope this help.
Regards -
Oracle Dictionary: check what table belongs a column from a view
hi,
Is there any way to check in the oracle data dictionary what is the table that a column in a view belongs to?
Imagine this
create view xpto as
select table_a.col1, table_a.col2, table_b.column1
from table_a, table_b
I want to know that column1 in the view xpto belongs to the table_b.
Is this possible? How?
Best Regards,
Joao OliveiraHi Mat,
I know that I can check the table columns in that view or in user_Tab_columns. The problem is that some views have columns from different tables that have the same name. Understood?
So I really need to know what tables are part of the view query.
Thanks
Joao -
Select query to read data from a view
Hi friends,
We have been using a query to read data from a custom view which used to work perfectly. Now the program sits at that select query forever. We are able to extract same data from se16. Not sure what could be the problem.
Thanks in advance.Dev
Have a look at the Table Index for the tables involved in the View... I think there is some change in the Indexes.. (Add / Remove / Change)
Thanks
Amol Lohade
Maybe you are looking for
-
Can no longer enable disk use on my 5th gen ipod since updating to 9.0.13.5
Hey everyone, I have an 5th gen 80 gig iPod that I use as a portable hard drive, having gotten a new Ipod. However, since I updated to iTunes version 9.0.3.15 this morning, the "Enable Hard Disk" option doesn't even show up at all. Is there a way to
-
Some UIMessages not received while C# GUI is open
I have a sequence file that has a front end GUI written in C#. When the MainSequence is run, there is a sequence call step to show the C# GUI using a new thread. The GUI is used to select which other sequences to run in the sequence file as well as d
-
Liquid spill; macbook pro failure 6 mos. later?
I need some help on this one, sorry it's kind of long: We bought a macbook pro from a large appliance store here in the chicago area at Christmas 08. We were told that while it was returned unit, it was in fine working condition. We had purchased ext
-
HRMD_A Inbound Idoc with process Code:HRMD not updated in SAP
Dear friends, I'm facing a problem with Personnel data creation in SAP (this is not a SAP HR system). I have a data file with Personnel data, in WE19, I use idoc_input_hrmd to process the data (with basic type: hrmd_a06). Idoc has been created with s
-
Value of x , static variable..
In the method callMe() i am returning x , which is 0, that gets assigned to x in main(the same static variable), then i am incrementing x. But the value of x is 0. Whats happening. public class TestClass { static int x=0; static int callMe(