SELECT STATMENT USING JOINS OF 2 TABLE WITH UPT 200 ROWS
Hi
Any give me sample code for select statment'' SELECT STATMENT USING JOINS OF 2 TABLE WITH UPT 200 ROWS''.
Thanks in advance .
regards
veera
tables : mara.
data : begin of itab occurs 0,
matnr like mara-matnr,
maktx like makt-maktx,
end of itab.
start-of-selection.
select amatnr bmaktx into table itab up to 200 rows
from mara as a inner join makt as b on bmatnr = amatnr.
Similar Messages
-
Hi,
Please give me the Select query
I have to fetch EBELN,BUKRS,LIFNR,BSART,EKORG,EKGRP,WAERS,WKURS from EKKO and
EBELP,LGORT,MATKL ,WERKS,BEDNR,IDNLF,BPRME,NETPR from EKPO and
MENGE, SAKTO,AUFNR,ANLN1,GSBER,PS_PSP_PNR from EKKN and
LPEIN,EINDT,SLFDT, from EKET.
I have to fetch all the data into an single internal table(Mandatory) by a select query using Joins.
EKKO is having EBELN as primary key
EKPO is having EBELN,EBELP as primary key
EKKN is having EBELN,EBELP as primary key
EKET is having EBELN,EBELP as primary key
Can anybody Please give me the Select query.
With Regards
AjayHi ,
I am sending this sample coed for the Inner joins .Hope this will help you:
Inner joins using 3 tables
Try this :-
SELECT stpostlnr stpoidnrk mastmatnr maramtart stpo~menge
INTO CORRESPONDING FIELDS OF TABLE zmat1 FROM mast
JOIN stpo ON stpostlnr = maststlnr
JOIN mara ON maramatnr = mastmatnr
WHERE stpostlty = 'M' "AND stpoidnrk IN s_matnr
AND mast~werks = 1000.
Here s_matnr is a select-options on the selection-screen.
Or this.
Code:
Select single VbrkBukrs VbrkKunrg Vbrk~Vbeln
VbrkFkdat VbrkBstnk_Vf Vbrk~Zterm
Tvzbt~Vtext
VbakVbeln VbakBstdk
LikpVbeln Likplfdat Likp~Lfuhr
into w_vbrk
from vbrk
inner join Tvzbt on TvzbtZterm = VbrkZterm and
Tvzbt~Spras = sy-langu
Inner join Vbfa as SalesLnk
on SalesLnk~vbeln = pu_vbeln and
SalesLnk~vbtyp_v = c_order
inner join Vbak on VbakVbeln = SalesLnkVbelv
Inner join Vbfa as DeliveryLnk
on DeliveryLnk~vbeln = pu_vbeln and
DeliveryLnk~vbtyp_v = c_Delivery
inner join Likp on LikpVbeln = DeliveryLnkVbelv
where vbrk~vbeln = pu_Vbeln.
This code locates sales, delivery and payment terms info from a billing document number.
or
Here, this one also works fine :
select zfpcdcadivi zfpcdproforma zfpcdfactura zfpcdaniofactura
zfpcdmontousd zfpcdmontoap zfpcdebeln zfpcdinco1
zfpcdlifnr lfa1name1 zcdvsstatus zfpcdconint
into it_lista
from zfpcd inner join zcdvs
on zfpcdebeln = zcdvsebeln
and zfpcdproforma = zcdvsproforma
and zfpcdlifnr = zcdvslifnr
inner join lfa1
on zfpcdlifnr = lfa1lifnr
where zcdvs~status = '04'.
Also Here is another solution that just uses inner joins:
SELECT vbakvbeln vbfaerdat INTO (itab-vbeln, itab-wadat)
FROM ( vbak INNER JOIN vbap
ON vbapvbeln = vbakvbeln )
INNER JOIN vbfa ON vbakvbeln = vbfavbelv
WHERE vbak~kunnr = m_wm AND
vbak~vbtyp = 'C' AND
vbfa~erdat IN s_date AND
vbap~matnr = 'MZ1807F' AND
vbfaposnv = vbapposnr AND
vbfa~vbtyp_n = 'J'.
<REMOVED BY MODERATOR>
Cheers,
Chandra Sekhar.
Edited by: Alvaro Tejada Galindo on Apr 10, 2008 5:20 PM -
Joining two fact tables with different dimensions into single logical table
Hi Gurus,
I try to accomplish in Oracle Business Intelligence 11.1.1.3.0:
F1 (D1, D2 and D3)
F2 (D1 and D2 and D4)
And we want to build a report F1 F2 D1 D2 D3 D4 to have data for:
F1 that match only for D1-D2-D3
and data for
F2 that match only D1-D2-D4
all that in one row, so D3 and D4 are not common dimensions.
I can only do:
F3 (D1, D2)
F4 (D1, D2 and D4)
And report
F3 F4 D1,D2,D4 (all that in one row, and only D4 is not a common dimension)
Here is the very good example how to accomplish the scenario 1
http://108obiee.blogspot.com/2009/08/joining-two-fact-tables-with-different.html
But looks like it does not work in 11.1.1.3.0
I get
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 14025] No fact table exists at the requested level of detail: [,,Clients,,Day,ROI,,,,EW_Names,,,,,,,,,,,,,,,,,]. (HY000)
I am sure I set up everything correctly as advised in the blog but it works with only one not a common dimension
Is it a bug in 11.1.1.3.0 or something?
Thanks,
KateThanks for all your replies.
Actually, I've tried the solutions you guys mentioned. Generally speaking, the result should be displayed. However, my scenario is a little bit tricky.
table Y's figures are not the aggregation of table X for D dimension. Instead, table Y's figures include not only D dimension total, but also others (others do not mean A, B, C dimension). For example, table Y stores all food's figure, while table X stores only drink's figure. D dimension is only about drink's detail. In my scenario, other foods' figure is not provided.
So, even if I set D dimension to all/total for table X, table X's result is still not the same as table Y.
Indeed, table Y does not have a column key to join to D dimension's key. So, if I select D dimension and table Y's measures at the same time in BI Answer, result returns no data. Hence, I can't compare table X and table Y's results with selection of D dimension.
Is there any solution to solve this problem?
Edited by: TomChan on Jun 3, 2009 9:36 AM -
How to know the select stmt used in creating a table?
Hi,
If we create a table by selecting some records form another table, can we see the select statement used to create that table.
example: Create table emp2 as select * from emp where deptno=20;
is there any data dictionary table which stores select * from emp where deptno=20
Thanks in advance.
Edited by: 805791 on Jul 28, 2012 9:01 PMNo. The SELECT statement is not associated with the table in the data dictionary.
If the statement was executed recently, you may find the entire CREATE TABLE in the V$SQL view. Or, if you have licensed the AWR, you may find it in the DBA_HIST_SQLTEXT view. But there is no guarantee that the query will be in either view.
Justin
Edited by: Justin Cave on Jul 29, 2012 3:46 AM
Additionally, this question doesn't appear to relate to the Oracle Call Interface so it should probably have been asked in a different forum. The General Questions forum or the SQL and PL/SQL forum would have been more appropriate. -
SQL Server 2012 Undetected Deadlock in a table with only one row
We have migrated our SQL 2000 Enterprise Database to SQL 2012 Enterprise few days ago.
This is our main database, so most of the applications access it.
The day after the migration, when users started to run tasks, the database access started to experiment a total failure.
That is, all processes in the SQL 2k12 database were in lock with each other. This is a commom case of deadlock, but the Database Engine was unable to detect it.
After some research, we found that the applications were trying to access a very simple table with only one row. This table has a number that is restarted every day and is used to number all the transactions made against the system. So, client
applications start a new transaction, get the current number, increment it by one and commit the transaction.
The only solution we found was to kill all user processes in SQL Server every time this situation occurs (no more than 5 minutes when all clients are accessing the database).
No client application was changed in this migration and this process was working very well for the last 10 years.
The problem is that SQL 2k12 is unable to handle this situation compared to SQL 2k.
It seems to occurs with other tables too, but as this is an "entry table" the problem occurs with it first.
I have searched internet and some suggest some workarounds like using table hints to completely lock the table at the begining of the transaction, but it can't be used to other tables.
Does anyone have heard this to be a problem with SQL 2k12? Is there any fixes to make SQL 2k12 as good as SQL 2k?First off re: "Unfortunatelly, this can't be used in production environment as exclusive table lock would serialize the accesses to tables and there will be other tables that will suffer with this problem."
This is incorrect.
Using a table to generate sequence numbers like this is a bad idea exactly because the access must be serialized. Since you can't switch to a SEQUENCE object, which is the correct solution, the _entire goal_ of this exercise to find a way to properly
serialize access to this table. Using exclusive locking will not be necessary for all the tables; just for the single-row table used for generating sequence values with a cursor.
I converted the sample program to VB.NET:
Public Class Form1
Private mbCancel As Boolean = False
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim soConn As ADODB.Connection
Dim soRst As ADODB.Recordset
Dim sdData As Date
Dim slValue As Long
Dim slDelay As Long
'create database vbtest
'go
' CREATE TABLE [dbo].[ControlNumTest](
' [UltData] [datetime] NOT NULL,
' [UltNum] [int] NOT NULL,
' CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
' [UltData] Asc
' )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
' ) ON [PRIMARY]
mbCancel = False
Do
' Configure the Connection object
soConn = New ADODB.Connection
With soConn
.ConnectionString = "Provider=SQLNCLI11;Initial Catalog=vbtest;Data Source=localhost;trusted_connection=yes"
.IsolationLevel = ADODB.IsolationLevelEnum.adXactCursorStability
.Mode = ADODB.ConnectModeEnum.adModeReadWrite
.CursorLocation = ADODB.CursorLocationEnum.adUseServer
.Open()
End With
' Start a new transaction
Call soConn.BeginTrans()
' Configure the RecordSet object
soRst = New ADODB.Recordset
With soRst
.ActiveConnection = soConn
.CursorLocation = ADODB.CursorLocationEnum.adUseServer
.CursorType = ADODB.CursorTypeEnum.adOpenForwardOnly
.LockType = ADODB.LockTypeEnum.adLockPessimistic
.Open("SELECT * FROM dbo.ControlNumTest")
End With
With soRst
sdData = .Fields!UltData.Value ' Read the last Date (LOCK INFO 1: See comments bello
slValue = .Fields!UltNum.Value ' Read the last Number
If sdData <> Date.Now.Date Then ' Date has changed?
sdData = Date.Now.Date
slValue = 1 ' Restart number
End If
.Fields!UltData.Value = sdData ' Update data
.Fields!UltNum.Value = slValue + 1 ' Next number
End With
Call soRst.Update()
Call soRst.Close()
' Ends the transaction
Call soConn.CommitTrans()
Call soConn.Close()
soRst = Nothing
soConn = Nothing
txtUltNum.Text = slValue + 1 ' Display the last number
Application.DoEvents()
slDelay = Int(((Rnd * 250) + 100) / 100) * 100
System.Threading.Thread.Sleep(slDelay)
Loop While mbCancel = False
If mbCancel = True Then
Call MsgBox("The test was canceled")
End If
Exit Sub
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
mbCancel = True
End Sub
End Class
And created the table
CREATE TABLE [dbo].[ControlNumTest](
[UltData] [datetime] NOT NULL,
[UltNum] [int] NOT NULL,
CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
[UltData] Asc
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]
go insert into ControlNumTest values (cast(getdate()as date),1)
Then ran 3 copies of the program and generated the deadlock:
<deadlock>
<victim-list>
<victimProcess id="processf27b1498" />
</victim-list>
<process-list>
<process id="processf27b1498" taskpriority="0" logused="0" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1970" ownerId="3181" transactionname="implicit_transaction" lasttranstarted="2014-02-14T15:49:31.263" XDES="0xf04da3a8" lockMode="X" schedulerid="4" kpid="9700" status="suspended" spid="51" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="21152" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3181" currentdb="35" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
<executionStack>
<frame procname="adhoc" line="1" stmtstart="80" sqlhandle="0x020000008376181f3ad0ea908fe9d8593f2e3ced9882f5c90000000000000000000000000000000000000000">
UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </frame>
<frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
unknown </frame>
</executionStack>
<inputbuf>
(@Param000004 datetime,@Param000005 int)UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </inputbuf>
</process>
<process id="processf6ac9498" taskpriority="0" logused="10000" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1971" schedulerid="5" kpid="30516" status="suspended" spid="55" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="27852" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3182" currentdb="35" lockTimeout="4294967295" clientoption1="671156256" clientoption2="128058">
<executionStack>
<frame procname="adhoc" line="1" sqlhandle="0x020000003c6309232ab0edbe0a7790a816a09c4c5ac6f43c0000000000000000000000000000000000000000">
FETCH API_CURSOR0000000000000001 </frame>
<frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
unknown </frame>
</executionStack>
<inputbuf>
FETCH API_CURSOR0000000000000001 </inputbuf>
</process>
</process-list>
<resource-list>
<keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
<owner-list>
<owner id="processf6ac9498" mode="S" />
<owner id="processf6ac9498" mode="U" requestType="wait" />
</owner-list>
<waiter-list>
<waiter id="processf27b1498" mode="X" requestType="convert" />
</waiter-list>
</keylock>
<keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
<owner-list>
<owner id="processf27b1498" mode="U" />
<owner id="processf27b1498" mode="U" />
<owner id="processf27b1498" mode="X" requestType="convert" />
</owner-list>
<waiter-list>
<waiter id="processf6ac9498" mode="U" requestType="wait" />
</waiter-list>
</keylock>
</resource-list>
</deadlock>
It's the S lock that comes from the cursor read that's the villian here. U locks are compatible with S locks, so one session gets a U lock and another gets an S lock. But then the session with an S needs a U, and the session with a U needs an
X. Deadlock.
I'm not sure what kind of locks were taken by this cursor code on SQL 2000, but on SQL 2012, this code is absolutely broken and should deadlock.
The right way to fix this code is to add (UPDLOCK,SERIALIZABLE) to the cursor
.Open("SELECT * FROM dbo.ControlNumTest with (updlock,serializable)")
So each session reads the table with a restrictive lock, and you don't mix S, U and X locks in this transaction. This resolves the deadlock, but requires a code change.
I tried several things that didn't require a code, which did not resolve the deadlock;
1) setting ALLOW_ROW_LOCKS=OFF ALLOW_PAGE_LOCKS=OFF
2) SERIALIZABLE isolation level
3) Switching OleDB providers from SQLOLEDB to SQLNCLI11
Then I replaced the table with a view containing a lock hint:
CREATE TABLE [dbo].[ControlNumTest_t](
[UltData] [datetime] NOT NULL,
[UltNum] [int] NOT NULL,
CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
[UltData] Asc
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]
go
create view ControlNumTest as
select * from ControlNumTest_t with (tablockx)
Which, at least in my limited testing, resovlved the deadlock without any client code change.
David
David http://blogs.msdn.com/b/dbrowne/ -
How to create editable table with one empty row ?
I'm looking for solution how to create editable table with one empty row using ADF BC. I have seen this solution in application that was created in JHeadstart and it's very well idea to use it insead of creation form.
hammm, i do it this:
drop the VO on the page, select Table->ADF Table....
so, drop the botton create, from de VO->operations->create (the firts), and right botton (mouse) Edit binding....
in Data collection select the VO, in Select an action select CreateInsert
luck -
Row Level PPR in Advanced Table with Add More Rows Button
<br>
I have programmatically fired PPR event on MessageChoice. But it is in Advanced Table with
Add More Rows Button. When the value is changed in MessageChoice I Show/Hide Custom LOV
through SPEL like this ${oa.BioEmployeePVO.EmpManagerRender} .
But it is <b>hiding the all the ROWS</b> not just the row where the value has been changed.
I even tried with this code and get NULL for rowReference.
String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
In Processrequest()
String pageName = pageContext.getRootRegionCode();
Hashtable params = new Hashtable (1);
params.put ("param1", pageName);
Hashtable paramsWithBinds = new Hashtable(1);
paramsWithBinds.put ("param2",new OADataBoundValueFireActionURL (mcb, "{$AttendeeType}"));
mcb.setFireActionForSubmit ("empPositionChange", params, paramsWithBinds,false, false);
In ProcessFormRequest() {
if ("empPositionChange".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
String rowReference = pageContext.getParameter("param2");
// String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
Serializable[] parameters = { rowReference };
am.invokeMethod("handlePositionChangeEvent", parameters);
<br>HI Kumar,
Answer to your last post is "yes".
Now to your doubt regarding the code:
Hi Anna
I am trying to understand your code.
FireAction firePartialAction = new FirePartialAction("fireHideEvent"+(i/noOfTlaColSpan));
HideImgBean.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);
1. What is this i/noOfTlaColSpan ?
:)Forget abt this in your case it should be the event name which u r firing and capturing the it in the PFR.
Like FireAction firePartialAction = new FirePartialAction("YOurEventName");
and in PFR u can capture tht as:
if("YOurEventName".equals(pageContext.getParameter(EVENT_PARAM)))
//your logic to invoke AM method
2. I believe this HideImgBean would be MessageChoice for me?
:)Yep ur right
3. This brcdOhInventoryViewUpdateVOImpl would be the Custom PVO(Extending Seeded Base VO)
I create by adding the transient attributes?
:)Yep ur right
4. I cannot understand this code. Could you explain.
:)Please look at my comments in some of the lines .I have explained wht i am doing
if(updateIter==null)
updateIter[0]= invViewVO.createRowSetIterator("updateIter");//This initViewVo should be ur custom VO object
if(cnt>0)
updateIter[0].setRangeStart(0);
updateIter[0].setRangeSize(cnt);
for(int i=0;i<cnt;i++)
row = (brcdOhInventoryViewUpdateVORowImpl)updateIter[0].getRowAtRangeIndex(i);
String selectFlag=(String)row.invokeMethod("getPartNumber");//This getPartNuber should be replaced by the Prim Key inoke methd of ur VO
if(RowID.equals(selectFlag))
//This is my logic to set the transient attributes based on the msgChoiceBean value ..u have to pass the value when u invoke this method
if(reserveMethod.equals("BINARY"))
System.out.println("In Binary");
Boolean bVal= new Boolean("false");
Serializable sr[]={bVal};
Class []methodParamTypes = { bVal.getClass() };
row.invokeMethod("setshowreservetxt",sr,methodParamTypes);
Boolean bVal1= new Boolean("true");
System.out.println("bVal1"+bVal1);
Serializable sr1[]={bVal1};
Class []methodParamTypes1 = { bVal1.getClass() };
row.invokeMethod("setShowreservemsgchoice",sr1,methodParamTypes1);
break;
In my AM I am doing this. Am i doing right?:)Yep u r right
BioPrescribersPVO is the custom VO(extending seeded base VO).
public void handlePositionChangeEvent(String param)
OAViewObject vo = (OAViewObject)findViewObject("BioPrescribersPVO");
OARow row = (OARow)findRowByRef(rowReference);
if (row != null)
String position = (String)row.getAttribute("AttendeeType");
if (("PRESCRIBER".equals(position)) )
// BioEmpManagerRender is the transient attribute in BioPrescribersPVO.
row.setAttribute("BioEmpManagerRender", Boolean.TRUE);
row.setAttribute("BioPresManagerRender", Boolean.FALSE);
else
row.setAttribute("BioEmpManagerRender", Boolean.FALSE);
row.setAttribute("BioPresManagerRender", Boolean.TRUE);
} // end handlePositionChangeEvent()
// Initializing the custom VO
/*No need to initialize the VO because this is not a PVO(Propeties View object)
U r just using the existing VO and tht vo shloud have a primary key.Tht way u can match the rowref u r getting with the actual row from the View object*/
public void init()
OAViewObject appPropsVO = (OAViewObject)getBioPrescribersPVO();
if (appPropsVO != null)
if (appPropsVO.getFetchedRowCount() == 0)
appPropsVO.setMaxFetchSize(0); appPropsVO.executeQuery();
appPropsVO.insertRow(appPropsVO.createRow());
OARow row = (OARow)appPropsVO.first();
row.setAttribute("RowKey", new Number(1));
handlePositionChangeEvent("");
} // end init()
Thanks
Anna -
Issue in adding not null constraint on 250 G table with 50 million rows.
Guys,
I need to add not null constraint on 2 column of a table with 50 million rows and ~250 GB in size, These 2 columns are newly added and I have also update the value for each of these columns to not null for each row.
After that I am adding not null constraint on these 2 columns this is taking 1 hour to complete, Is there any way to speed up this, I don't want to use ENABLE NOVALIDATE option or rather I can't use that option.user445775 wrote:
Guys,
I need to add not null constraint on 2 column of a table with 50 million rows and ~250 GB in size, These 2 columns are newly added and I have also update the value for each of these columns to not null for each row.
After that I am adding not null constraint on these 2 columns this is taking 1 hour to complete, Is there any way to speed up this, I don't want to use ENABLE NOVALIDATE option or rather I can't use that option.And what's wrong with it taking an hour? Presumably, this is a one time operation, and it doesn't really interfere with anything else. -
Hello, i have a table in that table i have a header row which has another table with two header rows
When form spans more then one page on page2 the color and border are showing up outside of table see example below.
Anyone have any ideas how I can fix this?
I am using Livecycle designer ES2 9.***
THanksHi,
If the table spans to Next page then if you want to move whole table to other page then uncheck the allow page breaks with content option which is under Object Tab.
Thanks
Vjay. -
Pages won't allow me to create a table with just one row.
I'm trying to create a one row, two colum table in Pages. I have no problem with the columns. But I cannot create the table with just one row. Two rows apppears to be the minimum. Any ideas??
In Pages 5.2, click the equal sign at bottom-left of table and reduce the row count to one.
-
Issues with query using joins in 3 tables
I am trying to fetch data from 3 tables (Project,RIsk and Issues) using join. There are Risks associated with some projects and Issues associated with some projects.
ProjectID is primary key in Project table.
RiskID is primary key in risk table. ProjectID is foreign key.
IssueID is primary key in Issue table.ProjectID is foreign Key.
I need the projectname, count of risks for projects, count of issues for projects. I am using joins in all the 3 tables. Issue here is, its giving me double of count of risks and issues for each project.
Please advise how can I get the correct number. I have used the below query,
select p.projectname,count(r.riskid),count(i.issueid) from project as p
left outer join risk as r on p.projectid=r.projecctid
left outer join issue as i on p.projectid=i.projectid
group by
p.projectname
thanksHi All,
I got a new requirement to count, the number of high priority risks as well as high priority issues along with the other details. I modified the below table to include the changes, but I am not getting the desired result. Could you please help?
Original query:
select p.projectname,count(distinct r.riskid), count(distinct i.issueid) from project as p
left outer join risk as r on p.projectid=r.projecctid
left outer join issue as i on p.projectid=i.projectid
group by p.projectname
Modified query:
select p.projectname,count(distinct r.riskid),sum(case when r.riskpriority='high' then 1 else 0 end), sum(case when i.issuepriority='high' then 1 else 0 end),count(distinct i.issueid) from project as p
left outer join risk as r on p.projectid=r.projecctid
left outer join issue as i on p.projectid=i.projectid
group by p.projectnameI should get the desired result as:XYZ,8,1,4,4But I am getting:XYZ,8,4,4,32thanks for the reply. -
Select (join) into internal table with nested structures
Hello Experts,
i wonder about the correct notation of a select statement.
I have an internal table it_zoll including two structures as defined below.
The select is a join on the two tables zollp and zolls. As coded below the select is syntactically correct, but the fields
in the nested structures are not filled ....
Any ideas how to write the select statement ? (The internal table it_zoll must have the nested structures for other reasons ..)
Declaration:
TYPES: BEGIN OF ty_zollp,
belnr TYPE zollp-belnr,
werks TYPE zollp-werks,
gebnr TYPE zollp-gebnr,
END OF ty_zollp.
TYPES: BEGIN OF ty_zolls,
grnum type zolls-grnum,
werks type zolls-werks,
name1 TYPE zolls-name1,
END OF ty_zolls.
DATA: BEGIN OF wa_zoll.
DATA: zollp type ty_zollp.
DATA: zolls type ty_zolls.
DATA: END OF wa_zoll.
DATA: it_zoll LIKE TABLE OF wa_zoll.
Select:
SELECT
zollp~belnr zollp~werks zollp~gebnr
zolls~grnum zolls~werks zolls~name1
FROM zollp
JOIN zolls ON zolls~werks = zollp~werks
AND zolls~grnum = zollp~grnum
INTO CORRESPONDING FIELDS OF TABLE it_zoll
WHERE zollp~werks = werks
AND zollp~gebnr IN s-gebnr
AND ...
Thank you !DATA: BEGIN OF ty_zollp,
belnr TYPE zollp-belnr,
werks TYPE zollp-werks,
gebnr TYPE zollp-gebnr,
END OF ty_zollp.
DATA: BEGIN OF ty_zolls,
grnum type zolls-grnum,
werks type zolls-werks,
name1 TYPE zolls-name1,
END OF ty_zolls.
DATA: BEGIN OF wa_zoll.
Include structure ty_zollp.
Include structure ty_zolls.
DATA: END OF wa_zoll.
The above declaration had worked. Please try.
Regards,
Satish Kanteti -
Performance for join 9 custom table with native SQL ?
Hi Expert,
I need your opinion regarding performance to join 9 tables with native sql. Recently i have to tunning some customize extraction cost report. This report extract about 10 million cost of material everyday.
The current program actually, try to populate the condition data and insert into customize table and join all the table to get data using native sql.
SELECT /*+ ordered use_hash(mst,pg,rg,ps,rs,dpg,drg,dps,drs) */
mst.werks, ....................................
FROM
sapsr3.zab_info mst,
sapsr3.zab_pc pg,
sapsr3.zab_rc rg,
sapsr3.zab_pc ps,
sapsr3.zab_rc rs,
sapsr3.zab_g_pc dpg,
sapsr3.zab_g_rc drg,
sapsr3.zab_s_pc dps,
sapsr3.zab_s_rc drs
WHERE mst.zseq_no = :p_rep_run_id
AND mst.werks = :p_werks
AND mst.mandt = rg.mandt(+)
AND mst.ekorg = rg.ekorg(+)
AND mst.lifnr = rg.lifnr(+)
AND mst.matnr = rg.matnr(+)
............................................... unitl all table (9 tables)
AND ps.mandt = dps.mandt(+)
AND ps.knumh = dps.knumh(+)
AND ps.zseq_no = dps.zseq_no(+)
AND COALESCE (dps.kbetr, drs.kbetr, dpg.kbetr, drg.kbetr) <> 0
It seems the query ask for database to using hashed table. would that be it will burden the database ? and impacted to others sap process ?
Please advise
Thank You and Best Regardsyou can only argue coming from measurements and that is not the case.
Coming from the code, I see only that you do not understand it at all, so better leave it as it is. It is not a hash table, but a hash join on these table. -
Several reports on joined master-detail tables with single row source
I have 1 master table (Fixed Assets) and several datail tables (Improvements, Depreciation, ...)
I need to create several reports based on them all with criteria
'Select ALL from Master and join details
/1 total row from details for 1 master row/
filtered by [on_date <= report_date]'
How to do it better and not copy same code in every report?
As mentioned on this forum, ApEx is not able to use RefCursor as row source for ApEx reports
So I tried this Tom Kyte's example:
create type apex_user.myRecordType as object
(seq int,
a int,
b varchar2(10),
c date
Create Or Replace Type Apex_User.Mytabletype As Table Of Apex_User.Myrecordtype;
create or replace function Apex_User.my_function return Apex_User.myTableType
Is
l_data Apex_User.myTableType;
Begin
l_data := Apex_User.myTableType();
for i in 1..5
loop
L_Data.Extend;
l_data(i) :=Apex_User.myRecordType(i, i, 'row ' || i, sysdate+i);
end loop;
Return L_Data;
End;
Select *
from TABLE (cast(Apex_User.my_function() as Apex_User.mytableType))
Where C > Sysdate+1
Order By Seq Desc
SEQ A B C
5 5 row 5 22.08.2010
4 4 row 4 21.08.2010
3 3 row 3 20.08.2010
2 2 row 2 19.08.2010
4 Rows Selected
- and it really works from ApEx reports.
The questions are:
1) is this the best solution for my task (one centralized code for several reports with parameter filtering detail tables)?
2) how to change example properly to have here -
loop
L_Data.Extend;
l_data(i) :=Apex_User.myRecordType(i, i, 'row ' || i, sysdate+i);
end loop;
- simple SELECT from my MASTER-DETAILS joined tables?Hi,
if (row != null)
Row masterRow = row;
vo.setCurrentRow(masterRow);
// not needed : getMesReponsesPourTiersVO1().executeQuery();
You shouldnot execute the child VO after setting current row in master VO.
When the current row is set in master VO, then the child rows will get refreshed automatically.
Cheers,
Prasanna -
Self join on a table with condition to extract records
Hello PL/SQL Gurus/experts,
I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version
I have following table -
drop table t1;
create table t1(stud_NM,stud_id) as select
'Vikas',1 from dual union all select
'Andy',2 from dual union all select
'Chi',3 from dual union all select
'Derek',4 from dual union all select
'Kristien',5 from dual union all select
'Tom',6 from dual union all select
'Messi',7 from dual union all select
'Ketty',8 from dual;
drop table t2;
create table t2(stud_id,Class, CDate) as select
1,'BA','20120101' from dual union all select
1,'MA','20120101' from dual union all select
2,'BSc','20120531' from dual union all select
3,'MCA','20120606' from dual union all select
4,'MCA','20120701' from dual union all select
4,'Btech','20120715' from dual union all select
5,'MTech','20120730' from dual union all select
6,'MSc','20120801' from dual union all select
6,'MSc','20120802' from dual union all select
7,'MA','20120815' from dual union all select
8,'MA','20120815' from dual;
I have to get the output based on condition -
Extract Stud_Name, Count of records which has a condition as that of the one that if combination of Stud_Name & CDate is same then count this combination once only else if Stud_Name & CDate are different then count them as different records -
Currently i am using the following query to get the output -
select t1.stud_NM, count(distinct CASE WHEN orig.CDate<>ali.CDate then t1.stud_NM else
CASE WHEN orig.CDate=ali.CDate then '1' else null
end
end) Count
from t1,
t2 orig,
t2 ali
where t1.stud_id=orig.stud_id
and t1.stud_id=ali.stud_id
group by t1.stud_NM
order by t1.stud_NM
which is giving the following output, which looks fine as well -
STUD_NM COUNT
Andy 1
Chi 1
Derek 2
Ketty 1
Kristien 1
Messi 1
Tom 2
Vikas 1
8 rows selected.
So want to confirm if i am doing right or it is just because of the data it is giving me the right result ?
Kindly help me thanks in advance for your time and efforts.Hi,
You can simplify that, too. Since you're GROUPing BY stud_nm, concatenating COUNT (DISTINCT stud_nm || cdate) is just the same as COUNT (DISTINCT cdate), assuming cdate is not NULL.
Also, that assumes stud_nm is unique. (If it's not, the desired output doesn't make sense, but that's a different matter.) I'd do it this way:
SELECT t1.stud_nm
, t1.stud_id -- If wanted
, COUNT (DISTINCT t2.cdate) AS cnt
FROM t1
LEFT OUTER JOIN t2 ON t1.stud_id = t2.stud_id
GROUP BY t1.stud_nm, t1.stud_id
ORDER BY t1.stud_nm, t1.stud_id
OP: the query you posted will get the wrong results with other data. For example, if we add this to the sample data in t2:
7,'WX','20120816' from dual union all select
7,'YZ','20120817' from dual union all select
Karthick's solution (and my variant of it) correctly show a count of 3 for stud_id=7 (Messi), but your query has 2.
Maybe you are looking for
-
How do I find my copied files in iTunes music folder in library?
I've got a very large iTunes library and tell where my copied music files are in my iTunes folder. How can I tell the original from the copy? Are they in seperate folders, within a folder, how can I tell within my insane library what's what? Don't wa
-
Managed accounts and the AppStore bought apps
Hi there! I have a problem with the Mac App Store, where managed accounts in our 10.7 Open Directory Server cannot open applications bought by an admin iTunes account in client machines because the client system keeps asking for the password of the
-
Not able to download or access account info
Hi, For the past few days I have not been able to download songs from iTunes. Furthermore, it seems that I cannot access my account information either, despite the fact that iTunes shows me as being logged in and displays my $$ balance. When I sele
-
7.4 raw update not showing up in PSE 11
How do I get it to work? I updated but it is still showing version 7.1 in PSE and I need the upadate to work with raw files from my camera.
-
Hello Gurus, I have 2 tables. One with a million records and the other with 50,000 records. Both have an account id column. The first table contains all the customer accounts and the second table has all the bad debt accounts. My problem is I need to