Select single and select upto 1 rows
Hi
What is the difference between select single and select upto 1 rows
Performance wise which one is the best
Regards,
Maya
Hi,
Difference Between Select Single and Select UpTo One Rows
According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
The best way to find out is through sql trace or runtime analysis.
Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
Mainly: to read data from
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Mainly: to check if entries exist.
reward points if useful
regards,
ANJI
Similar Messages
-
Select Single * and Select upto one row
Hi all,
Can anybody tell me what is difference between Select single * and select upto one row?
And which one is better?
Thanks in advance.......According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
The best way to find out is through sql trace or runtime analysis.
Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
Mainly: to read data from
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Mainly: to check if entries exist.
Select Single is the best one compared to UPto one rows.
Select Single will get the first record from the table which satisfies the given condition.So it will interact once with the database.
UTO 1 rows will get the list of the records for the given match and iwll show the first record from the list.So it will take time to get the record.
SELECT SINGLE VBELN from VBAK
where MATNR = '1M20'.
---Thjis will get the first matched record and will display the record
SELECT VBELN from VBAK
where MATNR = '1M20' upto 1 rows.
---Thjis will get the list of matched records and will display the first record
The Major difference between Select Single and Select UPTO 1 rows is The Usage Of Buffer for each.
Select Single will search for all the satisfied data and bring all that data into Buffer and later it will give to that data to the program.
Select UPTO 1 Rows will end the search after getting the 1st satisfied record and gives that record to the program.
Thus Select Single will take much processing time when compare with Select UPTO 1 rows.
Also
check these threads..
Difference between Select Single and Selct upto 1 row
Difference between Select Single and Select upto 1 row
Difference between select single and select upto one row
Difference between 'select single *' and 'select upto 1 rows'
difference between select single and select up to 1 rows
regards,
srinivas
<b>*reward for useful answers*</b> -
Diff bw select single * and select upto one row
hai,
what is the difference between select single * and select upto one row.hi,
ex code
Report Z_Difference
Message-id 38
Line-Size 80
Line-Count 0
No Standard Page Heading.
Start-Of-Selection.
Data: w_Single type Posnr,
t_Rows type standard table of Posnr
initial size 0
with header line.
Select single Posnr
from zDifference
into w_Single.
Select Posnr
into table t_Rows
from zDifference
up to 1 rows
order by Posnr descending.
Write :/ 'Select single:', w_Single.
Skip 1.
Write :/ 'Up to 1 rows :'.
Loop at t_Rows.
Write t_Rows.
EndLoop.
According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not
using all the primary key fields.
select single is a construct designed to read database records with primary key. In the absence of the primary key,
it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key
supplied and will try to find most suitable index.
The best way to find out is through sql trace or runtime analysis.
Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s)
you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the
second or the third record has the value you are looking for.
The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional
level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause
If this results in multiple records then only the first one will be returned and therefore may not be unique.
Mainly: to read data from
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that
are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns
the first record of the result set.
Mainly: to check if entries exist.
You can refer to the below link..
http://www.sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm
rgds
anver
if hlped pls mark points -
Regarding select single and select upto 1 rows
hi experts,
plz let me know about difference between select single and select upto 1 rows with small eg...
thnx in advance.Hi Ravi,
According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
The best way to find out is through sql trace or runtime analysis.
Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
Mainly: to read data from
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Mainly: to check if entries exist.
Select Single is the best one compared to UPto one rows.
Select Single will get the first record from the table which satisfies the given condition.So it will interact once with the database.
UTO 1 rows will get the list of the records for the given match and iwll show the first record from the list.So it will take time to get the record.
SELECT SINGLE VBELN from VBAK
where MATNR = '1M20'.
---Thjis will get the first matched record and will display the record
SELECT VBELN from VBAK
where MATNR = '1M20' upto 1 rows.
---Thjis will get the list of matched records and will display the first record
The Major difference between Select Single and Select UPTO 1 rows is The Usage Of Buffer for each.
Select Single will search for all the satisfied data and bring all that data into Buffer and later it will give to that data to the program.
Select UPTO 1 Rows will end the search after getting the 1st satisfied record and gives that record to the program.
Thus Select Single will take much processing time when compare with Select UPTO 1 rows.
Also
check these threads..
Difference between Select Single and Selct upto 1 row
Difference between Select Single and Select upto 1 row
Thanks,
Reward If Helpful. -
Defference between select single and select upto 1 row?
What is the Defference between select single and select upto 1 row?
Hi,
Difference Between Select Single and Select UpTo One Rows
According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
The best way to find out is through sql trace or runtime analysis.
Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
Mainly: to read data from
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Regards,
Priya. -
Diff between select single and select upto 1 rows.
Hello aLL,
PL tell what is technical diff between select single and select upto 1 rows and how it is affecting the performance.
RushikeshHi
Knowing when to use SELECT SINGLE or SELECT ... UP TO 1 ROWS
A lot of people use the SELECT SINGLE statement to check for the existence of a value in a database. Other people prefer to use the 'UP TO 1 ROWS' variant of the SELECT statement.
So what's the difference between using 'SELECT SINGLE' statement as against a 'SELECT .... UP TO 1 ROWS' statement ?
If you're considering the statements
SELECT SINGLE field INTO w_field FROM table.
and
SELECT field INTO w_field FROM table UP TO 1 ROWS. ENDSELECT.
then looking at the result, not much apart from the extra ENDSELECT statement. Look at the run time and memory usage and they may be worlds apart.
Why is this ?? The answer is simple.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Get the difference ??
If not, here is a good example, credit for this example goes to Richard Harper, a friend of mine on sapfans.com :
Create a Ztable called ZDifference with 2 fields in it, MANDT of type MANDT and POSNR of type POSNR. Make sure both of these are keys. Also create a table maintenance dialog for it (SE11->Utilities->Table Maintenance Generator). Fill the table with ten rows 000001-000010.
Then run the program shown below:
Code:
Program: Z_Difference
Purpose: A program that demonstrates the difference
between SELECT SINGLE and SELECT UP TO n ROWS.
This program requires the data table Z_DIFFERENCE
to have been created according to the structure
outlined in the text above and populated with
at least 10 records.
Creation Date: 21/04/2004
Requested By:
Reference Doc:
Author: R Harper
Modification History:
Date Reason Transport Who
Report Z_Difference
Message-id 38
Line-Size 80
Line-Count 0
No Standard Page Heading.
Start-Of-Selection.
Data: w_Single type Posnr,
t_Rows type standard table of Posnr
initial size 0
with header line.
Select single Posnr
from zDifference
into w_Single.
Select Posnr
into table t_Rows
from zDifference
up to 1 rows
order by Posnr descending.
Write :/ 'Select single:', w_Single.
Skip 1.
Write :/ 'Up to 1 rows :'.
Loop at t_Rows.
Write t_Rows.
EndLoop.
You should see the output:
Select single: 000001
Up to 1 rows : 000010
The first 'SELECT' statement selected the first record in the database according to any selection criterion in the 'WHERE' clause. This is what a 'SELECT SINGLE' does. The second 'SELECT' has asked the database to reverse the order of the records before returning the first row of the result.
In order to be able to do this the database has read the entire table, sort it and then return the first record. If there was no ORDER BY clause then the results would have been identical (ie both '000001') but the second select if given a big enough table to look at would be far slower.
Note that this causes a problem in the Extended Program Check if the full key is not specified in a 'SELECT SINGLE'. Replacing the 'SELECT SINGLE' by an "UP TO 1 ROWS" will give the same exact results without any warning but the program will run slower and consume more memory. This is a good example of a warning that we should ignore... considering you are sure of what you are doing !! -
what is the difference of select single and select upto statements
HI,
SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
The best way to find out is through sql trace or runtime analysis.
Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
Mainly: to read data from
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Mainly: to check if entries exist. -
Regarding select single and select upto???
HI All,
Cud u pls let me know the differences between select single and select upto??
and which is the better option?? pls its quite urgent..plss plss
plss
Thanx in Advance
PrasadHi..,
According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
The best way to find out is through sql trace or runtime analysis.
Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
Mainly: to read data from
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Mainly: to check if entries exist.
Check this example ...
DATA: gv_vbeln TYPE vbak-vbeln,
gv_erdat TYPE vbak-erdat.
SELECT SINGLE vbeln erdat
FROM vbak
INTO (gv_vbeln, gv_erdat)
WHERE erdat = '12/01/2006'.
SELECT vbeln erdat
FROM vbak UP TO 1 ROWS
INTO (gv_vbeln, gv_erdat)
<b>ORDER BY erdat ASCENDING</b>.
ENDSELECT.
*In the example, the select single gets the first record that satisfies the WHERE clause unlike in the UP TO 1 ROWS where it sorts the database records by the earliest date and gets its VBELN.
<b>Try using the ORDER BY clause in SELECT SINGLE .. It gives an error !! U cannot use that with SELECT SINGLE</b>
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
Hope u understood !!
reward if it helps u..
sai ramesh -
hi everybody
what is the exact difference between select single vbeln and select vbeln
In what situations i should use these select single vbeln or select vbeln
regards
hridhayanjili.Hai
Go through the following Document
According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not
using all the primary key fields.
select single is a construct designed to read database records with primary key. In the absence of the primary key,
it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key
supplied and will try to find most suitable index.
The best way to find out is through sql trace or runtime analysis.
Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s)
you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the
second or the third record has the value you are looking for.
The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional
level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause
If this results in multiple records then only the first one will be returned and therefore may not be unique.
Mainly: to read data from
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that
are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns
the first record of the result set.
Mainly: to check if entries exist.
You can refer to the below link..
http://www.sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm
Regards
Sreeni -
frends please provide me the detail document and scenarios where we use with examples about select single and select upto n rows ?
Hi,
A lot of people use the SELECT SINGLE statement to check for the existence of a value in a database. Other people prefer to use the 'UP TO 1 ROWS' variant of the SELECT statement.
So what's the difference between using 'SELECT SINGLE' statement as against a 'SELECT .... UP TO 1 ROWS' statement ?
If you're considering the statements
SELECT SINGLE field INTO w_field FROM table.
and
SELECT field INTO w_field FROM table UP TO 1 ROWS. ENDSELECT.
then looking at the result, not much apart from the extra ENDSELECT statement. Look at the run time and memory usage and they may be worlds apart.
Why is this ?? The answer is simple.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Get the difference ??
If not, here is a good example, credit for this example goes to Richard Harper, a friend of mine on sapfans.com :
Create a Ztable called ZDifference with 2 fields in it, MANDT of type MANDT and POSNR of type POSNR. Make sure both of these are keys. Also create a table maintenance dialog for it (SE11->Utilities->Table Maintenance Generator). Fill the table with ten rows 000001-000010.
Then run the program shown below:
Report Z_Difference
Message-id 38
Line-Size 80
Line-Count 0
No Standard Page Heading.
Start-Of-Selection.
Data: w_Single type Posnr,
t_Rows type standard table of Posnr
initial size 0
with header line.
Select single Posnr
from zDifference
into w_Single.
Select Posnr
into table t_Rows
from zDifference
up to 1 rows
order by Posnr descending.
Write :/ 'Select single:', w_Single.
Skip 1.
Write :/ 'Up to 1 rows :'.
Loop at t_Rows.
Write t_Rows.
EndLoop.
You should see the output:
Select single: 000001
Up to 1 rows : 000010
The first 'SELECT' statement selected the first record in the database according to any selection criterion in the 'WHERE' clause. This is what a 'SELECT SINGLE' does. The second 'SELECT' has asked the database to reverse the order of the records before returning the first row of the result.
In order to be able to do this the database has read the entire table, sort it and then return the first record. If there was no ORDER BY clause then the results would have been identical (ie both '000001') but the second select if given a big enough table to look at would be far slower.
Note that this causes a problem in the Extended Program Check if the full key is not specified in a 'SELECT SINGLE'. Replacing the 'SELECT SINGLE' by an "UP TO 1 ROWS" will give the same exact results without any warning but the program will run slower and consume more memory. This is a good example of a warning that we should ignore... considering you are sure of what you are doing !!
Regards,
Ferry Lianto -
Select Single Vs Select upto 1 row
Hi All,
Please tell me which of the two statements is better if we want to retrieve only one record from a table.
Select single or Select upto 1 rows?
Regards,
SaurabhThere is a lot of confusion in the replies and also in the other thread.
If yoou ask 'A versus B' then this implies that you can use both for the same task, which is here not really true.
SELEC SINGLE should be used for SELECT with full primary key. where only 1 record CAN come back.
UP TO 1 ROWS is the special case of UP TO n ROWS can be used with any WHERE condition and gives you the first record which is found.
>The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the
> relevant records that are defined by the WHERE clause or lack of, applies any aggregate,
> ordering or grouping functions to them and then returns the first record of the resultant result
> set.
This in incorrect, the UP TO n ROWS does not read all, only if the ORDER BY is added, then you will get the first records in sort order which requires that all rfecords are read.
If you use UP TO 1 ROWS with a WHERE condition which is fulfilled by many records, then the first record is usually found very fast, even faster than a SELECT SINGLE.
If you use UP TO 1 ROWS or SELECT SINGLE with the same WHERE condition, then both are more or less the same.
Siegfried -
"select count(*)" and "select single *" returns different result
Good day!
product version SAP ECC 6.0
oracle10
data transfers from external oracle db into customer tables using direct oracle db link
sometimes I get case with different results from 2 statements
*mytable has 10 rows
*1st statement
data: cnt type I value 0.
select count( * ) into cnt from mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
*cnt returns 10 - correct
*2nd statement
select single * from mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
*sy-dbcnt returns 0
*sy-subrc returns 4 - incorrect, 10 rows are "invisible"
but
1. se16 shows correct row number
2. I update just one row from "invisible" rows using se16 and 2nd statement returns correct result after that
can not understand why
thank you in advance.Thank you, Vishal
but,
general problem is that
1. both statements have the same WHERE conditions
2. 1st return resultset with data (sy-dbcnt=10), 2nd return empty dataset, but must return 1 in sy-dbcnt
Yes, different meaning, you are right, but must 2nd must return 1, because of "select single *" construction, not 0.
Dataset to process is the same, WHERE conditions are equal...
I think the problem is that how ABAP interperets select count(*) and "select single *".
Maybe "select count (*)" scans only PK from index page(s)? and "select single *" scans data pages? and something is wrong with that?
I'm new in SAP and didn't find any SAP tool to trace dump of data and indexes pages with Native SQL.
se16 shows all records.
And why after simple manual update of just one record using se16 "select single *" returns 1?
I've just marked one row to update, didn't change any data, then pressed "save". -
what is the difference b/w
Select
Endselect
and select into table....
Akshitha..Hi,
When ever u want to append data into the workarea then use select ... endselect. When u r appending data into the internal table then use select. Also when u use select single then also use only select.
Eg: Using only Select
data : begin of itab occurs 0,
lifnr like lfa1-lifnr,
end of itab.
select single lifnr from lfa1 into itab.
data itab like lfa1 occurs 0 with header line.
select * from lfa1 into table itab.
Eg: Using Select .. endselect.
data : itab like lfa1 occurs 0,
wa like lfa1.
select * from lfa1 into wa.
append wa to itab.
endselect.
Regards -
Select single vs select upto one rows only by experts
Hello Experts,
I am sorry to post this thread again , it is million times answered.
There is a lot of confusion in the answers, so we want a very clear and justifiable answer.
please dont post rubish answers by simply copying and pasting from other threads .
now i will give an example of 2 threads which i seen in the forum.
1) first thread is like this....
According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
Select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
2)second post is like this....
When it comes to performance..select ..up to 1 rows is faster than select single....
why?
B'coz, during a select single, the query always hits the database and reads the entire table into memory and fetches the matching single record for you in the memory,
where as in the case of select up to 1 rows, the query goes to the memory first if found it retrieves the record from there, otherwise the query hits the database.
3)i seen an simple example in se30 in tips and tricks it shown select single is having better performance than select upto...rows,
We all really value the best answers..hi this is the standard one from the sdn..which will clear the answer..
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/difference%2bbetween%2bselect%2bsingle%2band%2bselect%2bupto
regards,
venkat -
Thumbnail selections, events and selection lists
I'm experimenting with creating an external data file to track Bridge selections. I've come across two problems, one of which I have found a fix for, the other not.
If I obtain 'app.document.selections' following a 'select' event type, the list I get is actually the list prior to the latest selection. So if I had test1.jpg selected and switch to test2.jpg, app.document.selections[0] will be test1.jpg. The same applies to using 'deselect' that actual deselection does not show in the app.document.selections list when the event is triggered.
The fix for this is to use event type 'preview' which returns the latest selections at the moment you change the selection.
Unfortunately, preview does not update when you click when you deselect - and since deselect and select events both seem to come ahead of the updating of the selections list, using them does not work.
Any suggestions / ideas on this.
Andrew
Here is the code I am currently using:
onThumbnailEvent = function( event ){
if( event.object.constructor.name == "Thumbnail" ){
if( event.type == "preview" ) {
ah_CollectBridgeData();
return {handled:true};//stop processing event handlers
ah_writeData = function (tFile,tString) {
if (tFile.open('w')) {
if (tFile.write(tString)) tFile.close();
else throw ("Error saving file list\n" + tFile);
else throw ('Error, Data File Not Opened\n' + tFile);
ah_CollectBridgeData = function () {
var tFile = new File ('/c/Program Files/Adobe/Adobe Photoshop CS2/Presets/Scripts/nn-test3.dat');
var filestr = ah_fileThumbnailsToFilestr(app.document.selections);
ah_writeData(tFile,filestr);
ah_fileThumbnailsToFilestr = function( thumbnails ) {
var fileAr = new Array();
for ( var i = 0; i < thumbnails.length; i++ ) {
if(thumbnails[i].spec instanceof File) fileAr.push(thumbnails[ i ].spec);
return fileAr.toString();
// register the handler
allDocEventHandlers = { handler: onThumbnailEvent };
app.eventHandlers.push( allDocEventHandlers );ugh, hadn't thot that thru yet on the deselect...
Looks like you get "n" deselects in a row.
Run this in ESTK, keep estk's console visible then select/deselect in bridge...
#target bridge
EventWatcher = {};
EventWatcher.lastEvent = "";
EventWatcher.eventCatcher = function( evt ) {
$.writeln( evt.type + " Event" );
if ( evt.type == "deselect" ) {
$.writeln( "Thumbnail Deselect: " + evt.object.path );
// debugger;
EventWatcher.lastEvent = evt;
return { handled: false };
app.eventHandlers.push( { handler: EventWatcher.eventCatcher } );
All the deselects (on a multiple deselect) happen in a row, and you're only interested in the last one, and you're not even interested in that. app.document.selections will be correct on the event (regardless of type) after the last deselect.
Hold off doing anything on a deselect until the event type changes.
if ( event.type = "deselect" ) {
myNamespace.loadedGun = true;
} else {
if ( myNamespace.loadedGun ) {
nowWriteMySelectionFile();
Since it's possible that you won't get another event for some time, you might want to setup a scheduled task that checks to see if the "gun is loaded", and if so to write the files.
Thanks for the kind words. I really enjoy working with everyone. It's a great break from head-down coding, and I learn something from just about every case.
Bob
Adobe WAS Scripting
Maybe you are looking for
-
Our company uses GMail as a mail service provider. This is a professional account, so it's under our own domain. I use Mail to download these messages to my MacAir. I consistantly can't find messages after they have been downloaded by Mail. Oddly, Ma
-
Where can I get a "servletrunner" from?
Hi all, I am looking at ways to get an applet that is served by many servers to talk to a servlet at a specific server however to run a servlet at that server I need "servletrunner". Most docs say that I should find it in /bin directory, but for the
-
IPhone 4 rebooting during video playback
My new iPhone 4 is rebooting whenever I play a video. It can be a Youtube, a podcast or a video I recorded with the camera. Sometimes it does it a minute or so into the video, sometimes when the video ends. I am also getting artifacts on the screen d
-
Both my CD/DVD Rom and my External speakers need drivers to work. Help!
My Compaq Presario CQ56 Notebook needs drivers for my CD/DVD rom and my external Philips speakers.
-
I have an iPhone 3GS and I got a confirmed unlock request with AT&T they said just hook to iTunes and restore and backup and it should be unlocked but doesn't unlock. Any suggestions?