Query related to excution and performance of count in select statement
Hi,
What are the difference between
select count(1) from table
and
select count(*) from table
Thanks for the reply.I searched lots of thread for the same and found that it's same (excution wise and performance wise).
But in few thread i found that someone is saying
"At the time of exceution Count(1) will conevrted internally to count(*) " --- is it correct
"is there any soecial significance of using count(42)" ?
Tx,
Anit
Similar Messages
-
Query to find first and last call made by selected number for date range
Hi,
query to find first and last call made by selected number for date range
according to filter:
mobile_no : 989.....
call_date_from : 25-april-2013
call_date_to : 26-april-2013
Please helpHi,
It sounds like you want a Top-N Query , something like this:
WITH got_nums AS
SELECT table_x.* -- or list columns wanted
, ROW_NUMBER () OVER (ORDER BY call_date ) AS a_num
, ROW_NUMBER () OVER (ORDER BY call_date DESC) AS d_num
FROM table_x
WHERE mobile_no = 989
AND call_date >= DATE '2013-04-25'
AND call_date < DATE '2013-04-26' + 1
SELECT * -- or list all columns except a_num and d_num
FROM got_nums
WHERE 1 IN (a_num, d_num)
;This forum is devoted to the SQL*Plus and iSQL*Plus front ends. This question doesn't have anything to do with any front end, does it? In the future, you'll get better response if you post questions like this in the PL/SQL.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the SQL forum FAQ {message:id=9360002} -
Joins And For all Enteries in Select Statement
Could you please tell me when there is a high amount of data which is being handled in the table, does the use of INNER JOINS and FOR ALL ENTERIES in SELECT Statement decreases the system performance? ?
Can you also let me know where can i get some tips regarding do's and dont's for ABAP Programming, I want to increase my system performance.
Currently the programs which are being used are taking a lot of time for execution...
Its very URGENT!Hai Jyotsna
Go through the following Tips for improving Performence
For all entries
The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause.
The plus
Large amount of data
Mixing processing and reading of data
Fast internal reprocessing of data
Fast
The Minus
Difficult to program/understand
Memory could be critical (use FREE or PACKAGE size)
Some steps that might make FOR ALL ENTRIES more efficient:
Removing duplicates from the driver table
Sorting the driver table
If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement:
FOR ALL ENTRIES IN i_tab
WHERE mykey >= i_tab-low and
mykey <= i_tab-high.
Nested selects
The plus:
Small amount of data
Mixing processing and reading of data
Easy to code - and understand
The minus:
Large amount of data
when mixed processing isnt needed
Performance killer no. 1
Select using JOINS
The plus
Very large amount of data
Similar to Nested selects - when the accesses are planned by the programmer
In some cases the fastest
Not so memory critical
The minus
Very difficult to program/understand
Mixing processing and reading of data not possible
Use the selection criteria
SELECT * FROM SBOOK.
CHECK: SBOOK-CARRID = 'LH' AND
SBOOK-CONNID = '0400'.
ENDSELECT.
SELECT * FROM SBOOK
WHERE CARRID = 'LH' AND
CONNID = '0400'.
ENDSELECT.
Use the aggregated functions
C4A = '000'.
SELECT * FROM T100
WHERE SPRSL = 'D' AND
ARBGB = '00'.
CHECK: T100-MSGNR > C4A.
C4A = T100-MSGNR.
ENDSELECT.
SELECT MAX( MSGNR ) FROM T100 INTO C4A
WHERE SPRSL = 'D' AND
ARBGB = '00'.
Select with view
SELECT * FROM DD01L
WHERE DOMNAME LIKE 'CHAR%'
AND AS4LOCAL = 'A'.
SELECT SINGLE * FROM DD01T
WHERE DOMNAME = DD01L-DOMNAME
AND AS4LOCAL = 'A'
AND AS4VERS = DD01L-AS4VERS
AND DDLANGUAGE = SY-LANGU.
ENDSELECT.
SELECT * FROM DD01V
WHERE DOMNAME LIKE 'CHAR%'
AND DDLANGUAGE = SY-LANGU.
ENDSELECT.
Select with index support
SELECT * FROM T100
WHERE ARBGB = '00'
AND MSGNR = '999'.
ENDSELECT.
SELECT * FROM T002.
SELECT * FROM T100
WHERE SPRSL = T002-SPRAS
AND ARBGB = '00'
AND MSGNR = '999'.
ENDSELECT.
ENDSELECT.
Select Into table
REFRESH X006.
SELECT * FROM T006 INTO X006.
APPEND X006.
ENDSELECT
SELECT * FROM T006 INTO TABLE X006.
Select with selection list
SELECT * FROM DD01L
WHERE DOMNAME LIKE 'CHAR%'
AND AS4LOCAL = 'A'.
ENDSELECT
SELECT DOMNAME FROM DD01L
INTO DD01L-DOMNAME
WHERE DOMNAME LIKE 'CHAR%'
AND AS4LOCAL = 'A'.
ENDSELECT
Key access to multiple lines
LOOP AT TAB.
CHECK TAB-K = KVAL.
ENDLOOP.
LOOP AT TAB WHERE K = KVAL.
ENDLOOP.
Copying internal tables
REFRESH TAB_DEST.
LOOP AT TAB_SRC INTO TAB_DEST.
APPEND TAB_DEST.
ENDLOOP.
TAB_DEST[] = TAB_SRC[].
Modifying a set of lines
LOOP AT TAB.
IF TAB-FLAG IS INITIAL.
TAB-FLAG = 'X'.
ENDIF.
MODIFY TAB.
ENDLOOP.
TAB-FLAG = 'X'.
MODIFY TAB TRANSPORTING FLAG
WHERE FLAG IS INITIAL.
Deleting a sequence of lines
DO 101 TIMES.
DELETE TAB_DEST INDEX 450.
ENDDO.
DELETE TAB_DEST FROM 450 TO 550.
Linear search vs. binary
READ TABLE TAB WITH KEY K = 'X'.
READ TABLE TAB WITH KEY K = 'X' BINARY SEARCH.
Comparison of internal tables
DESCRIBE TABLE: TAB1 LINES L1,
TAB2 LINES L2.
IF L1 <> L2.
TAB_DIFFERENT = 'X'.
ELSE.
TAB_DIFFERENT = SPACE.
LOOP
AT TAB1.
READ TABLE TAB2 INDEX SY-TABIX.
IF TAB1 <> TAB2.
TAB_DIFFERENT = 'X'. EXIT.
ENDIF.
ENDLOOP.
ENDIF.
IF TAB_DIFFERENT = SPACE.
ENDIF.
IF TAB1[] = TAB2[].
ENDIF.
Modify selected components
LOOP AT TAB.
TAB-DATE = SY-DATUM.
MODIFY TAB.
ENDLOOP.
WA-DATE = SY-DATUM.
LOOP AT TAB.
MODIFY TAB FROM WA TRANSPORTING DATE.
ENDLOOP.
Appending two internal tables
LOOP AT TAB_SRC.
APPEND TAB_SRC TO TAB_DEST.
ENDLOOP
APPEND LINES OF TAB_SRC TO TAB_DEST.
Deleting a set of lines
LOOP AT TAB_DEST WHERE K = KVAL.
DELETE TAB_DEST.
ENDLOOP
DELETE TAB_DEST WHERE K = KVAL.
Tools available in SAP to pin-point a performance problem
· The runtime analysis (SE30)
· SQL Trace (ST05)
· Tips and Tricks tool
· The performance database
Optimizing the load of the database
Using table buffering
Using buffered tables improves the performance considerably. Note that in some cases a statement can not be used with a buffered table, so when using these statements the buffer will be bypassed. These statements are:
Select DISTINCT
ORDER BY / GROUP BY / HAVING clause
Any WHERE clause that contains a sub query or IS NULL expression
JOIN s
A SELECT... FOR UPDATE
If you wan t to explicitly bypass the buffer, use the BYPASS BUFFER addition to the SELECT clause.
Use the ABAP SORT Clause Instead of ORDER BY
The ORDER BY clause is executed on the database server while the ABAP SORT statement is executed on the application server. The database server will usually be the bottleneck, so sometimes it is better to move the sort from the database server to the application server.
If you are not sorting by the primary key ( E.g. using the ORDER BY PRIMARY key statement) but are sorting by another key, it could be better to use the ABAP SORT statement to sort the data in an internal table. Note however that for very large result sets it might not be a feasible solution and you would want to let the database server sort it.
Avoid the SELECT DISTINCT Statement
As with the ORDER BY clause it could be better to avoid using SELECT DISTINCT, if some of the fields are not part of an index. Instead use ABAP SORT + DELETE ADJACENT DUPLICATES on an internal table, to delete duplicate rows.
Thanks & regards
Sreenivasulu P -
Count(*) in select statement having group by clause
Hi
I would like to use count(*) in select statement having group by clause. say for example there is a state with a number of cities listed. I would like to get the count of cities for each state.
the sql stement is grouped by city and it is joined with 5 more tables.
ThanksI suspect you want to look into analytic functions (assuming you have a recent version of Oracle). asktom.oracle.com has numerous examples if you do a search.
Justin -
BPEL function to query the Element Name and get the count of elements
Hi Guys,
I have problem with the following, can you please help me out with this.
Say i have an xml pay load:
<ns1:sampleEBO>
<ns1:PhysicalLocation>
<ns1:propertis>
<ns1:filedType>12</ns1:filedType>
<ns1:filedType1>12</ns1:filedType1>
<ns1:filedType2>12</ns1:filedType2>
<ns1:filedType3>12</ns1:filedType3>
<ns1:filedType4>12</ns1:filedType4>
<ns1:filedType5>12</ns1:filedType5>
</ns1:properties>
<ns1:propertis>
<ns1:filedType>12</ns1:filedType>
<ns1:filedType1>12</ns1:filedType1>
<ns1:filedType2>12</ns1:filedType2>
<ns1:filedType3>12</ns1:filedType3>
<ns1:filedType4>12</ns1:filedType4>
<ns1:filedType5>12</ns1:filedType5>
</ns1:properties>
<ns1:sampleEBO>
<ns1:PhysicalLocation>
Here i want to retrive the Element name ( filedType,fieldType1,fieldType2......) using any BPEL function, not the value and also get the total number of elements in the each node ( <properties> ). If i am using the "count" function its returning 2 and it's counting the properties node not the elements in the properties node.
So, can you please let me know of any function in BPEL which can do this ?
Thanks,
Krishyou only want to use a default bpel function for this? not from within xsl?
and the function should return an arraylist of elementnames i assume ?
<xsl:for-each select="//properties">
<xsl:for-each select="./*">
<xsl:value-of select="local-name()"/>
<xsl:choose>
<xsl:when test="substring(local-name(),1,9) ='filedType' ">
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
<count1><xsl:value-of select="count(//properties[1]/*)"/></count>
<count2><xsl:value-of select="count(//properties[2]/*)"/></count>the count can also be used in some for-each construction or from within your bpel flow itself (if you want to loop over there, instead of xsl) -
MRP query related to MTO and MTS
Dear Gurus,
I have got 2 Plants.......Plant A(Manufacturing Plant) and Plant B (Selling Plant)
My scenario is Make to Order, where the sales order is getting created in Plant B(selling Plant) for Export Material
1)when I run the MRP for Export material by MD50 ......Planned order should be created in Plant A and it should show in MD04 screen then only I can convert that planned order into production order.
2) After confirmation of that order and after GR.....stock should go to Plant B so that SD person will deliver that stock to the respected customer.
3)when I run the MRP by MD50, in the material BOM.....if any shortage of RAW MATERIAL OR PACKING MATERIAL then collective PR should be created in Plant B(selling plant).
what setting we should maintain in Meterial master related to PP for all raw/packing/semifinish/finish materials in both the plants related to MTS and MTO?
Could you provide me solution for the above queries.
MaxDear
This can be achieved by using special procurement type (80 production in another plant) in all production master data (material master for inhouse production, BOM, Routing and production version) will be made in plant B and in plant A same material will have material master for MRP i.e. MRP group, MRP type MRP controller Procurement type special procurement (80) in MRP2 production storage location, planning strategy etc.
you can see in MD04 for plant B delivery plant will be A. and in MD04 for plant A planning plant B.
production order will be confirmed in plant A and GR will be done in Plant B.
and purchase requisitions for component will be raised from plant A. if all components are required to be procured in plant B, all component will have also special procurement either 40 Stock transfer (proc.from alter.plant)
or 70 Withdrawal from alternative plant.
I hope this will solve your issue. Kindly let me know if your issue will solved or not.
Thanks
Muhammad Ashfaq -
Increase performance of the following SELECT statement.
Hi All,
I have the following select statement which I would want to fine tune.
CHECK NOT LT_MARC IS INITIAL.
SELECT RSNUM
RSPOS
RSART
MATNR
WERKS
BDTER
BDMNG FROM RESB
INTO TABLE GT_RESB
FOR ALL ENTRIES IN LT_MARC
WHERE XLOEK EQ ' '
AND MATNR EQ LT_MARC-MATNR
AND WERKS EQ P_WERKS
AND BDTER IN S_PERIOD.
The following query is being run for a period of 1 year where the number of records returned will be approx 3 million. When the program is run in background the execution time is around 76 hours. When I run the same program dividing the selection period into smaller parts I am able to execute the same in about an hour.
After a previous posting I had changed the select statement to
CHECK NOT LT_MARC IS INITIAL.
SELECT RSNUM
RSPOS
RSART
MATNR
WERKS
BDTER
BDMNG FROM RESB
APPENDING TABLE GT_RESB PACKAGE SIZE LV_SIZE
FOR ALL ENTRIES IN LT_MARC
WHERE XLOEK EQ ' '
AND MATNR EQ LT_MARC-MATNR
AND WERKS EQ P_WERKS
AND BDTER IN S_PERIOD.
ENDSELECT.
But the performance improvement is very negligible.
Please suggest.
Regards,
KarthikHi Karthik,
<b>Do not use the appending statement</b>
Also you said if you reduce period then you get it quickly.
Why not try dividing your internal table LT_MARC into small internal tables having max 1000 entries.
You can read from index 1 - 1000 for first table. Use that in the select query and append the results
Then you can refresh that table and read table LT_MARC from 1001-2000 into the same table and then again execute the same query.
I know this sounds strange but you can bargain for better performance by increasing data base hits in this case.
Try this and let me know.
Regards
Nishant
> I have the following select statement which I would
> want to fine tune.
>
> CHECK NOT LT_MARC IS INITIAL.
> SELECT RSNUM
> RSPOS
> RSART
> MATNR
> WERKS
> BDTER
> BDMNG FROM RESB
> INTO TABLE GT_RESB
> FOR ALL ENTRIES IN LT_MARC
> WHERE XLOEK EQ ' '
> AND MATNR EQ LT_MARC-MATNR
> AND WERKS EQ P_WERKS
> AND BDTER IN S_PERIOD.
>
> e following query is being run for a period of 1 year
> where the number of records returned will be approx 3
> million. When the program is run in background the
> execution time is around 76 hours. When I run the
> same program dividing the selection period into
> smaller parts I am able to execute the same in about
> an hour.
>
> After a previous posting I had changed the select
> statement to
>
> CHECK NOT LT_MARC IS INITIAL.
> SELECT RSNUM
> RSPOS
> RSART
> MATNR
> WERKS
> BDTER
> BDMNG FROM RESB
> APPENDING TABLE GT_RESB
> PACKAGE SIZE LV_SIZE
> FOR ALL ENTRIES IN LT_MARC
> WHERE XLOEK EQ ' '
> AND MATNR EQ LT_MARC-MATNR
> AND WERKS EQ P_WERKS
> AND BDTER IN S_PERIOD.
> the performance improvement is very negligible.
> Please suggest.
>
> Regards,
> Karthik
Hi Karthik, -
Hi,
Is it possible to use column aliases in the select statement for a database adapter to return an xml element name which is different to the column in the queried table?
I have tried using
SELECT EMPLOYEE_ID, FIRST_NAME AS MYNAME, LAST_NAME, SALARY, DEPARTMENT_ID, PHONE_NUMBER, EMAIL, HIRE_DATE FROM HR.EMPLOYEES WHERE (DEPARTMENT_ID = #DEPT_ID)
but I get the following XML fragment returned
<Employees>
<employeeId>100</employeeId>
<firstName xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<lastName>King</lastName>
<salary>24000</salary>
Any pointers appreciated.
Joel.That is really interesting.
When I use the "custom sql" option in the DB adapter wizard, it used the aliases just fine in the return schema.
Marc -
Change the class and type in javascript or select statement of region
Application Express 3.2.0.00.27
I have a manually created tabular form where I need pk to be updatable or not not updateable depending on whether its a new record or not.
I am attempting this thru 2 different ways.
1st:
using decode in select statement of region:
SELECT decode(c001,NULL,APEX_ITEM.POPUP_FROM_LOV(15,c001,'AUTH_LOV',NULL,NULL,0,NULL,NULL,NULL,'YES','f15_' || '#ROWNUM#'),
apex_item.display_and_save(15,c001,'f15_'|| '#ROWNUM#')) authid,
apex_item.hidden(16, c002, NULL,'f16_'|| '#ROWNUM#') empid,
-- apex_item.display_and_save(16,c002,'f16_'|| '#ROWNUM#') empid,
apex_item.date_popup(17, rownum, c003, 'DD-MON-YYYY',20,2000,NULL,'f17_' || '#ROWNUM#')deldate,
apex_item.textarea(18,c004,5,40,NULL,'f18_'|| '#ROWNUM#') "Delegation scope",
apex_item.textarea(19,c005,5,40,NULL,'f19_'|| '#ROWNUM#')"Delegation limits",
apex_item.select_list_from_lov(20,c006,'YESNO_LOV',NULL,'NO','N','%','f20_'|| '#ROWNUM#')"ORA Signed",
apex_item.date_popup(21, rownum, c007, 'DD-MON-YYYY', 20,2000,NULL,'f21_' || '#ROWNUM#') "Del expiry",
apex_item.date_popup(22, rownum, c008, 'DD-MON-YYYY', 20,2000,NULL,'f22_' || '#ROWNUM#') "Date removed",
apex_item.textarea(23,c009,5,40,NULL,'f23_'|| '#ROWNUM#') "Delegation comments",
apex_item.POPUP_FROM_LOV(24,c010,'DELEGATION_LOV',NULL,NULL,0,NULL,NULL,NULL,'YES','f24_' || '#ROWNUM#') "Delegator",
apex_item.display_and_save(25,c011,'f25_'|| '#ROWNUM#') status,
-- apex_item.display_and_save(26,seq_id,'f26_'|| '#ROWNUM#') seq_id,
apex_item.hidden(26, seq_id,NULL,'f26_'|| '#ROWNUM#') ||
apex_item.checkbox(27, seq_id,NULL,NULL,':','f27_'|| '#ROWNUM#') chkbx
FROM apex_collections
WHERE collection_name = 'DELEG_COLL'
AND c011 IN ('O','N','U','D')
--order by c001However this approach yields this error when I try to pick a value from the lov:
Error: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.
My other approach is to attempt to change the type and class in javascript. I am trying this but I get an error when I attempt to change the class and type like this:
<script type="text/javascript">
<!--
/* Client side validation on the Salary column */
function changeProp(pCol) {
var elms = document.getElementsByName(pCol);
for (i=0; i< elms.length; i++) {
/* elms.style.backgroundColor = 'yellow'; */
if (elms[i].value == null || elms[i].value == '%null%'
|| elms[i].value == '') {
elms[i].class = 't20data';
elms[i].type = 'hidden';
alert('The value is' + elms[i].value);
//-->
</script>not completely duplicate...here in this thread I am stressing what I am trying to accomplish and asking for help on the javascript side.
-
Performance problem of asset selection statement.
Hi guys quick question.
SELECT a~bukrs
a~anln1
b~anln2
a~anlkl
a~aktiv
a~txt50
a~lvtnr
b~afabe
b~afabg
b~ndjar
b~ndper
INTO TABLE it_anla
FROM anla AS a
INNER JOIN anlb AS b
ON a~bukrs EQ b~bukrs
AND a~anln1 EQ b~anln1
WHERE a~bukrs IN s_bukrs
AND a~anln1 IN s_anln1
AND a~anln2 EQ '0000'
AND a~anlkl IN s_anlkl
AND a~aktiv EQ '00000000'
AND a~lvtnr IN s_lvtnr
AND b~afabe EQ 01.
I have a select statement which is filtered by capitalization date which is the field AKTIV. This select alone has 450 thousand hits. Having an ANLN2 = 0 and AKTIV = blank/no date means that the asset group is no longer active.
Now for another scenario I have to retrieve table ANLA again excluding all the Main Asset Number/ANLN1 found on that table.
Is there a way to select by doing it only once?
I tried to pass all the anln1 to a range table but the program dumps. I think the range table can't handle too many entries.
Retrieving all the entries from the DB then processing it takes longer.
I tried to delete the table using a loop but it takes to long as it process the table every loop.
LOOP AT it_anla WHERE anln2 EQ '0000' AND aktiv EQ '0000000'.
DELETE it_anla WHERE bukrs EQ it_anla-bukrs AND anln1 EQ it_anla-anln1.
ENDLOOP.
Thanks.
Edited by: Thomas Zloch on Sep 21, 2010 5:39 PM - please use code tagsModerator message - Welcome to SCN
If the range table for anln1 is large and contains distinct values, you can try using it in a FOR ALL ENTRIES construct rather than IN.
Rob -
Query related to write() and setsockopt()
Hi ,
This query is based on Solaris10. I will just brief out the issue and also the information which I am seeking. Here I am creating a TCP socket, and then increasing the socket buffer by using setsockopt(). Here is the call "setsockopt(fd, SOL_SOCKET, SO_SNDBUF,&txBufSize, sizeof(txBufSize))" . Here txbufsize is nothing but an integer that has a value equal to 65536.
Here I am writing some data by using the write system call like "write(fd, (char*) pData, (int) length));" Here The logic is to write to the socket fd, by using the above write () the pData of length 204 bytes continously for 40 times in a second. That means in a second maximum possibility of writing to the socket buffer is 204*40 ie. 8160 bytes.
The issue is after writing 8 to 9 times, that is after a successful write of around 1836 bytes of data (9 times * with 204 bytes each), write is failing with an error number "EWOULDBLOCK". The man page is giving an information that error code indicating that there is no free room available in the socket transmit buffer. But as I said earlier the buffer which I send so far is only 1836 bytes, also the socket buffer which I have allocated by using 'setsockopt' is 65536 which is much higher value.
Here what I am looking for is two things.
1. Does anybody has any insight why this write() is failing with EWOULDBLOCK, the same code was working fine in Solaris 8 as well as in 9. The same code is recently ported to Solaris10. This behaviour is observed only in Solaris10.
2. Is there any way I can debug how much buffer is already written or how much buffer is still free to use for writing, before I initiate a write(). It would be really great if anyone can point out a debugging tool or is there any way I can instrument the code with proper logs to print out the buffer each time before the write() call.
Thanks,
SreeActually, there was a typo in the bigAdmin article. The tunable parameter in question is actually called
tcp_fusion_rcv_unread_min
and is set in /etc/system as follows:
set ip:tcp_fusion_rcv_unread_min=0
The parameter description is:
This is the minimum amount of outstanding writes allowed on a synchronous streams-enabled receiving endpoint before the sender gets flow-controlled. Setting this value to 0 means that the data block limit is equivalent to the byte count limit, which essentially disables the check. Flow control for TCP fusion in synchronous stream mode is achieved by checking the size of receive buffer and the number of data blocks, both set to different limits. This is different that regular stream flow control. The need for this limit is to ensure that the sending and receiving processes are both getting the resources they need to process the data and that neither is starving the other. -
A query related to ProgressBar and its placing inside Container
Hi ,
I tried an example with Flex3 ProgressBar .I am posting the scenario in which it was correct in one case and wrong in another case .
Please tell me what is wrong here in the wrong case :
The Program is related to :
I have button on click of that i will be loading the Image . There is no Button and its event Listener Mentioned here .
Correct Approach :
This works fine as the Image and ProgressBar are in the same Container called HBox
<mx:HBox>
<mx:Image id="image" autoload="false"/>
<mx:ProgressBar id="MYPB" source="{image}"/>
</mx:HBox>
Wrong Approach :
The below isn't working as i placed ProgressBar outside the container called as HBox
<mx:HBox>
<mx:Image id="image" autoload="false"/>
</mx:HBox>
<mx:ProgressBar id="MYPB" source="{image}"/>
Please share your ideas as why this behaves this way .Hi Kiran.
I don't think either of the approach is wrong , it no way effected by placing the ProgressBar inside a container or outside the container.
Run the sample application below. It will load for both approaches.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Script>
<![CDATA[
public function loadImage1():void {
image1.load('assets/liazon_logo.png');
public function loadImage2():void {
image2.load('assets/liazon_logo.png');
]]>
</mx:Script>
<mx:HBox>
<mx:Image id="image1" autoLoad="false"/>
</mx:HBox>
<mx:ProgressBar id="MYPB1" source="{image1}"/>
<mx:Button label="Load Image1" click="loadImage1()"/>
<mx:HBox>
<mx:Image id="image2" autoLoad="false"/>
<mx:ProgressBar id="MYPB2" source="{image2}"/>
</mx:HBox>
<mx:Button label="Load Image2" click="loadImage2()"/>
</mx:Application>
If this post answers your question or helps, please kindly mark it as such.
Thanks,
Bhasker Chari -
Output count of SELECT statement is diff from count(*) of the same query
Has this ever happened to you?
I was wondering why some of the items were not appearing in my output. I have this select query:
SELECT
bukrs
gjahr
hkont
belnr
wrbtr
dmbtr
matnr
bschl
kunnr
vbeln
shkzg
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_output
FOR ALL ENTRIES IN i_bkpf
WHERE
bukrs EQ i_bkpf-bukrs
AND belnr EQ i_bkpf-belnr
AND gjahr EQ i_bkpf-gjahr
AND hkont IN hkont
AND hkont IN
('0004000000',
'0004000010',
'0004000020',
'0004000030',
'0004000040')
When I tried to put sample filters (bukrs: 1000; belnr 1800000016; gjahr: 2005; hkont: 4000000), I am getting 3 entries from bseg. But when I tried using SE16 or SE16N, I am getting 6 (which is the expected output). When I modify the same SELECT query to return just the output count, I AM getting 6.
SELECT count(*)
FROM bseg
INTO count
FOR ALL ENTRIES IN i_bkpf
WHERE
bukrs EQ i_bkpf-bukrs
AND belnr EQ i_bkpf-belnr
AND gjahr EQ i_bkpf-gjahr
AND hkont IN hkont
AND hkont IN
('0004000000',
'0004000010',
'0004000020',
'0004000030',
'0004000040')
Do you have any idea why this happens? My internal table is a standard table with no header line and no OCCURS statement.
KyleHello Kyle,
Thats because when using FOR ALL ENTRIES, it will delete the duplicates if the records selected dont have all the primary keys specified in the select query. In your first select query, the field BUZEI is missing which makes the records unique. Change your first select query as this and try
SELECT
bukrs
gjahr
hkont
belnr
buzei -------> Add this and check
wrbtr
dmbtr
matnr
bschl
kunnr
vbeln
shkzg
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE i_output
FOR ALL ENTRIES IN i_bkpf
WHERE
bukrs EQ i_bkpf-bukrs
AND belnr EQ i_bkpf-belnr
AND gjahr EQ i_bkpf-gjahr
AND hkont IN hkont
AND hkont IN
('0004000000',
'0004000010',
'0004000020',
'0004000030',
'0004000040')
Vikranth -
Help with a query using ISNULL and RTRIM in the same select statement
What I'm trying to accomplish is to blend the following two statements together:
ISNULL (EMail_Address, '') As Matrix_Member_Email
AND
RTRIM (EMail_Address) as Matrix_Member_EMail
So that if the email address is NULL, it gets changed to blank and I still need to RTRIM the other entries and use the column header of Matrix_Member_Email.
I've tried:
ISNULL ((EMail_Address, '') (RTRIM (EMail_Address)) as Matrix_Member_EMail
Any help would be greatly appreciated.
Thank you,I'm sorry. Here is the query:
--Declare @EMail_Address nvarchar(100) = null
Select SVAssociationID.R_ShortValue as MATRIX_AssociationID, Matrix_Modified_DT as Matrix_LastModified
,RTRIM (MLS_ID) As Matrix_MLS_ID
, ISNULL(EMail_Address, '') AS MATRIX_member_Email
,RTRIM (EMail_Address) as Matrix_Member_EMail
--,RTRIM( LTRIM( ISNULL (@EMail_Address, '') ) ) as Matrix_Member_EMail
,Last_Name AS MATRIX_LastName, Nickname AS MATRIX_NickName
FROM dbo.Agent_Roster_VIEW a
LEFT JOIN dbo.select_values_VIEW SV ON a.Status_SEARCH = SV.ID
LEFT JOIN dbo.select_values_VIEW BillType ON a.Bill_Type_Code_SEARCH = BillType.ID
LEFT JOIN dbo.select_values_VIEW SVAssociationID ON A.Primary_Association_SEARCH = SVAssociationID.ID
WHERE Status_SEARCH IN (66,68)
Order by MLS_ID
Results:
MATRIX_AssociationID
Matrix_LastModified
Matrix_MLS_ID
MATRIX_member_Email
Matrix_Member_EMail
MATRIX_LastName
MATRIX_NickName
STC
09/02/14
CCWILLI
[email protected]
[email protected]
Williams
Christine
STC
09/12/14
CCWORSL
[email protected]
[email protected]
Worsley
Charlie
STC
09/02/14
CCYROBIN
NULL
Robinson
ECBR
09/02/14
CDABLACK
[email protected]
[email protected]
Black
Dale
STC
09/02/14
CDABRADY
[email protected]
[email protected]
Brady
David
Thank you, -
Performance issue on a select statement
Hi all @ SAPforums and thanks for your attention,
the task is quite simple: given a Purchase Requisition number and position (banfn, bnfpo) I have to check if a contract with the same PR as source exists in the EKPO table.
In order to check for it, I simply typed the following select:
SELECT SINGLE * FROM EKPO INTO wa_checkekpo
WHERE bstyp EQ 'K'
AND banfn EQ l_eban-banfn
AND bnfpo EQ l_eban-bnfpo.
This kind of query is quite consuming (more than three seconds in my process) due to the fact that banfn and bnfpo don't belong to a key for the table.
Any idea/workaround that can lead to better performance? Please note I'm not interested in retrieving the contract number (KONNR), it's sufficient to know it exists.Hi,
> Do not use select * if you just want to check existence of the record.
so far so good.
> Use a single variable to store teh count.
But why should we count the records if we just want to know if a key exists in
the db or not? change the second half of the recommendation to:
Use a single field of the used index for the select list to check (sy-subrc or result
of that field) if the record exists or not.
Kind regards,
Hermann
Maybe you are looking for
-
i just bought a new ipad and i am trying to install i cloud on my pc but it says my apple id is correct but wont allow me to log into i cloud
-
Hi Experts, I want to archive messages in PI. Currently, all the messages are marked for deletion. To change the delete flag to archive flag, I execute SAP standard program RSXMB_DEL_TO_ARCH. When I execute this program and filter the value for parti
-
Apple mouse will not scroll down
I have a wirelss mouse (not a Magic Mouse). The poor creature will not scroll down, infact when using the track button to scroll down, it will go up. Any suggestions as to how this can be cured. When I had Apple Care (it is now expired) of the exp
-
Modification Comparison for SAP object
When we try to modify the program /DBM/MT_TILL_FUNC_D2063, reports the following message u201CCarry out modification comparison for REPS /DBM/MT_TILL_FUNC_D2063 first. No changes possibleu201D We just update our DSAP BM 6.00 system to service pack S
-
New iPod won't install on laptop
I've just got my first iPod classic (120GB 2008 model) and I've got the latest iTunes...but when I plug it in via USB, it won't recognise my iPod. It doesn't appear in My Computer or on iTunes. I've gone through all the troubleshooting and none of it