Query with UNION option
Hi ,
I have one partition table.The partitions are created datewise.Now when i have to fire select query on that talble i am firing below querry
Select count(1) from table A where createdate between ('01-JAN-2012 00:00:00','DD-MON-YYYY HH24:MI:SS') AND ('01-JAN-2012 23:59:59','DD-MON-YYYY HH24:MI:SS')
Above query will scan 1 day partition.
now if i want to fetch records from whole month ,it will scan 31 partition one by one.
Select count(1) from table A where createdate between ('01-JAN-2012 00:00:00','DD-MON-YYYY HH24:MI:SS') AND ('31-JAN-2012 23:59:59','DD-MON-YYYY HH24:MI:SS')
Now if i change the query by writing another way which will scan partition parallely.
Select count(1) from table A where createdate between ('01-JAN-2012 00:00:00','DD-MON-YYYY HH24:MI:SS') AND ('01-JAN-2012 23:59:59','DD-MON-YYYY HH24:MI:SS')
union
Select count(1) from table A where createdate between ('02-JAN-2012 00:00:00','DD-MON-YYYY HH24:MI:SS') AND ('02-JAN-2012 23:59:59','DD-MON-YYYY HH24:MI:SS')
union
Select count(1) from table A where createdate between ('03-JAN-2012 00:00:00','DD-MON-YYYY HH24:MI:SS') AND ('03-JAN-2012 23:59:59','DD-MON-YYYY HH24:MI:SS')
union
till
Select count(1) from table A where createdate between ('31-JAN-2012 00:00:00','DD-MON-YYYY HH24:MI:SS') AND ('31-JAN-2012 23:59:59','DD-MON-YYYY HH24:MI:SS')
Is it possible that i can make query by passing different month in above union query .
Month can be dynamic, and above select can be take the values by passing the month.
kindly guide me
=======
I hear you. But can you demonstrate, instead of just telling?
Else, I'll be guessing, that you are just guessing. And I am inclined to guess that your guess is wrong.
But, I could be guessing wrong, of course. (And week-ends I am not online to test it myself)
Start by showing the table, ddl. Is it parallel, noparallel? - And then show the plans for both queries.
And how did you come to that conclusion of "one by one" vs "in parallel"?
Regards
Peter
Similar Messages
-
Hi,
I have three table:
Candidates: (candidate_id primary key)
Purhcase_orders: (Po_number primary key)
Bids: (bid_number primary key)
Just wanted to retrieve candidate information like candidate_id, first_name etc, along with count of purchase orders issued against this candidate and count of bid_number.
For that I have written below query:
query - 1:
SELECT CANDIDATE_ID,
INITCAP (first_name) FIRST_NAME,
+(SELECT COUNT (DISTINCT bid_number)+
FROM bids
WHERE BIDS.CANDIDATE_ID = cand.candidate_id)
BID_COUNT,
+(SELECT COUNT (DISTINCT po_number)+
FROM purchase_orders po
WHERE PO.CONTRACTEE_ID = cand.candidate_id)
PO_COUNT,
+'Y' match_flag,+
DECODE ( (SELECT candidate_id
FROM v_ineligible_candidates vic
WHERE VIC.CANDIDATE_ID = cand.candidate_id),
NULL, 'N',
+'Y')+
INELIGIBLE_FLAG
FROM candidates cand
Based on business requirement, need to create another set of query (query -2) same like above. In that we have some decode statements to calculate match_flag, then need to perform UNION operation between query -1 and query -2.
have around 130563 number of rows in candidates table.
Individually both queries are taking 500 msec.
But when I have used union, it didnt give result for atleast 60 sec. Then I cancelled execution.
Execution plan for the final query with UNION: (final cost)
Cost: 2,873 Bytes: 9,130,170 Cardinality: 260,862
Please help me in this issue.
Why its taking that much time in union.
Please correct my mistake and suggest me in this query.
UNION ALL is running but not UNION.
Thanks in advancePlease post complete Explain Plans.
To get detailed information of Explain Plan use
explain plan for
your_query;
select *
from table(dbms_xplan.display(null, null, 'ALL'));Post it alongwith below details between {noformat}{noformat} (exactly as specified) tags to preserve formatting and ease of understanding.
On your requirement,
Using UNIONALL you will get two set of rows, with UNION you might get a single row if your MATCH_FLAG are same for both queries. Use of either, has to meet your requirements than to meet your performance. If it is Business Acceptable, then look for performance and tuning.
If you could do the folllowing, it might be helpful for you.
1. Post the Sample table structure (Table information of Candidates should suffice) in a Create Table/With Sub-Query clause.
2. Sample Data in Insert Into/With Sub-Query format.
3. Expected Outcome based on Sample data
4. The Explain Plan of your Queries as requested above.
Reason of asking these details are, there might be a way to avoid Hitting the table Twice and avoid use of UNION/UNIONALL clauses. -
Select query with UNION clause in database adapter
Friends,
I have got a SQL query with two UNION clause withing it. like
select a,b,c
from a
union
select a,b,c
from b
The schema generated is like below in sequence
<element>a</element>
<element>b</element>
<element>c</element>
<element>a</element>
<element>b</element>
<element>c</element>
So, the columns from different select queries joined with UNION clause are all appeared in schema instead of the distinct columns.
Is there any way around to solve this issue ? or will need to with DB function/procedure.I think I know what you are saying but your example doesn't make sense, your SQL should produce something like
I had to change a, b, c with elementA, elementB, elementC as a and b are reserved html tags.
<elementA>DateA</elementA>
<elementB>DataB</elementB>
<elementC>DataC</elementC>
...What is the result of the query when you run it in SQLPlus? Is it what you expect?
cheers
James -
Query with Union to Show Ship to of Both Supplier & Customer BP's
Hi Guys,
I need to do a query that I can use in a formatted search, that will allow me to select from a list that shows both BP Ship to Addresses from The Customer and Supplier Tables. I know I have to use a union, however I have no clue where to start with this - would someone be so kind as to point me in the right directions please.
Kind regards
Sean Martin
Edited by: Sean Martin on Apr 18, 2011 5:20 PMHello Sean - I see you are new - let me welcome you to the SAP B1 forums...
Maybe you do have the wrong forum as Julie suggests above, but maybe it is a bit perplexing as to what you need in an SAP B1 sense...
1. Let us know where you would be using the formatted search (in the Sales documents? - in the Purchasing documents?) - OR - maybe give a business scenario...
2. Let us know what field the results would populate...
3. Are you looking for two formatted searches - one to be used with suppliers and one to to be used for customers - OR - do you want the formatted search to list all Ship-To addresses combined into one list?
4. A statement of UNION might not be needed!
5. The tables to reference in the formatted search are OCRD and CRD1.
That way you can help us help you better...again, wecome and...
Regards - Zal -
Hi all
I have two queries and i want to join this two query
The report column should be like this
item_number WK_30 WE_311st query
select
re.item_number,
nvl(le.quantity,0) - nvl(re.quantity,0) WK_30
from BACKLOG_WEEK_WH_AFTR_ATP le, BACKLOG_ATP_GT_CW_IN re
where le.item_number =re.item_number
and to_number(substr(re.year_week,-2,2)) = to_number(to_char(sysdate,'IW'))+12nd query
select
re.item_number,
nvl(le.quantity,0) - nvl(re.quantity,0) WK_31
from BACKLOG_WEEK_WH_AFTR_ATP le, BACKLOG_ATP_GT_CW_IN re
where le.item_number =re.item_number
and to_number(substr(re.year_week,-2,2)) = to_number(to_char(sysdate,'IW'))+2Thanks in advance
RegardsHello
It sounds like you need a cumulative sum, in which case I think you'll need to go with analytics. If you could supply create table statements, some sample data and a clear example of the output you expect, it would be easier to put something together. However, I think the statement below should work although it is untested.
SELECT
item_number,
plus_1,
plus_2,
plus_3,
plus_4,
plus_5,
plus_6,
plus_7,
plus_8,
plus_9,
plus_10,
plus_11,
plus_12,
plus_13
FROM
( select
re.item_number,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+1, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_1,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+2, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_2,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+3, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_3,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+4, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_4,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+5, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_5,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+6, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_6,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+7, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_7,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+8, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_8,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+9, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_9,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+10, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_10,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+11, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_11,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+12, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_12,
sum(decode (to_number(substr(re.year_week,-2,2)), to_number(to_char(sysdate,'IW'))+13, nvl(le.quantity,0) - nvl(re.quantity,0),0))
OVER( PARTITION BY re.item_number ORDER BY to_number(substr(re.year_week,-2,2)) PLUS_13,
ROW_NUMBER() OVER(PARTITION BY re.item_number) rn
from
BACKLOG_WEEK_WH_AFTR_ATP le, BACKLOG_ATP_GT_CW_IN re
where
le.item_number =re.item_number
and
and to_number(substr(re.year_week,-2,2)) in
( to_number(to_char(sysdate,'IW'))+1,
to_number(to_char(sysdate,'IW'))+2,
to_number(to_char(sysdate,'IW'))+3,
to_number(to_char(sysdate,'IW'))+4,
to_number(to_char(sysdate,'IW'))+5,
to_number(to_char(sysdate,'IW'))+6,
to_number(to_char(sysdate,'IW'))+7,
to_number(to_char(sysdate,'IW'))+8,
to_number(to_char(sysdate,'IW'))+9,
to_number(to_char(sysdate,'IW'))+10,
to_number(to_char(sysdate,'IW'))+11,
to_number(to_char(sysdate,'IW'))+12,
to_number(to_char(sysdate,'IW'))+13
WHERE
rn = 1HTH
David -
Urgent! How to use push_pred to optimize query with UNION in 10g?
Hi,
We are facing slow query performance in 10g database.
Appreciate if anyone could advise on how to optimize the performance by using push pred?
Or is there any other ways.
Thanks in advance.
Cheers,
SCdont post duplicate post
-
Hi,
I'm writing an application with jdbc. I'm using Oracle Release 8.0.5.0.0, j2re 1.4.2_06.
The query with UNION produces a resultSet with no record while if I execute the same query with Oracle SQL Worksheet I've one record.
This is the code with a sample query:
Class.forName(jdbcDriver).newInstance();
Connection c = DriverManager.getConnection(dbUrl, "**", "**");
Statement st = c.createStatement();
String query = "(select fam from people where id=1711) union (select fam from family where fam=397)";
ResultSet rs = st.executeQuery(query);
if(rs!=null){
while(rs.next()){...}
rs.next is false but I know It's not correct!
I dont get any exception and until I didn't use the UNION statement all worked fine!
Please help me, thanksok... I'm replying to myself:
It works if I write the query as follow:
"select fam from people where id=1711 union select fam from family where fam=397"
without '( ... )' !
bye -
How do I create a folder or report from a query with a union and parameters
I have created folders with unions but I am having difficulty coverting a query with a union and parameters.
The following works great in SQL*Developer without parameters, but I want to change to use parameters for the year and quarter and use it in Discoverer:
SELECT TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000') FEID,
AV.FIRM_NAME VENDOR_NAME,
AV.BIDCLASS CONTRACT_CODES,
AV.AWAMT AWARD_AMOUNT,
AV.SOL_MODE FORMAL_INFORMAL,
AV.CERT BUSINESS_ENTITY,
AV.ETHNICITY ETHNICTY,
AV.PO_NUMBER_FORMAT CONTRACT,
SUM(VP.INVOICE_AMOUNT) AMOUNT_PAID_$
FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV,
CONFIRM.VSTATE_VENDOR_PAYMENTS VP
WHERE ( ( AV.PO_NUMBER = VP.PO_NUMBER
AND AV.VENDOR_ID = VP.VENDOR_ID ) )
AND (TO_CHAR(VP.PAYMENT_DATE,'Q') = '4')
AND ( TO_CHAR(VP.PAYMENT_DATE,'YYYY') = '2009' )
GROUP BY TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000'),
AV.FIRM_NAME,
AV.BIDCLASS,
AV.AWAMT,
AV.SOL_MODE,
AV.CERT,
AV.ETHNICITY,
AV.PO_NUMBER_FORMAT
union
SELECT TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000') FEID,
AV2.FIRM_NAME VENDOR_NAME,
AV2.BIDCLASS CONTRACT_CODES,
AV2.AWAMT AWARD_AMOUNT,
AV2.SOL_MODE FORMAL_INFORMAL,
AV2.CERT BUSINESS_ENTITY,
AV2.ETHNICITY ETHNICTY,
AV2.PO_NUMBER_FORMAT CONTRACT,
0 AMOUNT_PAID_$
FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV2
WHERE
not exists (SELECT 'X'
FROM CONFIRM.VSTATE_VENDOR_PAYMENTS VP2
WHERE av2.po_number = vp2.po_number
AND (TO_CHAR(VP2.PAYMENT_DATE,'Q') = '4')
AND ( TO_CHAR(VP2.PAYMENT_DATE,'YYYY') = '2009' ))
AND (TO_CHAR(AV2.AWDATE,'Q') = '4')
AND (to_CHAR(AV2.AWDATE,'YYYY') = '2009')
GROUP BY TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000'),
AV2.FIRM_NAME,
AV2.BIDCLASS,
AV2.AWAMT,
AV2.SOL_MODE,
AV2.CERT,
AV2.ETHNICITY,
AV2.PO_NUMBER_FORMAT Can someone provide a solution?
Thank you,
RobertHi,
You can take the parameters to the select so that you will be able to create conditions over them.
Try to use this SQL instead of your and in the discoverer workbook create the conditions and parameters:
SELECT TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000') FEID,
AV.FIRM_NAME VENDOR_NAME,
AV.BIDCLASS CONTRACT_CODES,
AV.AWAMT AWARD_AMOUNT,
AV.SOL_MODE FORMAL_INFORMAL,
AV.CERT BUSINESS_ENTITY,
AV.ETHNICITY ETHNICTY,
AV.PO_NUMBER_FORMAT CONTRACT,
TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
SUM(VP.INVOICE_AMOUNT) AMOUNT_PAID_$
FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV,
CONFIRM.VSTATE_VENDOR_PAYMENTS VP
WHERE ( ( AV.PO_NUMBER = VP.PO_NUMBER
AND AV.VENDOR_ID = VP.VENDOR_ID ) )
--AND (TO_CHAR(VP.PAYMENT_DATE,'Q') = '4')*
--AND ( TO_CHAR(VP.PAYMENT_DATE,'YYYY') = '2009' )*
GROUP BY TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000'),
AV.FIRM_NAME,
AV.BIDCLASS,
AV.AWAMT,
AV.SOL_MODE,
AV.CERT,
AV.ETHNICITY,
AV.PO_NUMBER_FORMAT ,
TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
union
SELECT TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000') FEID,
AV2.FIRM_NAME VENDOR_NAME,
AV2.BIDCLASS CONTRACT_CODES,
AV2.AWAMT AWARD_AMOUNT,
AV2.SOL_MODE FORMAL_INFORMAL,
AV2.CERT BUSINESS_ENTITY,
AV2.ETHNICITY ETHNICTY,
AV2.PO_NUMBER_FORMAT CONTRACT,
TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
0 AMOUNT_PAID_$
FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV2
WHERE
not exists (SELECT 'X'
FROM CONFIRM.VSTATE_VENDOR_PAYMENTS VP2
WHERE av2.po_number = vp2.po_number
AND (TO_CHAR(VP2.PAYMENT_DATE,'Q') = TO_CHAR(VP.PAYMENT_DATE,'Q') )
AND ( TO_CHAR(VP2.PAYMENT_DATE,'YYYY') = TO_CHAR(VP.PAYMENT_DATE,'YYYY') ))
--AND (TO_CHAR(AV2.AWDATE,'Q') = '4')*
--AND (to_CHAR(AV2.AWDATE,'YYYY') = '2009')*
GROUP BY TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000'),
AV2.FIRM_NAME,
AV2.BIDCLASS,
AV2.AWAMT,
AV2.SOL_MODE,
AV2.CERT,
AV2.ETHNICITY,
AV2.PO_NUMBER_FORMAT,
TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
Tamir -
Hi,
When I run a SPARQL query with OPTIONAL in the WHERE clause, I saw a lot of "select 1 from ***" kind of queries got executed. The query runs very slow. I'm running Jena adaptor 2 against Oracle 11.1.0.6. We have about half million triples in the model. The queries we need to run tend to be complex and they run pretty slow. Does Oracle 11.1.0.7 have big query performance improvement over 11.1.0.6? Is there anything that we can do on the application side or on the database side to boost the query performance? Thanks,
WeihuaNative database support for OPTIONAL in SEM_MATCH based RDF query has been made available via patch 7600122 on 11.1.0.7. Direct use of SEM_MATCH to query your data from SQL has significant performance benefits.
-
Input Query with blanks when we press transfer values option
I have an input query with 12 restricted key figures, but when I enter data and press on 'Transfer Values' or 'Save Values', the cells are blanked out (i.e. the values dissapear) and the data is not updated into the cube. I have done the following:
In Query Designer, I have checked the attribute 'Start Query in Change Mode' and
For all restricted key figures that needs to be planned, I have marked as 'Data can be changed using user entries and planning functions...'
Can you please let me know your thoughts around this.
Thanks,
SriniMayank,
I have 10 characterstics(cost center, cost element, cost type, fiscal year period,fiscal year, version, value type, posting period, detail valye type, currency type+1kf(0amount)) in my aggregation level.
I have created 12 rkf for each month with the following restrictions
Plan rkf (sub rkf) with restrictions to
fiscal year(variable), inforprovider-real time cube, value type 20, kf-0amount,
jan plan rkf.....dec plan rkf has
kf--Plan rkf(sub rkf) + posting period 1...12(one for each month),
And i have created an input query with the following fields
unders rows
Cost type, cost element
under Columns
Jan paln rkf to Dec plan rkf
filters for controlling area EA
I have change the query defination to "start query change mode" and also set all the rkf properties to "change by user enteries and/or planning options"
So, is there anything i am missing here?
Do i have to all characterstics of my aggregation level in my input query? or do i have to restrct my rkf to any curreny/unit fields? Please shed some light in here....:)
Thanks for your help...
Srini -
Hello Everyone,
I would like to create SSRS single select dropdown list parameter (it is using MDX query in dataset) with "None" option at the top. Note: this parameter is dependent parameter and getting filtered based on the selection of another parameter.
How can I add hard-coded "None" text at the top of the parameter values? Can Union function help me to add this hard-coded value? The purpose is, when user selects None from the dropdown ignore the condition of the parameter from MDX query else
use the selected value in query condition.
Thanks, Ankit Shah
Inkey Solutions, India.
Microsoft Certified Business Management Solutions Professionals
http://www.inkeysolutions.com/MicrosoftDynamicsCRM.htmlHi Ankit,
In your scenario, you can achieve your requirement in report level other than in query. Add a Filter like:
Expression: =IIF(Parameters!Name.Value="None",1,Fields!Name.Value)
Operator:=
Value: =IIF(Parameters!Name.Value="None",1,Parameters!Name.Value)
In this case, report will ignore this parameter, and show all the records on the report when selecting “None” value. I have tested it on my local environment, the screenshots below are for you reference.
Reference:
Add a Filter to a Dataset (Report Builder and SSRS)
Regards,
Charlie Liao
TechNet Community Support -
BI 7.0 : Refresh of only one Query with VBA in a MultiQueryWorkbook
Does anyone know how to refresh only one query with VBA in a Workbook with several queries on different sheets?
Hello together,
thanks for your replies.
In the backend EHP1 is installed and I think we don't need an extra update for the frontend. But in the VBA code of the frontend the code didn't changed.
Our BEX Analyzer Addin version is: 7100.4.1100.34
BEx Patch Level is: Support Package 11 Revision 1606
The VBA code is:
Public Function SAPBEXrefresh(allQueries As Boolean, Optional atCell As Range) As Integer
'In the 7.0 Analyzer, ALL the items in the workbook can be refreshed, but refreshing
'a query individually is not supported
On Error Resume Next
extErrorBegin ("3.x API SAPBEXRefresh called")
If allQueries = True Then
Common.MenuRefresh
SAPBEXrefresh = 0
Else
SAPBEXrefresh = 700
p_extErrorText = "With 7.0, this API is partly supported to refresh ALL items in the workbook, NOT an individual Query"
End If
extErrorEnd
End Function
As you can see a individually query with this VBA code is still not supported.
Does anyone know how to change this code or if we need a special update?
Daniel
Edited by: Marc Schlipphak on Jan 19, 2010 7:35 PM -
What is the use for CREATING VIEW WITH CHECK OPTION?
Dear Legends,
I have a doubt
What is the use for creating view?
A: First Data Integrity, Selecting Particular Columns..
What is the use for creating a view with check option?
A: As per oracle manual I read that its a referential integrity check through views.
A: Enforcing constraints at DB level.
A: using CHECK OPTION we can do INSERTS UPDATES for a view for those columns who have no constraints... is it right??
A: If we do a INSERT OR UPDATE for columns who have constraints it will show error... is it right???
Please clear my doubt's Legends
Lots of Thanks....
Regards,
KarthikHi, Karthick,
karthiksingh_dba wrote:
... What is the use for creating view?
A: First Data Integrity, Selecting Particular Columns..Most views are created and used for convenience. A view is a saved query. If the same operations are often done, then it can be very convenient to code those operations once, in a view, and refer to the view rather than explicitly doing those operations.
Sometimes, views are created and used for security reasons. For example, you many want to allow some users to see only certain rows or certain columns of a table.
Views are necessary for INSTEAD OF triggers.
What is the use for creating a view with check option?
A: As per oracle manual I read that its a referential integrity check through views.The reason is integrity, not necessarily referential integrity. The CHECK option applies only when DML is done through the view. It prohibits certain changes. For example, if a user can't see certain rows through a view, the CHECK option keeps the user from creating such rows.
A: Enforcing constraints at DB level.I'm not sure what you mean. Please give an example.
A: using CHECK OPTION we can do INSERTS UPDATES for a view for those columns who have no constraints... is it right??No. Using CHECK OPTION, you can do some inserts and updates, but not others. The columns involved may or may not have constraints in either case.
A: If we do a INSERT OR UPDATE for columns who have constraints it will show error... is it right???If you try to violate a constraint, you'll get an error. That happens in views with or without the CHECK OPTION, and also in tables. -
Hi,
I wanted to know if this is possible with order by clause and union. some how union messes up the ordering of the left part of the union statement.
assume the data is as below in table tab1
c1 c2
4 1
4 2
5 1
5 2
7 1
7 2
8 3
9 4
the expected output must be for all c1 < 7 ordering must be on c1 and for all c1 > 7 ordering must be on c2.
so the query i tried was
select c1,c2 from tab1 where c1 <7 order by c1
union
select c1,c2 from tab1 where c1 >=7 order by c2
it is giving the message 'Sql command not properly ended'.
Suggestions are welcomeSQL>
SQL> With t As
2 (
3 Select 4 c1, 1 c2 From dual Union All
4 Select 4 ,2 From dual Union All
5 Select 5 ,1 From dual Union All
6 Select 5 ,2 From dual Union All
7 Select 7 ,1 From dual Union All
8 Select 7 ,2 From dual Union All
9 Select 8 ,3 From dual Union All
10 Select 9 ,4 From dual
11 ), t1 As (Select c1,c2 From t Where c1 <7 Order By c1)
12 ,t2 As (select c1,c2 from t where c1 >=7 Order By c2)
13 Select * From t1 Union All
14 Select * From t2;
C1 C2
4 1
4 2
5 1
5 2
7 1
7 2
8 3
9 4
8 rows selected
SQL> /*-- Union All
2 select c1,c2 from t where c1 >=7
3 Order By c1,c2;
4 */
5
with union clause order by must be placed in the end,,
select c1 from dual union all
select c2 from dual
order by c1 -
Issue with Select options in select statement - ABAP Question
Hi
I am facing an issue with select options. Select statement is returning sy-subrc as 4.
I wrote the program as below:
SELECT-OPTIONS:
s_kunnr FOR bsad-kunnr,
s_lifnr FOR bsak-lifnr,
s_gjahr FOR bsad-gjahr,
s_bukrs FOR bsad-bukrs,
s_saknr FOR bsad-saknr,
s_budat FOR bsak-budat.
In start of selection I have written the select statement as
SELECT * FROM bsak INTO TABLE lt_bsak
WHERE bukrs IN s_bukrs AND lifnr = s_lifnr AND gjahr IN s_gjahr AND budat IN s_budat AND saknr IN s_saknr.
In selection screen I have not entered any values and executed the program. I am not getting any result. When I debug that, sy-subrc is 4 at above select statement. But table has records.
If am removing the "lifnr = s_lifnr " condition in select then select is returning values.
I am not getting where I made the mistake. Please suggest.
Thank you
HanuHi,
The problem here with where condition select option lifnr = s_lifnr.
Use below select query.
SELECT * FROM bsak INTO TABLE lt_bsak
WHERE bukrs IN s_bukrs
AND lifnr IN s_lifnr
AND gjahr IN s_gjahr
AND budat IN s_budat
AND saknr IN s_saknr.
s_lifnr is a select option and you are passing it as parameter lifnr = s_lifnr.
if you want to pass this s_lifnr as single vale then pass in below mentioned way.
lifnr = s_lifnr-low
BR,
Vijay
Maybe you are looking for
-
HT4437 just bought apple tv 3rd gen and can't get it to airplay my 4th gen Ipod and my Iphone
hi all I just bought an apple tv and was all excited about getting it paired up with my Iphone and Ipod I brought up itunes on my toshiba satellite laptop running windows seven and I don't see any place to install the code that the remote app keeps t
-
Hi, I have a IDOC -> XI -> HTTP and IDOC -> XI -> SOAP. Based on the success from the receiver side is it possible to send acknowledgement from XI to IDOC so that i can destroy the IDOC immediately. Client doesn't want to archive the IDOCs, they want
-
Cannot place in illustrator or photoshop from bridge
Don't see file>place commands for illustrator or photoshop in bridge... Just dreamweaver and indesign Also.. lost all photo processing command under the tools menu. Any input would be appreciated
-
I just did 3 updates last night, and now I can't get to any secure site. I need to make room reservations and all I get is this message: "You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow pro
-
Recently when I install apps, the icon does not appear on the menu screen, also, it shows that it is downloading at the app store and when complete, I can not open it or reinstall it. Has happened on the last 4 free apps. Help Please