How to create special column which represents result of a query
Hi all,
I need your help once more.
The situation is the following:
I have a table MESSAGE which has some billion entries. The columns are msg_id, vehicle_id, timestamp, data, etc.
I have another table VEHICLE which holds static vehicle data (about 20k rows) such as vehicle_id, licenceplate, etc.
My first target was to partition the table via timestamp (by range) and subpartition by vehicle_id (by hash).
So I could easily drop old data by dropping old partitions and tablespaces.
Now comes the new difficult 2nd target: the messages of some vehicles must be kept forever.
My idea is to add a column KEEP_DATA to the table MESSAGE. I could try to partition by timestamp AND KEEP_DATA, subpartion by vehicle_id.
The problem of this idea is that i have to update billions of rows.
It would be perfect if there is a possibility to add this KEEP_DATA-flag to the table vehicle.
Is there any way to "link" this information to a column in MESSAGE table?
I mean something like this:
alter table MESSAGE
add column (select keep_data from vehicle where VEHICLE.vehicle_id = MESSAGE.vehicle_id as keep_message) ;
Is there some possibility like that?
Would the partitioning on this column / statement work?
Would the value of the keep_message be calculated on runtime?
If so will the performance influence be noticeable?
If so will the performance also sink if the application is querying all rows except the keep_message?
Kind regards,
Andreas
What is your DB version?
The problem of this idea is that i have to update billions of rows. If this is your underlying problem then if you are in 11g and above you can use [url http://docs.oracle.com/cd/E14072_01/appdev.112/e10577/d_parallel_ex.htm]DBMS_PARALLEL_EXECUTE and split your update into multiple chunks and execute it parallel.
I mean something like this:
alter table MESSAGE
add column (select keep_data from vehicle where VEHICLE.vehicle_id = MESSAGE.vehicle_id as keep_message) ; As far as i know such a thing is not possible.
Similar Messages
-
How to create some columns dynamically in the report designer depending upon the input selection
Post Author: ekta
CA Forum: Crystal Reports
how to create some columns dynamically in the report designer depending upon the input selection
how export this dynamic report in (pdf , xls,doc and rtf format)
report format is as below:
Element Codes
1
16
14
11
19
10
2
3
Employee nos.
Employee Name
Normal
RDO
WC
Breveavement
LWOP
Sick
Carers leave
AL
O/T 1.5
O/T 2.0
Total Hours
000004
PHAN , Hanh Huynh
68.40
7.60
76.00
000010
I , Jungue
68.40
7.60
2.00
5.00
76.00
000022
GARFINKEL , Hersch
66.30
7.60
2.10
76.00
In the above report first column and the last columns are fixed and the other columns are dynamic depending upon the input selection:
if input selection is Normal and RDO then only 2 columns w'd be created and the other 2 fixed columns.
Can anybody help me how do I design such report....
ThanksHi Developer life,
According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric values) in the details, add an filter to filter the data base on this column group, but if
the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
Similar threads with details steps for your reference:
https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings
If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
Any question, please feel free to let me know.
Best Regards
Vicky Liu -
How to create a region which should float in a page . (Like as windows cal)
Hello Friends
Using
Apex Version 4 +.
Oracle database 11g.
How to create a region which should float in a page .
ie i can move that region inside that page anywhere like as windows calculator.
Can anyone please help me.
Thanks in advance
regards
Edited by: A on Apr 13, 2011 1:48 AM
Edited by: A on Apr 13, 2011 1:48 AMHi,
You can use a jQuery dialog.
http://docs.jquery.com/UI/Dialog
e.g. create html region, just say you give the region static id: floating-region, make it hidden by adding attributes: style="display: none;"then do like: $('#floating-region).dialog();
I made another post on steps to create a dialog. See: {message:id=9506160}
Ta,
Trent -
How to create dynamics columns in oracle query1.
hi,
how to create dynamics columns in oracle query.its very urgent.
regards
prasad..Urgent is it?
Why? Have you forgotten to do your coursework and you'll get thrown off your course if you don't hand it in today?
What makes you believe that your request for help is more important than someone else who has requested help? It's very rude to assume you are more important than somebody else, and I'm sure they would like an answer to their issue as soon as they can get one too, but they've generally been polite and not demanded that it is urgent.
Also, you assume that people giving answers are all sitting here just waiting to answer your question for you. That's not so. We're all volunteers with our own jobs to do. How dare you presume to demand our attention with urgency.
If you want help and you want it answering quickly you simply just put your issue forward and provide as much valuable information as possible.
Looking at your post you haven't told us what database version you are using, you haven't provided any create table DDL's and insert statements to populate that with sample data, and you haven't even shown us that you've had a go at doing something yourself.
You will find if you post on here demanding your post is urgent then most people will just ignore it, some will tell you to get lost, and some will explain to you why you shouldn't post "urgent" requests. Occasionally you may find somebody who's got nothing better to do who will actually provide you with an answer, but you really are limiting your options by not asking properly.
/rant
As a basic example of dyanamic SQL:
DECLARE
cur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;
cols DBMS_SQL.DESC_TAB;
ncols PLS_INTEGER;
BEGIN
-- Parse the query.
DBMS_SQL.PARSE(cur, 'SELECT hiredate, sal FROM emp', DBMS_SQL.NATIVE);
-- Retrieve column information
DBMS_SQL.DESCRIBE_COLUMNS (cur, ncols, cols);
-- Display each of the column names
FOR colind IN 1 .. ncols
LOOP
DBMS_OUTPUT.PUT_LINE (cols.col_name);
END LOOP;
DBMS_SQL.CLOSE_CURSOR (cur);
END;
/ -
How to create sub columns in interactive report
can u tell me , how to create sub columns in
interactive report. i really need it.i search lot but i dont get proper information.
help plz...
example : -
|_____total_ persons _____|
| persons | male | female |
100 200 3000
400 500 600i am nile.
select id as id,
male as male,
female as female
from persons.
i want interactive report with main column total persons(static text) in that male , female.
e.g.
|___total persons_| - - - - -> main cloumn
| male | female | - - - - -> sub columns
100 200
300 400
Edited by: user9512075 on Aug 29, 2008 1:46 AM
Edited by: user9512075 on Aug 29, 2008 1:47 AM
Edited by: user9512075 on Aug 29, 2008 1:48 AM
Edited by: user9512075 on Aug 29, 2008 1:49 AM -
How to create a button which unloads an iFrame and puts in its position another iFrame?
How to create a button which unloads an iFrame and puts in its position another iFrame?
It is very important for me if anyone could answer...
Thank you all in advance,
FrankOk I found it!!
-
How to create two columns in a header?
Can anyone tell me how to create two columns in a header please?
Thanks!!Sandra,
I'm suspicious about your motives. It just doesn't seem logical to me to put so much content into a Header that two columns would be required.
You might consider the alternate header-like approach; use a Text Box set to two-column format and Format > Advanced > Move Object to Section Master.
Jerry -
Am using short keyboard. Don't know how to create plus sign which is not on the keyboard. There is no number pad. Advice would be much appreciated.
nicholasmitaka-shi wrote:
This is a Japanese kana input keyboard, A1242, whioch looks quite as usual except that a few functions have no space on the board and have been ommitted.
Is the plus sign really not available on your keyboard at the place indicated on this graphic (to the right of the L key)? You might need to use shift or alt/option or shift+alt/option.
http://en.wikipedia.org/wiki/File:KB_Japanese.svg -
How to create a link which will redirect to a different iView?
Hello,
I have a certain iView, let's call it "myiView" which sits inside a certain Role, let's call it "myRole".
At the Homepage of the users I have KM navigation iView which shows a certain folder. I would like to create inside this folder a link to "myiView", this way when users will click on this link at the Homepage they will be redirected automaticly to "myiView". I remember reading once something regarding internal links perhaps this is solution but I'm not sure. Can anyone please show me how to create such link which redirects to another iView at the portal.
10X
RoyHey Prakash,
I am creating a KM link to this target, where at this link I can write javascript? As far as I know it is only possible at the iView level no? And where do I take the PCD URL from?
Hey Ashutosh,
I think that your method will open a whole new browser since it is an external link, I woulk like to keep the current navgation at the same page, simply navigate the user to a different place at the portal...
Roy -
How to retrieve multiple columns using "returning" in the Insert query.
hi,
wanted to know how to retrieve multiple columns using "returning" in the Insert Query.
For retrieving one column we write the query as follows:
Insert into TABLE values(1,2,3,4) returning COLUMN1 into PARAMETER
But can we retrive multiple columns in the same query?
am using oracle 10g and coding in .NETHi,
You can definetely get multiple values from a single query using the 'returning' clause.
Eg : insert into emp (empno, ename, job, deptno) values (7324,'ADAM','MARKETING',30) returning ename, deptno into var1, var2; PN : var1 & var2 to be declared as varchar2 & number respectively.
More insight into the 'RETURNING' clause in this link.
http://www.samoratech.com/PLSQL/swArtPLSQLReturn.htm
Regards,
Bhanu. -
How to create a structure which can hold a dynamic table as a field in DDIC
Hi ,
I am designing a solution for a problem and have a unique requirement. I need to create a structure which can hold a field where dynamic table data can be stored. Let me illustrate with an example :
My structure ( say Z_output_struc ) will have the fields
Table_name Table_Data
My function module will have a table type of the above structure, so in effect ,my output can have multiple table names and related to each of them, there will be table data of that table name. The issue is how do I configure this in DDIC ?
I tried creating table_data as "Type ref to Data" but was stuck inside the func module when I tried to transfer data to this.
Any pointers as to how to think about this differently ?
Best Regards,
GirishHi Girish,
you start directly from the ref to data. You assign it to a field symbol and cast this to the type of the destination of your select. So you can directly add the reference to the cache:
I hope this example helps a bit (I took a form instead of a function module as it is easier to add here and used an hr table as kna1 is empty on my test system):
REPORT z_rwe_99_dyn_tab_cache.
* type definition
TYPES:
BEGIN OF _s_cache,
table TYPE tabname16,
cache TYPE REF TO data,
END OF _s_cache,
_t_cache TYPE STANDARD TABLE OF _s_cache.
* data declaration
DATA:
lv_table TYPE tabname16,
lv_condition TYPE string,
lt_cache TYPE _t_cache.
* define table and condition
lv_table = 'HRP1000'.
lv_condition = 'plvar = ''01'' and otype = ''S'' and objid = ''50000016'''.
* get the result of a single table into the cache
PERFORM get_dyn_table USING
lv_table
lv_condition
CHANGING
lt_cache.
* form to read a single table
FORM get_dyn_table USING
iv_table TYPE tabname16
iv_condition TYPE string
CHANGING
ct_cache TYPE _t_cache.
FIELD-SYMBOLS:
<lt_table> TYPE ANY TABLE.
DATA:
ls_cache TYPE _s_cache,
lr_data TYPE REF TO data.
CREATE DATA lr_data TYPE STANDARD TABLE OF (iv_table).
ASSIGN lr_data->* TO <lt_table>.
SELECT * FROM (iv_table) INTO TABLE <lt_table>
WHERE
(iv_condition).
ls_cache-table = lv_table.
ls_cache-cache = lr_data.
APPEND ls_cache TO ct_cache.
ENDFORM. "get_dyn_table
If you have more questions just give another post.
Best Regards
Roman -
How to hide Rev. column in Search result Classic View
Hi,
My Requirement is to hide Revision display Column in Search result classic view page (How to customize Search result classic view customization).
please any body can help.
Thanks and Regards
Srinath
Edited by: 922944 on Mar 23, 2012 4:06 AMHi.
In WebCenter Content forum you'll find more help.
However try to hide the column following this steps:
Go to Web Layout Editor applet in Administration -> Admin Applets.
In Options -> Query Results Pages and edit the StandardResults. In text 2 delete reference to revisions.
If it don't "hide" revision column then probably have to create a custom component.
Regards. -
How to create a column where each subsequent entry is added to the former?
How does one create a column, inside Numbers, where each subsequent cell is added, in value, to the preceding cell above it? For example, a column could be labeled "credit card subtotals for the month." In the first cell, one might insert a dollar value, eg., $24.00. The next credit card charge might be $100.00 and that would be added to the $24.00 to create a running subtotal.
Thank you.Hi Jay,
Both formulas are written as they would appear entered into C2.
The 'special formula' is also written as it would appear in C2. Where I have used 'formula for C2' substitute your choice of the two formulas listed above the 'special formula' in my earlier post.
If you choose to use the first version, the finished 'special formula' will look like this in C2:
=IF(LEN(B2)>0,SUM(C1,B2),"")
Jerry's remarks regarding using conditional formatting to suppress the display of zeroes is well taken, but in this case, will not work as there are no zero values to be hidden.
In this case, either of the initial formulas will repeat the last 'running balance' in every cell from the last row containing an entry in column B to the bottom row of the table.
The formula checks, by counting the number of characters displayed, whether an entry has been made in the column B cell on the same row as the formula (B2 in the example in this post. IF an entry has been made, the formula calculates the sum of that entry and the previous running balance. IF no entry has been made (ie. there are no chanracters displayed in B2, the calculation is skipped, and the empty string ( "" ) is placed in C2, giving the appearance of a blank cell.
Example: the formula in this post is used in column C. Column D uses the core of that formula (with the C1 reference replaced by D1) without the IF statement. Both formulas are filed down to the bottom cell in their columns. Note the difference in rows 7 and below:
Regards,
Barry -
How to create New columns for the Internal Table Dynamically?
HI Guys,
In my logic i have to create new columns depending on the logic which i am executing.
My requirement is .I have to display o/p like this
Material || Year || Period || Mix ratio || Vendor ||Mix Ratio || Vendor || Mix Ratio Vendor || Mix ratio || Vendor || Mix ratio.............................from table's CKMLMV003 and CKMLMV001.Her i have to display the o/p in the above format and i have to display Vendor and Mix Ratio for 5 columns irrespective of data .If i have more than 5 columns for any record then i have to create a New columns dynamically for Vendor and Mix ratio.If anybody want my code i can Submit But plz tell with example how to do?
<b>The O/P must be finally shown in ALV Grid</b>
Thanks,
GopiYou must create the entire internal table dynamically, you can not add columns to a statically define internal table. Here is an example of creating a dynamic internal table.
Creation of internal table dynamically based on the Date Range entered
Regards,
Rich Heilman -
HOW TO CREATE A VIEW WHICH CONTAINS A PARAMETER
Hi all
I am trying to create a view which contains paramaters.
Lets assume that the view may look like this:
STEP 1:
CREATE OR REPLACE procedure Myproc(v_count in NUMBER) as
BEGIN
EXECUTE IMMEDIATE
'CREATE OR REPLACE VIEW myview AS
SELECT COUNT(*) FROM DUAL WHERE ROWNUM like '''||v_count||'%'' ';
END myproc;
SHOW ERRORS;
Procedure created.
Elapsed: 00:00:00.31
SQL> SHOW ERRORS;
No errors.
STEP 2:
SQL> EXEC Myproc(2);
BEGIN Myproc(2); END;
ERROR at line 1:
ORA-00998: must name this expression with a column alias
ORA-06512: at "MYUSERNAME.MYPROC", line 3
ORA-06512: at line 1
Elapsed: 00:00:00.16
It seems that doesn't really likes the third line: "EXECUTE IMMEDIATE".
Can I get any help with this one ?
Thank-you
RobertBear in mind that VIEWs are not supposed to be parameterised. That is why Nature gave us a WHERE clause. However, there is one, albeit slightly clunky, way of doing it....
SQL> CREATE OR REPLACE VIEW emp_view AS
2 SELECT * FROM scott.emp
3 WHERE deptno = sys_context('userenv','client_info')
4 /
View created.
SQL>
SQL>
SQL> exec dbms_application_info.set_client_info(10)
PL/SQL procedure successfully completed.
SQL> SELECT * FROM emp_view
2 /
EMPNO ENAME JOB MGR HIREDATE SAL COMM
DEPTNO
7782 CLARK MANAGER 7839 09-JUN-81 2450
10
7839 KING PRESIDENT 17-NOV-81 5000
10
7934 MILLER CLERK 7782 23-JAN-82 1300
10
SQL> Cheers, APC
Maybe you are looking for
-
Apple MacBook pro 15.4 mid 2009 2.53/8gb/250gb
I bought this off eBay the other day for £110, it was mentioned that the MacBook didn't show nothing on the screen, it did chime and it would cut out maybe 5 seconds in... So I received it today I removed the battery, a couple of times and I finally
-
Unfortunately I spilled coffee on my iBook G4 yesterday morning. I have since let it dry. Using the adapter, i have tried to reset the power manager using the instructions on this site. This has not helped. My iBook makes no sound at all. The adapter
-
Camera app date. When I download my photos from my iphone to PC, they are all dated Jan 1st 2000... Is there a way to set the correct date in the camera app . The phone date seems correct. Thank you if you are able to assist.
-
Regarding Layout saving in ALV
Hi, In my requirement,i want to save layout of the ALV Report with data in it.So that i can use this variant and get the same data again.I tried with the code below,but its saving only layout,but not the data. CALL METHOD grid1->set_table_for_first_d
-
Dsconf backup/restore in a replication environment
Hi, using Sun JS Directory Server 6.3.1. Two servers in a multi-master topology. When making a backup of the directory (on both systems) using dsconf backup, my question is: how should the restore be done, given the fact that there's a replication ag