Reg: open sql
hai friends..
in open sql..
what is the purpose of open cursor, fetch, close cursor, commit work, rollback work ?
explain with eg ? what is it specific purposes?
IBM help says Reason code 68 is for lock timeout - was the program "hanging" for some time, could it be someone (or something) is locking the Variant?
If you have authorization, you can see deadlocks and lock waits in ST04
Similar Messages
-
"Open sql" report no data sourced defined in windows
when I want to import data from sql database, the Open sql window report error
"There are no data sourced defined. Please create one to continue",
but I have defined the odbc data source using windows 's odbc administrator, why the error?
chuliangA couple of possibilities.
First are you licensed for Sql interface? If not, you might get that message.
Second, where did you create the ODBC connection on your computer or the server. It has to be on the server.
Third, did you create the odbc as a system driver? it needs to be so
Fourth, what operating system? If it's unix or AIX there is a hole bunch more you need to do to get odbc connections working. If it's windows, it's pretty easy.
Fifth, did you test the connection before trying it in Essbase? -
Performance: Open SQL vs. Native SQL (Oracle)
Hi everybody,
I have an interesting issue here. For a DB selection I use an Open SQL query from a table view into an internal table. It works fine, but the performance is not very well. The SELECT uses LIKE and wildcards (%) to search for customer master data (names and address fields).
Because of the bad performance I made some tests in transaction DB02 with native SQL, but exactly the same SELECT structure. It looks like this:
SELECT *
FROM zzrm_cust_s_hlp
WHERE client = 100
AND mc_name1 LIKE '<name>%'
AND mc_name2 LIKE '<name>%'
AND valid_from <= <timestamp>
AND valid_to >= <timestamp>
Ok, now I tried exactly the same SELECT statement with the same data to search for (<name> and <timestamp) with Open SQL and Native SQL. The Difference is quite suprising, the Native SQL query is about 5-10 times faster (arount 1 sec) than the Open SQL query (around 5-10 sec). Even with the LIKE keywords and the wildcards.
Any ideas what could be the problem with the Open SQL query?
And: what can I do to achive the same performance as with the Native SQL query?
Kind regards and thanks in advance for any help,
MatthiasOk, here is the the SQL explaination from the DB02 query:
SELECT STATEMENT ( Estimated Costs = 194 , Estimated #Rows = 1 )
9 COUNT STOPKEY
Filter Predicates
8 NESTED LOOPS
( Estim. Costs = 193 , Estim. #Rows = 1 )
Estim. CPU-Costs = 1,665,938 Estim. IO-Costs = 193
5 NESTED LOOPS
( Estim. Costs = 144 , Estim. #Rows = 98 )
Estim. CPU-Costs = 1,162,148 Estim. IO-Costs = 144
2 TABLE ACCESS BY INDEX ROWID BUT000
( Estim. Costs = 51 , Estim. #Rows = 93 )
Estim. CPU-Costs = 468,764 Estim. IO-Costs = 51
Filter Predicates
1 INDEX SKIP SCAN BUT000~NAM
( Estim. Costs = 6 , Estim. #Rows = 93 )
Search Columns: 1
Estim. CPU-Costs = 59,542 Estim. IO-Costs = 6
Access Predicates Filter Predicates
4 TABLE ACCESS BY INDEX ROWID BUT020
( Estim. Costs = 1 , Estim. #Rows = 1 )
Estim. CPU-Costs = 7,456 Estim. IO-Costs = 1
Filter Predicates
3 INDEX RANGE SCAN BUT020~0
( Estim. Costs = 1 , Estim. #Rows = 1 )
Search Columns: 2
Estim. CPU-Costs = 3,661 Estim. IO-Costs = 1
Access Predicates
7 TABLE ACCESS BY INDEX ROWID ADRC
( Estim. Costs = 1 , Estim. #Rows = 1 )
Estim. CPU-Costs = 5,141 Estim. IO-Costs = 1
Filter Predicates
6 INDEX UNIQUE SCAN ADRC~0
Search Columns: 4
Estim. CPU-Costs = 525 Estim. IO-Costs = 0
Access Predicates
And this is the one from the Open SQL query in ABAP:
SELECT STATEMENT ( Estimated Costs = 15,711 , Estimated #Rows = 29 )
7 NESTED LOOPS
( Estim. Costs = 15,710 , Estim. #Rows = 29 )
Estim. CPU-Costs = 3,021,708,117 Estim. IO-Costs = 15,482
4 NESTED LOOPS
( Estim. Costs = 15,411 , Estim. #Rows = 598 )
Estim. CPU-Costs = 3,018,711,707 Estim. IO-Costs = 15,183
1 TABLE ACCESS FULL BUT020
( Estim. Costs = 9,431 , Estim. #Rows = 11,951 )
Estim. CPU-Costs = 2,959,067,612 Estim. IO-Costs = 9,207
Filter Predicates
3 TABLE ACCESS BY INDEX ROWID ADRC
( Estim. Costs = 1 , Estim. #Rows = 1 )
Estim. CPU-Costs = 4,991 Estim. IO-Costs = 1
Filter Predicates
2 INDEX UNIQUE SCAN ADRC~0
Search Columns: 4
Estim. CPU-Costs = 525 Estim. IO-Costs = 0
Access Predicates
6 TABLE ACCESS BY INDEX ROWID BUT000
( Estim. Costs = 1 , Estim. #Rows = 1 )
Estim. CPU-Costs = 5,011 Estim. IO-Costs = 1
Filter Predicates
5 INDEX UNIQUE SCAN BUT000~0
Search Columns: 2
Estim. CPU-Costs = 525 Estim. IO-Costs = 0
Access Predicates
Of course I can see the difference.
But since the statements are identical, I don't understand why this difference exists
Thanks for your help!
Kind regards, Matthias -
Cannot Open SQL from Data Prep Editor (SQL Interface)
Hi,
When I Open SQL in Data Prep Editor: "There are no data sources defined. Please create one to continue."
I create a ODBC connections using the drivers bellow and I obtain always the same message ("There are no data sources defined.."):
Oracle in OraDb10g_home2
Microsoft ODBC for Oracle
MERANT OEM 5.2 32-BIT Oracle
I have installed and configured Essbase, release 11.1.1.2
Is posible that the SQL interface is not installed and configured with the Essbase Server?
How I can install and configure the SQL Interface? I need to do somethink else?
Thanks!
AssiaThrough EAS select the server and right click and select properties. then go to the environment tab(I think) it should show everything you are licensed for. If this is a System 9 or higher, you should have it automatically. If it is 7X or below,then yoes it has to be licensed
-
Open SQL is not working in EAS
Hi,
I'm trying to load the data into Essbase using the RDBMS. Following are the steps I followed:
1. Created a DataSource
2. Opened the DataPrep Editor in EAS.
3. Click on File --> Open SQL.
4. Given the Essbase server, application and Database.
Now Its throwing me the error, "There are no datasources defines. Please define one".
Anybody has idea on this problem.
Thanks in Advance
ChandanaHi Chandana,
1. This is one of the common problems people find when they first try their hands on SQL in EAS.
2. The pre requisite for this is , you need to create a data source . i.e ( control panel-> administrative tool -> data sources( ODBC).
3. After you create this at you server end ( where essbase server is running).
4. Try to open data prep editor- > open SQL, now , you should see the data source which you created in step 2
Sandeep Reddy Enti
HCC
http://hyperionconsutlancy.com/ -
Hi friends,
I'm going to read and process data in an interface coded in ABAP and OPEN SQL. To improve efficiency and reliability I'm processing the data in packets of a fixed size of rows - reading rows up to a predetermined numer into an internal table which then is processed and then finaly written back to database followed by "commit work". Then the process will continue with reading the next fixed number of rows, process them, and so on ...
The general question is, which is the most efficient way to implement this scenario?
I think of two basic approaches:
1.1) Loop over results from a cursor using FETCH NEXT CURSOR inside a LOOP appending the lines to the internal table.
2.1) Execute SELECT ... INTO TABLE <itab> FROM <table> UP TO <data packet size> ROWS.
My assumtion is that approach 2 would be the more effecient, is that correct?
The processed data will be written back to the database in one single statement:
2.2) INSERT <table> FROM TABLE <itab>
Which I assume is more efficient than doing the same using multiple inserts within a loop?
Regards,
ChristianIn native SQL you can also use the packet options.
SELECT <Fields name> appending corresponding fields of table <Internal table>
<b>package size 20000</b>
FROM <Database table name>
WHERE <Condition>.
ENDSELECT.
By using this the system will fetch the records from database table in packets [20000 records per package]
Regards
Aman -
Hi experts, how to use open sql to read data from one " maintenance view"?
i want to use this part of data within report ,so how to use open sql statement to read data from one " maintenance view"?
Hi
You can't use OPEN SQl statements to fetch data from maintenance view
You have to use only Database views
see the different types of views and the difference
The followings are different types of views:
- Database View (SE11)
Database views are implement an inner join, that is, only records of the primary table (selected via the join operation) for which the corresponding records of the secondary tables also exist are fetched. Inconsistencies between primary and secondary table could, therefore, lead to a reduced selection set.
In database views, the join conditions can be formulated using equality relationships between any base fields. In the other types of view, they must be taken from existing foreign keys. That is, tables can only be collected in a maintenance or help view if they are linked to one another via foreign keys.
- Help View ( SE54)
Help views are used to output additional information when the online help system is called.
When the F4 button is pressed for a screen field, a check is first made on whether a matchcode is defined for this field. If this is not the case, the help view is displayed in which the check table of the field is the primary table. Thus, for each table no more than one help view can be created, that is, a table can only be primary table in at most one help view.
- Projection View
Projection views are used to suppress or mask certain fields in a table (projection), thus minimizing the number of interfaces. This means that only the data that is actually required is exchanged when the database is accessed.
A projection view can draw upon only one table. Selection conditions cannot be specified for projection views.
- Maintenance View ( SE54 )
Maintenance views enable a business-oriented approach to looking at data, while at the same time, making it possible to maintain the data involved. Data from several tables can be summarized in a maintenance view and maintained collectively via this view. That is, the data is entered via the view and then distributed to the underlying tables by the system.
Please have a look at below link. It will help you.
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed06446011d189700000e8322d00/frameset.htm
for more detailed info look on:
http://www.sap-img.com/abap/what-is-the-different-types-and-usage-of-views.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap+dictionary&
Reward points for useful Answers
Regards
Anji -
Error while opening SQL source for a Data Load Rules File
Hi ,I have created Data Laod rules file.When I try to open a SQL source for this rules file (File->Open SQL) , I get an error saying "Your server does not have a SQL connection Option, Please check with your system administrator"Further I get a message "There are no data sources defined. PLease create one to continue.".I have created DSN on my Essbase server.What is the problem.What needs to done to open SQL files.Thanks.
I have Essbase 7.1 I guess for version 7.1 the SQL interface option is intalled with the Analytic server itself .Am I right?I have setup the DSN also.Please help to resolve this issue.Thanks .
-
HOW TO: Open SQL Developer from a batch file with specific tables opened
I use SQL Developer daily as I develop database intensive programs.
** Question **
How can I define a specific configuration of tabs (i.e. tables, procedures, etc) to be opened upon startup of SQL Developer?
For example, creating a .BAT file to open SQL Developer with a specific set of table tabs already opened. This will save me the time every morning I use to open SQL Developer and configure all the tables I need opened.
NOTE: I have tried various options of appending a table name to a command line starting sqldeveloper.exe. For example: ..\sqldeveloper.exe mydatabase.mytable. However, this only opens a worksheet tab with the name "mydatabase.mytable" but does not open my actual table.
Any help will be appreciated.
- Gary Daviswhat version are you using? Sql Dev 1.5?
Not an exact answer, but you could try using Table FILTER
click on your connection
right button on TABLES
click apply filter
as for your question, check out:
Re: EA1 - Automatically open connection list at startup?
or
SQL Developer -
How to get different field in two are more different table using open sql
Dear all,
This SenthilMani am very new into sap abap am having doubt in reports how get the different fields from different tables like mara,marc,mard using open sql and native sql program give me some tips to get the data .
with regards,
senthilHI ,
1) If u want to select data from more the two table then u can use FOR ALL ENTRIES.
EX ..Open sql
select matnr from mara into table t_mara.
select matnr werks from marc into table t_marc for all entries in t_mara where matnr = t_mara-matnr.
2) U can join more than one table.
ex:
select mara~matnr
marc~werks
from mara join marc into table t_maramarc
on maramatnr = marcmatnr
3) Using native sql ...only u can use JOIN statement -
Parsing an OPEN SQL select statement
Hi all,
I want to parse an open SQL select statement to get the list of tables and the corresponding fields in the select statement.
Is there some ABAP-internal syntax from the SAP Database Interface that does this? or is the only option to do this is to manually break the statement?
Thanks.
GirishHi,
I doubt if there is something like that available to use. It think you will have to write a parser for yourself.
Regards -
TestStand Open SQL Statement does not support SQL's ORDER BY clause???
TestStand 1.0.3
Windows 2000 SP1
SQL Server 2000 Personal
You've got to be kidding me...
It appears that the built-in TestStand Open SQL Step does NOT support the
"ORDER BY" clause in the SELECT statement, even though the documentation
says it does. Is this true?
I have an Open SQL Statement query:
"SELECT * FROM [MyTable] WHERE ([Batch ID]=1234)"
it works fine, returning a correct record count 120 records. If I change
the Open SQL Statement query simply by adding an ORDER BY clause, such as:
"SELECT * FROM [MyTable] WHERE ([Batch ID]=1234) ORDER BY [MyField] ASC"
it returns a record count of zero. I know that "MyField" exists in the
MyTable table and contains valid data. The
second query works fine in SQL
Server Enterprise Manager.
Am I missing something? Is it true that the TestStand Open SQL Step does
NOT support the "ORDER BY" clause? If not, what &#$!ing good is it and why
does the manual state it is supported? Is there any other way using just
the TestStand steps to order a database recordset on one or more fields?
Any help would be appreciated.
Grrrrr....
Bob Rafuse
Etec Inc.> Bob -
> The database step types do not do anything special to the SQL command
> that you give it. The step just passes the command to the ADO
> provider. I tried a simple query using the step types with the
> following command,
>
> "SELECT UUT_RESULT.* FROM UUT_RESULT WHERE ([UUT_SERIAL_NUMBER] =
> 12345) ORDER BY [EXECUTION_TIME] ASC"
>
> and this return the expected results and the record count parameter
> was as expected. I tried this on TS 1.0.2 and TS 2.0 with MS Access
> 2000 and MS SQL Server 7.0. I do not have MS SQL Server 2000 at this
> time.
>
> It would be surprised if the step types are messing something up.
I've been doing some experimenting over the past couple of days. Simple,
one-table queries seem to handle the ORDER BY clause fine. Th
ings seem to
get messed up when I try multi-table queries with ORDER BY clause with the
TestStand database steps. I get no errors but the returned record counts
are always 0 with the ORDER BY and positive without the ORDER BY. The exact
same queries work fine in Visual Basic/ADO and the SQL Server Query
Analyzer.
> Questions:
> 1. Have you verified whether the data is actually returned even though
> the record count is zero?
Hmmm... yes data IS getting returned (at least on the two instances I just
checked), but the record count is always zero. I was not proceeding with
processing if the record count was 0.
Still... I don't know how to loop through the recordset without knowing how
many records there are an not eventually generate an error by passing EOF.
Is there another way using the TestStand database steps to determine a) the
number of records in the recordset or b) when I'm at EOF?
> 2. Are you using any advanced options on the Opend SQL Statement step
> type, specifically
the cursor type set to forward only? Forward only
> cursors do not allow for record counts.
Everything on the Advanced tab of the Open SQL Statement step is set to "Use
Default".
Bob. -
The ABAP/4 Open SQL array insert results in duplicate database records
Hi,
Iam getting following error :
The ABAP/4 Open SQL array insert results in duplicate database records.
Error in ABAP application program.
The current ABAP program "SAPLV60U" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
" Information on where terminated
The termination occurred in the ABAP program "SAPLV60U" in "VBUK_BEARBEITEN".
The main program was "SAPMSSY4 ".
The termination occurred in line 503 of the source code of the (Include)
program "LV60UF0V"
of the source code of program "LV60UF0V" (when calling the editor 5030).
Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
the
procedure "VBUK_BEARBEITEN" "(FORM)" but was not handled locally, not declared
in the
RAISING clause of the procedure.
The procedure is in the program "SAPLV60U ". Its source code starts in line 469
of the (Include) program "LV60UF0V "."
Please assist how to proceed further ..
Many thanks
Mujeeb.Sorry, THe correct note is 402221.
Description from the note
<< Please do not post SAP notes - they are copyrighed material >>
Edited by: Rob Burbank on Feb 22, 2009 3:46 PM -
CREATE VIEW in ABAP (Open SQL or Native SQL)
Hi all you experts!
I want to create a VIEW in ABAP. I have created Table Views using ABAP Dictionary (in transaction SE11), I don't have any problem with them.
But, what I need is to create a dynamic view, I mean, a view that can be created/replaced (or modified) at runtime. Is this possible with SAP Open SQL, I don't think so... that is why I tried to created using native SQL but it is not working.
Here is the code:
EXEC SQL.
CREATE VIEW [ZMXRFIV_GLPCA]
AS SELECT
T1.GL_SIRID,
T1.POPER,
T1.RBUKRS,
T1.RPRCTR,
T1.RACCT,
T1.HSL
FROM
GLPCA T1
INNER JOIN
SKA1 T2
ON
T1.RACCT = T2.SAKNR
WHERE
T1.RVERS = '000'
AND T1.RYEAR = '2008'
AND T1.KOKRS = 'PI01'
AND T2.KTOPL = 'PI00'
AND T2.XBILK <> 'X'.
ENDEXEC.
I have tried using quotes (") for the view name, parenthesis and even using only the name but this make no difference.
Do any of you experts have any idea?
PS: After creating the view I need to do a SELECT INTO TABLE to that view and finally delete this view and continue working with the data on the internal table.Hi ,
oh yes it is an object (well, how the database should handle it in any context if it wasn't)
i.e. for ORACLE you would have several thousands of them:
select count(*) from dba_objects where object_type ='VIEW'
If you avoid some kind of foreground processing (i.e. pull the data over the network) and handle the processing inside the database it can improve somehow performance a little (i.e. using the retieved rows of the view to stuff into a database table directly). But his may not always possible...
bye
yk -
ABAP/4 Open SQL array insert results in duplicate databaserecordsfor pk13
Hi Experts, when I am working with pk13n tranaction iam getting an error message stating that update was terminated by user. when i am checking with st22 it gives the following message. please give the solution , iam sending the code as well.
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
in
procedure "SAVE_DATA" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
If you use an ABAP/4 Open SQL array insert to insert a record in
the database and that record already exists with the same key,
this results in a termination.
(With an ABAP/4 Open SQL single record insert in the same error
situation, processing does not terminate, but SY-SUBRC is set to 4.) please find the below code please give the solution for this error message.
1 *eject
2 *----
3 * Verbuchen der Daten *
4 *----
5 FORM SAVE_DATA.
6
7 DATA: lf_menge LIKE ekpo-menge VALUE 0, "717464
8 lf_netwr LIKE ekpo-netwr VALUE 0.
9
10 * Einteilungen löschen --> Array Delete aus Tabelle DEKET
11 DESCRIBE TABLE DEKET LINES SY-TFILL.
12 IF SY-TFILL GT 0.
13 DELETE EKET FROM TABLE DEKET.
14 IF SY-SUBRC NE 0.
15 MESSAGE A865.
16 ENDIF.
17 EKET_DELETE = EKET_DELETE + SY-DBCNT.
18 REFRESH: DEKET.
19 CLEAR : DEKET.
20 ENDIF.
21
22 * Einteilungen hinzufügen --> Array Insert aus Tabelle IEKET
23 DESCRIBE TABLE IEKET LINES SY-TFILL.
24 IF SY-TFILL GT 0.
>> INSERT EKET FROM TABLE IEKET.
26 IF SY-SUBRC NE 0.
27 MESSAGE A864.
28 ENDIF.
29 EKET_INSERT = EKET_INSERT + SY-DBCNT.
30 REFRESH: IEKET.
31 CLEAR : IEKET.
32 ENDIF.
33
34 * Check whether the qty in EKPO-MENGE is correct: note 717464
35 SELECT SUM( menge ) FROM eket INTO lf_menge
36 WHERE ebeln = ekpo-ebeln
37 AND ebelp = ekpo-ebelp.
38 IF sy-subrc = 0 AND ekpo-menge <> lf_menge.
39 IF ekpo-ktmng <> 0.
40 refe1 = ekpo-zwert * lf_menge / ekpo-ktmng.
41 ELSE.
42 refe1 = ekpo-zwert * lf_menge / 1000.
43 ENDIF.
44 IF refe1 > maxwert.Hi,
Well I don't know why you have duplicates, this is a functionnal issue. But you get the dump due the the message number 864 that triggers the abend... Changing the message type to 'E', 'S' or 'I' will prevent the dump but I guess this message has a good reason to be
Kr,
Manu.
Maybe you are looking for
-
Error while reading raw file created in previous task using raw file destination
I am reading a flat file and creating an raw file using raw file destination. path of the raw file is in a variable. now I am reading the raw file using the rawfile source component. I am able to execute if the .raw file is available. But when we
-
I cannot open or print pdf. files with Adobe on my windows 8
I have downloaded Adobe Acrobat but can only read files not print them - even when I save them.
-
Pasting from Illustrator to Photoshop doesn't maintain aspect ratio
I have vector artwork that is not aligned to a pixel grid in Illustrator. In CS5, I would be able to paste the vector object as a smart object into Photoshop file that was larger than the illustrator image and resize larger while holding shift to kee
-
Auto answer after a few rings?
I use to have a phone that had the autoanswering option in the setting while hooked to a headset. It would be very convenient on the IPhone cause I have a telecom system for my motorcycle and i'd like my IPhone to auto answer after a few rings. Any i
-
Hi, Errors "A text is needed for predefined fixed structure" when i save the data entry layout. how to solve it? thanks in advance