Is there a way to excute a Native SQL statements simply?
I heard that there is a standard transaction code to test a Native SQL statement.
Please let me know if you are know that.
Thank you!
hi,
Try this in SE38.
data: itab type mara-matnr.
exec sql performing a1.
select matnr from mara into :itab
endexec.
form a1.
write:/ itab.
endform.
Note: The sql stmt with in exec sql and endexec
'll not be checked.
Thanks.
Arunprasad.P
Similar Messages
-
Is there a way to include a native executable into extension package?
Hello,
I need to call some native code from the CS extension using the NativeProcess API.
Is there any way to distribute a native executable file inside the extension package?
It looks like there is a way to include an "ordinary" file into a hybrid extension, however the file has to be installed into one of pre-defined locations (such as "$applicationsupport").
The problem is that in order to create a NativeProcess object in the extension code, I need to know the exact path of the executable, and I can't seem to find a way to find out where exactly the executable was placed by the extension installer.
Is there a way to install an executable into the extension folder (which I can get using CSXSInterface.getInstance().getSystemPath(APPLICATION))?
Thank you,
AnatolyIs there a way to install an executable into the extension folder (which I can get using CSXSInterface.getInstance().getSystemPath(APPLICATION))?
Yep, the answer depends on how you're packaging your extension.
If you're using Extension Builder, you just need the executable to be automatically copied to the bin-debug folder during the build process. The simplest way to achieve this is to put the executable underneath the src/ folder. Another option is to make your own resources/ directory and add it to the project source path (see the section "Adding resource folders to the project source path" here: http://help.adobe.com/en_US/Flex/4.0/UsingFlashBuilder/WS6f97d7caa66ef6eb1e63e3d11b6c4ce74 9-7fd8.html). Once you've got it copying to the bin-debug folder you're set, you can launch or export as usual and your executable will end up in the extension folder.
If you're using ucf.jar, just make sure that your executable is in the extension folder you're packaging.
You shouldn't need to create a hybrid extension in order to have a CS extension that uses NativeProcess. -
Is there a way to get long running SQL Agent jobs information using powershell?
Hi All,
Is there a way to get long running SQL Agent jobs information using powershell for multiple SQL servers in the environment?
Thanks in Advance.
--HuntI'm running SQL's to fetch the required details and store it in centralized table.
foreach ($svr in get-content "f:\PowerSQL\Input\LongRunningJobsPowerSQLServers.txt"){
$dt = new-object "System.Data.DataTable"
$cn = new-object System.Data.SqlClient.SqlConnection "server=$svr;database=master;Integrated Security=sspi"
$cn.Open()
$sql = $cn.CreateCommand()
$sql.CommandText = "SELECT
@@SERVERNAME servername,
j.job_id AS 'JobId',
name AS 'JobName',
max(start_execution_date) AS 'StartTime',
max(stop_execution_date)AS 'StopTime',
max(avgruntimeonsucceed),
max(DATEDIFF(s,start_execution_date,GETDATE())) AS 'CurrentRunTime',
max(CASE WHEN stop_execution_date IS NULL THEN
DATEDIFF(ss,start_execution_date,stop_execution_date) ELSE 0 END) 'ActualRunTime',
max(CASE
WHEN stop_execution_date IS NULL THEN 'JobRunning'
WHEN DATEDIFF(ss,start_execution_date,stop_execution_date)
> (AvgRunTimeOnSucceed + AvgRunTimeOnSucceed * .05) THEN 'LongRunning-History'
ELSE 'NormalRunning-History'
END) 'JobRun',
max(CASE
WHEN stop_execution_date IS NULL THEN
CASE WHEN DATEDIFF(ss,start_execution_date,GETDATE())
> (AvgRunTimeOnSucceed + AvgRunTimeOnSucceed * .05) THEN 'LongRunning-NOW'
ELSE 'NormalRunning-NOW'
END
ELSE 'JobAlreadyDone'
END)AS 'JobRunning'
FROM msdb.dbo.sysjobactivity ja
INNER JOIN msdb.dbo.sysjobs j ON ja.job_id = j.job_id
INNER JOIN (
SELECT job_id,
AVG
((run_duration/10000 * 3600) + ((run_duration%10000)/100*60) + (run_duration%10000)%100)
+
STDEV
((run_duration/10000 * 3600) + ((run_duration%10000)/100*60) + (run_duration%10000)%100) AS 'AvgRuntimeOnSucceed'
FROM msdb.dbo.sysjobhistory
WHERE step_id = 0 AND run_status = 1
GROUP BY job_id) art
ON j.job_id = art.job_id
WHERE
(stop_execution_date IS NULL and start_execution_date is NOT NULL) OR
(DATEDIFF(ss,start_execution_date,stop_execution_date) > 60 and DATEDIFF(MINUTE,start_execution_date,GETDATE())>60
AND
CAST(LEFT(start_execution_date,11) AS DATETIME) = CAST(LEFT(GETDATE(),11) AS DATETIME) )
--ORDER BY start_execution_date DESC
group by j.job_id,name
$rdr = $sql.ExecuteReader()
$dt.Load($rdr)
$cn.Close()
$dt|out-Datatable
Write-DataTable -ServerInstance 'test124' -Database "PowerSQL" -TableName "TLOG_JobLongRunning" -Data $dt}
You can refer the below link to refer out-datatable and write-dataTable function.
http://blogs.technet.com/b/heyscriptingguy/archive/2010/11/01/use-powershell-to-collect-server-data-and-write-to-sql.aspx
Once we've the table details, I'm sending one consolidated email to automatically.
--Prashanth -
Who to use Native SQL statements in ABAP
hi all,
who to use native sql staements in abap bypassing Application server.
with regards,
suresh babu aluri.Hi
Native SQL statements define an area in an ABAP program in which one or more Native SQL statements are to be carried out. The area between EXEC and ENDEXEC is not completely checked by the syntax check. The statements entered there are passed to the Native SQL interface and processed there as follows:
Almost all SQL statements that are valid for the addressed database system can be included between EXEC and ENDEXEC, in particular the DDL statements. These SQL statements are passed from the Native SQL interface to the database system largely unchanged. The syntax rules are specified by the database system, in particular the case sensitivity rules for database objects. If the syntax allows a separator character between individual statements, you can include several Native SQL statements between EXEC and ENDEXEC. Generally, the semicolon ( is used as the separator character.
You can also include SAP-specific Native SQL language elements between EXEC and ENDEXEC. These statements are not passed directly from the Native SQL interface to the database, but are converted appropriately.
All Native SQL statements bypass SAP buffering.
The ENDEXEC statement sets sy-dbcnt to the number of table rows processed in the last Native SQL statement. After implicit cursor processing with PERFORMING, sy-dbcnt contains the total number of lines read.
Programs with Native SQL statements are generally dependent on the database system used, so that they cannot be executed in all ABAP systems. This is especially true for the examples in this section, which was written for Informix database systems.
Example
Inserting two rows in the database table SCARR. If neither of these rows exists, sy-subrc is set to 0 by ENDEXEC and sy-dbcnt to 1. Otherwise, an exception is raised and handled.
DATA: exc_ref TYPE REF TO cx_sy_native_sql_error,
error_text TYPE string.
TRY.
EXEC SQL.
INSERT INTO scarr
(MANDT, CARRID, CARRNAME, CURRCODE, URL)
VALUES ('000', 'FF', 'Funny Flyers', 'EUR',
'http://www.ff.com');
INSERT INTO scarr
(MANDT, CARRID, CARRNAME, CURRCODE, URL)
VALUES ('000', 'EF', 'Easy Flyers', 'EUR',
'http://www.ef.com');
ENDEXEC.
CATCH cx_sy_native_sql_error INTO exc_ref.
error_text = exc_ref->get_text( ).
MESSAGE error_text TYPE 'I'.
ENDTRY.
Reward points if useful
Regards
Anji -
How to use Native SQL statement in JDBC receiver interface
Dear All,
Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
Select Field1 Field2 from TABLE Where Field3 like "%Name'
I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
Hence I need to know:-
1. What message mapping I should use in case if I have to use Native SQL statement.
2.What operation mapping I should use in case if I have to use Native SQL statement.
If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
3 .How do to go about it to do the Java mapping.
Thanks
Ameet>
Ameet Deshpande wrote:
> Dear All,
>
> Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
>
> "
> Select Field1 Field2 from TABLE Where Field3 like "%Name'
> "
> I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
>
> http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
> http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
>
> The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
>
> Hence I need to know:-
>
> 1. What message mapping I should use in case if I have to use Native SQL statement.
> 2.What operation mapping I should use in case if I have to use Native SQL statement.
> If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
> 3 .How do to go about it to do the Java mapping.
>
> Thanks
> Ameet
You can use a stored procedure, and call it from jdbc receiver adapter.
I also solve this issue, with a DBLookup in message mapping. You can refer to my blog, and this usefull 3d:
http://simonlesflex.wordpress.com/2010/12/07/pi-oracle-dblookup/
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler -
Is there any way to hook into the SQL report pagination process?
I have a SQL report (based on EMP) with a radiogroup row selector.
The scenario 1 and 2 are in place
1) When the employee row radio group is clicked the P900007_JOB the text item is populated with the JOB for the employee.
2) When the page is initially displayed or submitted via the button the first row’s radio group is programmatically clicked and therefore populates the additional job information in P900007_JOB
Info (radio Group) Employee No Name
(+) 7369 SMITH
() 7499 ALLEN
() 7521 WARD
P900007_JOB CLERK
1-3 Next>
Once the report has been displayed and the next or previous pagination is used then none of the radio groups will be selected and the data in the P900007_JOB text item will still display the job of the last selected employee row.
What I require is on pagination some sort of mechanism to either
a) Call the page_init() that should then set the first row as selected and populate the text item via the programmatic click. (preferred option)
b) OR blank out the additional text item P900007_JOB.
Is there any way to hook into the pagination process?
I have a work around – Set the ‘Enable Partial Page Refresh’ to ‘No’ but this means a full refresh every time the pagination is used.
Details of my page
Report Region (Based on EMP table) – radio group as a row selector
select APEX_ITEM.RADIOGROUP(1,EMPNO,'X21',null) CHECKRG, EMPNO,
ENAME,
JOB
from EMP
Report Attributes -
Report template :- P900007_ROWTEMPLATE (custom template see later)
Report Attributes Substitution :- id="emp_report" (used in page_init see later)
Enable Partial Page Refresh :- Yes
Columns – All columns are selected as show but job is left out of the template below.
P900007_JOB - Text item in report region (disabled does not save state). Populated with the employees job when the radio group is clicked.
Control region :- HTML region that just holds a button <GO> just to submit the page and redirect back to the same page.
P900007_ROWTEMPLATE (named column row template)
Row template 1
<tr style="cursor: hand; cursor: pointer;" onmouseover="row_mouse_over(this, 1)" onmouseout="row_mouse_out(this, 1)" #HIGHLIGHT_ROW# ">
<td class="t15data" onclick="selectRow('#JOB#');">#CHECKRG# </td>
<td class="t15data">#EMPNO# </td>
<td class="t15data">#ENAME# </td>
</tr>
Before rows
<table class="t15standard" summary="" #REPORT_ATTRIBUTES# id="report_#REGION_STATIC_ID#" >
<th class="t15header" #ALIGNMENT# >Info</th>
<th class="t15header" #ALIGNMENT# >Employee Number</th>
<th class="t15header" #ALIGNMENT# >Name</th>
After Rows
<tr>
<td colspan="99" class="t15afterrows">
<span class="left">#EXTERNAL_LINK##CSV_LINK#</span>
<table style="float:right;text-align:right;" summary="pagination">
#PAGINATION#</table>
</td>
</tr>
</table>
*Javascript in page Header*
<script src="#WORKSPACE_IMAGES#apex_show_hide_region.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
function selectRow(pJob)
/* console.log('pete got here!'+pJob)*/
$x('P900007_JOB').value =pJob;
/* Start Page init*/
function *page_init*()
/* Used to set radio groups on reports */
/*console.log('START pete got here!');*/
var is_checked = false;
var l_check = $x_FormItems($x('emp_report'), 'radio');
/*Loop and set flag if checked*/
for(var i=0,len=l_check.length;i<len;i++)
if(l_check.checked){
is_checked = true;
/*end loop*/
/*If none checked force a click*/
if(!is_checked){
/*no longer need as doing click below*/
l_check[0].checked=true;
/*Force a click on the first radio group - extra details should then be
populated*/
var l_click = l_check[0].click();
/* console.log('END pete got here!');*/
/*END page_init*/
// -->
</script>
*Application shared component.* – This fires a DB packaged procedure when the page is loaded.
P330_PART_NO_HIST
Process Point On load after Body region
Process Text show_hide_memory.part_no_history_details();
*Packaged Procedure* – This kicks off the page_init javascript in the header (earlier) to click on the radio group in the first row.
PROCEDURE part_no_history_details AS
BEGIN
htp.prn('<script type="text/javascript">' || CHR(10));
htp.prn('<!--' || CHR(10));
htp.prn('page_init();'|| CHR(10));
htp.prn('//-->' || CHR(10));
htp.prn('</script>' || CHR(10));
END part_no_history_details;
Thanks Pete
Edited by: Pete @ LSC on 26-Jan-2010 06:56Anybody any ideas? Should I be looking down the route of using my own pagination buttons and adding my code to this?
There seems to be a routine $a_report that I can use for the pagination but I am finding it difficult to get the current first and last record values that I would need to pass. I've seen references to below in the form but when I'm using partial refresh they do not seem to change.
wwv_flow.g_flow_current_min_row
wwv_flow.g_flow_current_max_rows
wwv_flow.g_flow_current_rows_fetched
wwv_flow.g_request
Thanks Pete -
Native SQL Statement help!
Hi guys,
I need some help here.
I have a requirement to select from Microsoft SQL database
Question
How do I select with RANGE internal tables? As you can see, I have 4 range tables for this.
BElow are my codes
EXEC SQL.
CONNECT TO 'CONNECTION_NAME'
ENDEXEC.
IF sy-subrc <> 0.
MESSAGE 'Unable to connect to CONNECTION_NAME' TYPE 'E' DISPLAY LIKE 'I'.
RETURN.
ENDIF.
* Define database cursor
EXEC SQL.
OPEN dbcur FOR
SELECT name1, zvctk, kunnr, yyear, mmonth, matnr,
qty, zopcd, bstnk, wekunnr
FROM <TABLE_NAME>
WHERE month IN i_month
AND yyear IN i_year
AND kunnr IN i_kunnr
AND bstnk IN i_bstnk
ENDEXEC.
* Fill itab
DO.
EXEC SQL.
FETCH NEXT dbcur INTO :l_dest-name1,
:l_dest-zvctk,
:l_dest-kunnr,
:l_dest-yyear,
:l_dest-mmonth,
:l_dest-matnr,
:l_dest-qty,
:l_dest-zopcd,
:l_dest-bstnk,
:l_dest-wekunnr
ENDEXEC.
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND l_dest TO it_dest.
ENDIF.
ENDDO.
its giving me a shortdump
>>>>> OPEN dbcur FOR
35 SELECT name1, zvctk, kunnr, yyear, mmonth, matnr,
36 qty, zopcd, bstnk, wekunnr
37 FROM v_promise_sa
38 WHERE month IN i_month[]
39 AND yyear IN i_year[]
40 AND kunnr IN i_kunnr[]
41 AND bstnk IN i_bstnk[]
Error message:
Database error text........: "[Microsoft][SQL Server Native Client 10.0][SQL
Server]Incorrect syntax near 'i_month'."
Database error code........: 102
Triggering SQL statement...: "SELECT name1, zvctk, kunnr, yyear, mmonth, matnr,
qty, zopcd, bstnk, wekunnr FROM <TABLE_NAME> WHERE month IN i_month[] AND
yyear IN i_year[] AND kunnr IN i_kunnr[] AND bstnk IN i_bstnk[]"
Internal call code.........: "[DBDS/NEW DSQL]"
Please check the entries in the system log (Transaction SM21).
Can anyone guide me? If I do not enter the where clause, it is selecting fine.
Appreciate it guys! Thanks in advance!lol, Come guys, don't judge me by just my forum nick man. It was just something random during registration a few years back...was indeed new in ABAP language :P
But anyway, the table v_promimse_sa is not in the DDIC, its some microsoft MYSQL database or something.
anyway what I did now:
EXEC SQL.
CONNECT TO 'MSSQL_PROMISE'
ENDEXEC.
IF sy-subrc <> 0.
MESSAGE 'Unable to connect to MSSQL_PROMISE' TYPE 'E' DISPLAY LIKE 'I'.
RETURN.
ENDIF.
* Define database cursor
EXEC SQL.
OPEN dbcur FOR
SELECT name1, zvctk, kunnr, yyear, mmonth, matnr,
qty, zopcd, bstnk, wekunnr
FROM v_promise_sa
WHERE mmonth = :i_month
AND yyear = :i_year
* AND ( kunnr BETWEEN :i_kunnr-low AND :i_kunnr-high )
* AND ( bstnk BETWEEN :i_bstnk-low AND :i_bstnk-high )
ENDEXEC.
* Fill itab
DO.
EXEC SQL.
FETCH NEXT dbcur INTO :l_dest-name1,
:l_dest-zvctk,
:l_dest-kunnr,
:l_dest-yyear,
:l_dest-mmonth,
:l_dest-matnr,
:l_dest-qty,
:l_dest-zopcd,
:l_dest-bstnk,
:l_dest-wekunnr
ENDEXEC.
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND l_dest TO it_dest.
ENDIF.
ENDDO.
* EXEC SQL.
* CLOSE dbcur
* ENDEXEC.
DELETE it_dest WHERE kunnr NOT IN i_kunnr
AND bstnk NOT IN i_bstnk.
Well, after checking with the functional person, there are only 3 records so I guess the selection + filtering is working. -
Is there a built in package show components sql statement
is there an exisitng package that will break down the components of a sql statement, as in the where clause, columns, etc?
thanks, i had pointed him to that package but it apparenty didn't meet his needs.
he may have to write something if there isn't a built in package that work. -
Is there a way of transitioning to a random state on the click of a button?*
Hello I'm in need of some help here with coding a button to play a transition to a random state... is this possible? I read up on a math action script that looked like it might work but I'm basically uneducated in coding. The idea is to play a random swf video I designed in aftereffects. Any help would be much appreciated. Small reward if someone can help me make it fully work!
How are the videos laid out in your Catalyst project? Is each one in a different state? Or do you have single state that you use as your video player state?
-
Question : Is there a way to do a Direct SQL write using AFCs
We are looking to integrate a service that will pull values from an external database table. Also, we would like another service to be able to update those database table values.
We are looking to integrate a service that will pull values from an external database table. Also, we would like another service to be able to update those database table values. Example. Service for ordering a Blackberry, depending on some values selected (type, model, carrier, etc) would then be able to have a pricing structure pulled in from an external table. We would like for the non technical people to be given access to another service, with which they could simply enter the data via submitting a requisition that would update the table with the data that the previous service would then be able to access.
I had a few thoughts: ISF code to executing a SQL Update, a service Link Integration that would push data to an external webservice that would then update the table, but I am specifically asking if the OOTB AFCs can be levearagted using congured datasource to write to that table instead of just read from it.Hi Nelson,
The answer using SQL purely we've had is 'No' - the sql driver implementation only supports basic Select functionality. Our requirements were more along the lines of more complex SQL calls (common table expressions, etc) but the same constraint applied.
We got around it by having a function created on the SQL server which accepted 2 parameters and returned a handful of fields so in an onLoad AFC for us, we have 'findmanager(#namespace#,'char') and then map it to some fields. I think it could be applied here, a function that accepts X parameters and writes them in to a table for you at the onSubmit moment or some such.
Hope this helps!
Cheers,
Ant -
Dynamic table name in FROM clause of an abap native sql statement
Hi Frenz,
Kindly help me with the solution. Thank you.
data: tabname type string.
tabname = 'CRMD_ORDERADM_H'.
EXEC SQL.
SELECT count( * )
FROM tabname into :count
ENDEXEC.
This piece of the code is giving me a dump. Kindly let me know how can i use tabname in this context. It is a parameter on the selection screen.
Thank you,
Kamal
Edited by: Rob Burbank on May 20, 2009 10:02 AMHi
try using ( )
EXEC SQL.
SELECT count( * )
FROM ( tabname ) into :count
ENDEXEC.
hope this helps!
haven't tested it in from section but it worked for me in where section
regards jacko
Edited by: Jacko1986 on May 20, 2009 3:55 PM -
Is there a way to output SQL being sent to database from cfm page?
I am getting a SQL Error (Incorrect sytax near ','), so I was wondering if there was a way to output the actual sql statement being sent?
You don't see stuff like this:
The error occurred in D:\DW\dwtest\Dan\abc.cfm: line 70
68 : <cf_testdb dsn="copathsq">
69 :
70 : <cfquery name="q1" datasource="copathsq" result="x">
71 : select 'test'
72 : from -
Is there a way to do a global transaction?
I have a save procedure for a large server infrastructure that must maintain a rollback point in-case of hardware failures.
The procedure consists of hundreds of different stored procedure calls and a very large set of data to be deleted/inserted/updated.
Is there a way to set an entire database state to be in a transaction instead of just a single stored procedure? It doesn't have to be timed or have a automatic rollback if I can manually cause a rollback to happen.
We use 2012 Express for development purposes but 2012 Standard in production; we can upgrade if necessary.You can use the restore to mark feature. Your database will need to have its recovery model set to full or bulk-logged. You will then set a transaction with a mark.
https://msdn.microsoft.com/en-us/library/ms187014.aspx
Basically, you will need to start a transaction using the "with mark" statement.
BEGIN TRANSACTION ListPriceUpdate
WITH MARK 'UPDATE Product list prices';
Then you can restore your database to that mark:
RESTORE DATABASE AdventureWorks
FROM AdventureWorksBackups
WITH FILE = 3, NORECOVERY;
GO
RESTORE LOG AdventureWorks
FROM AdventureWorksBackups
WITH FILE = 4,
RECOVERY,
STOPATMARK = 'ListPriceUpdate';
I don't see any version specific restrictions.
Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com -
TIME_OUT in SAP when accessing external Oracle table thru native SQL
Hi,
I have a problem in one of my native SQL statement. It takes a long time accessing the table considering that the number of records to be retrieved is only small.
Something happened on the Oracle system. But, stilll to be confirmed. Before, there wasn't any issue. Looking further, I found that when the value in the where clause equated is a literal (meaning the value is not declared in DATA or CONSTANTS in the ABAP Program)
Example
1.
EXEC.
WHERE FIELD = '1'
ENDEXEC.
instead of
2.
CONSTANTS: c_1 value '1'.
EXEC.
WHERE FIELD = c_1
ENDEXEC.
i found that when the way of coding is same as Example 1, a time-out error occurs. But when in Example 2, no issue.
Can someone explain this? is their something that could affect SAP with respect to Oracle configuration?
Thanks!I wonder if you could share the outline of your code to access an external oracle database. I've just been given the assignment to do just that, but don't know where to start.
thx,
Mike DeGuire -
Native sql DBCO, CONNECT statement short dump
Hi ALL ,
I am facing the problem here. please help me out in this.
i am trying to connce to the external database MSS, i made all the entries in the DBCO t-code and writing the follwoing native sql statement.
EXEC SQL.
CONNECT TO 'AAJ' AS 'V'
ENDEXEC.
EXEC SQL.
SET CONNECTION 'V'
ENDEXEC.
The above statement is not giving any error when i activate it but when i execute it is giving me shortdump error .
I already maintan entries in DBCON table or DBCO t-code
And also tel me once it is connect how can i access the data from MSS (Microsoft sql server)i mean what kind of statement.
helpfull answer will be rewarded.
Anees
9886358645
Message was edited by:
anees jawadNative SQL
Open SQL allows you to access database tables declared in the ABAP Dictionary regardless of the database platform that you R/3 System is using. Native SQL allows you to use database-specific SQL statements in an ABAP program. This means that you can use database tables that are not administered by the ABAP Dictionary, and therefore integrate data that is not part of the R/3 System.
As a rule, an ABAP program containing database-specific SQL statements will not run under different database systems. If your program will be used on more than one database platform, only use Open SQL statements.
Native SQL Statements in ABAP Programs
To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:
EXEC SQL [PERFORMING )
The parameters are separated by commas. You must also specify whether the parameter is for input (IN), output (OUT) or input and output (INOUT). For further information, refer to SAP Note 44977.
EXEC SQL
EXECUTE PROCEDURE proc1 ( IN , OUT :y )
ENDEXEC.
Cursor Processing
Cursor processing in Native SQL is similar to that in Open SQL:
OPEN
ENDIF.
ENDDO.
EXEC SQL.
CLOSE c1
ENDEXEC.
This example opens a cursor, reads data line by line, and closes the cursor again. As in Open SQL, SY-SUBRC indicates whether a line could be read.
Data Types and Conversions
Using Native SQL, you can
Transfer values from ABAP fields to the database
Read data from the database and process it in ABAP programs.
Native SQL works without the administrative data about database tables stored in the ABAP Dictionary. Consequently, it cannot perform all of the consistency checks used in Open SQL. This places a larger degree of responsibility on application developers to work with ABAP fields of the correct type. You should always ensure that the ABAP data type and the type of the database column are identical.
If the database table is not defined in the ABAP Dictionary, you cannot refer directly to its data type. In this case, you should create a uniform type description in the ABAP Dictionary, which can then be used by all application programs.
If the table is defined in the ABAP Dictionary, you should remember that the sequence of fields in the ABAP Dictionary definition may not be the same as the actual sequence of fields in the database. Using the asterisk (*) in the SELECT clause to read all columns into a corresponding work area would lead to meaningless results. In the worst case, it would cause an error.
The Native SQL module of the database interface passes a description of the type, size, and memory location of the ABAP fields used to the database system. The relevant database system operations are usually used to access and convert the data. You can find details of these operations in the manuals for the programming interface of the relevant database system. In some cases, Native SQL also performs other compatibility checks.
The documentation from the various database manufacturers provides detailed lists of combinations of ABAP data types and database column types, both for storing ABAP field values in database tables (INSERT, UPDATE) and for reading database contents into ABAP fields (SELECT). You can also apply these descriptions for the input and output parameters of database procedures. Any combinations not listed there are undefined, and should not be used.
The following sections provide details of the data types and conversions for individual databases. Although they are database-specific, there are also some common features.
Recommended type combinations are underlined. Only for these combinations is behavior guaranteed from release to release. For any other combinations, you should assume that the description only applies to the specified release.
The results of conversions are listed in a results column:
"OK": The conversion can be performed without loss of data.
Operations that fail are indicated by their SQL error code. Errors of this kind always lead to program termination and an ABAP short dump.
In some cases, data is transferred without an SQL error occurring. However, the data is truncated, rounded, or otherwise unusable:
Right truncation.
"Left" or "right" applies to the normal way of writing a value. So, for example, if a number is truncated, its decimal places are affected.
: Left truncation
: Number is rounded up or down during conversion
: A number that was "too small" is rounded to 0 (underflow)
: The conversion result is undefined.
There are several possible results. The concrete result is either not known at all, or can only be described using a set of rules that is too complicated for practical use.
: The conversion returns the SQL value NULL.
: The conversion is performed without fields and unchecked.
The original data is converted, but without its format being checked. The result may therefore be a value invalid for the result type, which cannot be processed further. An example of this is a date field containing the value "99999999" or "abcdefgh" after conversion.
Combinations of ABAP data type and database column type can be divided into finer subcategories. Here, for example, using the transfer direction ABAP ® database (INSERT, UPDATE):
If the width of the ABAP field is greater than that of the database column, the ABAP field may contain values for which there is not enough space in the database column. This can produce other cases: The concrete data value in ABAP finds space in the database column, or not.
If the ABAP field is at most as long as the database column, there is always space for the ABAP value in the database column.
Some types, such as numeric columns, expect values in a particular format. This is particularly important in connection with character types, for example, when you want to write an ABAP character field (type C) into an integer column.
Native SQL for Oracle
Native SQL for Informix
Native SQL for DB2 Common Server
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm
Maybe you are looking for
-
BUG - German localization / Translation of Preference
Hello, I just tried to find the option to display the line numbers in the code editor. The german preference dialog hides this option in Code-Editor -> Zeilenzwischenraum. Zeilenzwischenraum means line spacing, the space between two lines, while Line
-
'Time' dimension hierarchy Required
Dear all, We came across one requirement where 'Time' dimension having 365 days along with month, quarter, halfyear and yeartot as their ancestor. "Time" Dimension hierarchy: Time - Yeartot - Half year - Quarters - Months - Days Also we need alternat
-
How to open PDF file from WinHelp
Hello everyone I hope someone can help me with a little problem I have. I have read the topics about using the ExecFile macro to open pdf files that will always be at a specific location on a computer. However, I would like to open a pdf that can exi
-
How to Preset the Web Page resolution
Hello to all. I tried searching but came with nothing. I wanted to know if there is a way in preseting the page to a resolution, say 1024x768 Or is it better having the width set at 100% and go from there? thank you for the help
-
Hi Friends, I need to make some changes in one of the form which is created using screen painter. The program was done by the other person. The original program When I tried for change option, the system is not allowing to make changes and throws up