<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Native SQL Error exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-error-exception/m-p/7724791#M1580482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear friends!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Good day. I am trying to create an account in Oracle server  over DBCON.  I have written a query in Native SQL but it gives me the Native SQL exception error..  please look into my query and help me to correct it if I am making any mistake there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: w_user TYPE zbc_assignment-network_id,
        password TYPE string,
        wa_orausr TYPE zbc_orausr,
        wa_orausr_log TYPE zbc_orausr_log,
        lv_server TYPE zbc_oradb-dbname,
        zbc_assignment TYPE zbc_assignment.

  zbc_assignment-network_id = iv_ora_line-network_id.  +&amp;lt;---ORAACCOUNT (will pass oracle account id)+

* connect to Oracle Server.
  EXEC SQL.
    CONNECT TO :iv_server   +&amp;lt;---- will pass the Oracle dbcon- con_name here ( from the list of Oracle servers. i.e ORA01)+  ENDEXEC.
* Check user in oracle.   +&amp;lt;--- Sy-subrc = 0  connection is successful.+  
EXEC SQL.   
    SELECT USERNAME INTO :w_user
           FROM DBA_USERS WHERE
           USERNAME = :zbc_assignment-network_id    
  ENDEXEC.   +&amp;lt;--- Sy-subrc = 4.  since no user is exist in the system.+ 
 IF sy-subrc NE '0' AND w_user IS INITIAL.
    IF iv_ora_line-request_type = '1'.
      " Create Account in oracle
     wa_user = zbc_assignment-network_id. +&amp;lt;--- will pass the username form the user which is not exist in the ora server.+  
    IF iv_ora_line-acc_type = 'USER ACCOUNT'.
        EXEC SQL.  +&amp;lt;---- Native SQL Error is here.....!!! :,(+          
          CREATE USER w_user IDENTIFIED BY password  +&amp;lt;---- password "Init$123+          
          DEFAULT TABLESPACE ts_user_data_01
          TEMPORARY TABLESPACE Ts_temp_DATA_01
          PROFILE PROFILE_NONPRIVILEGED
        ENDEXEC.
 ....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check my sql query and help me. your any help will be appreaciated.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Naeem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Apr 2011 05:06:40 GMT</pubDate>
    <dc:creator>naimkhans_babi</dc:creator>
    <dc:date>2011-04-11T05:06:40Z</dc:date>
    <item>
      <title>Native SQL Error exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-error-exception/m-p/7724791#M1580482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear friends!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Good day. I am trying to create an account in Oracle server  over DBCON.  I have written a query in Native SQL but it gives me the Native SQL exception error..  please look into my query and help me to correct it if I am making any mistake there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: w_user TYPE zbc_assignment-network_id,
        password TYPE string,
        wa_orausr TYPE zbc_orausr,
        wa_orausr_log TYPE zbc_orausr_log,
        lv_server TYPE zbc_oradb-dbname,
        zbc_assignment TYPE zbc_assignment.

  zbc_assignment-network_id = iv_ora_line-network_id.  +&amp;lt;---ORAACCOUNT (will pass oracle account id)+

* connect to Oracle Server.
  EXEC SQL.
    CONNECT TO :iv_server   +&amp;lt;---- will pass the Oracle dbcon- con_name here ( from the list of Oracle servers. i.e ORA01)+  ENDEXEC.
* Check user in oracle.   +&amp;lt;--- Sy-subrc = 0  connection is successful.+  
EXEC SQL.   
    SELECT USERNAME INTO :w_user
           FROM DBA_USERS WHERE
           USERNAME = :zbc_assignment-network_id    
  ENDEXEC.   +&amp;lt;--- Sy-subrc = 4.  since no user is exist in the system.+ 
 IF sy-subrc NE '0' AND w_user IS INITIAL.
    IF iv_ora_line-request_type = '1'.
      " Create Account in oracle
     wa_user = zbc_assignment-network_id. +&amp;lt;--- will pass the username form the user which is not exist in the ora server.+  
    IF iv_ora_line-acc_type = 'USER ACCOUNT'.
        EXEC SQL.  +&amp;lt;---- Native SQL Error is here.....!!! :,(+          
          CREATE USER w_user IDENTIFIED BY password  +&amp;lt;---- password "Init$123+          
          DEFAULT TABLESPACE ts_user_data_01
          TEMPORARY TABLESPACE Ts_temp_DATA_01
          PROFILE PROFILE_NONPRIVILEGED
        ENDEXEC.
 ....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check my sql query and help me. your any help will be appreaciated.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Naeem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 05:06:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-error-exception/m-p/7724791#M1580482</guid>
      <dc:creator>naimkhans_babi</dc:creator>
      <dc:date>2011-04-11T05:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Native SQL Error exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-error-exception/m-p/7724792#M1580483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have an EXEC SQL within an EXEC SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; EXEC SQL.
    CONNECT TO :iv_server   +&amp;lt;---- will pass the Oracle dbcon- con_name here ( from the list of Oracle servers. i.e ORA01)+  ENDEXEC.
* Check user in oracle.   +&amp;lt;--- Sy-subrc = 0  connection is successful.+  
EXEC SQL. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st EXEC SQL isn't closed with ENDEXEC!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Klaus Babl on Apr 11, 2011 7:11 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 05:11:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-error-exception/m-p/7724792#M1580483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-11T05:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Native SQL Error exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-error-exception/m-p/7724793#M1580484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is there!  while formating.. it is deleted.. I think my problem is more with variable passing. I am feeling that password variable is not able to pass the data to my native sql block.  but not sure... thats the reason only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 05:44:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-error-exception/m-p/7724793#M1580484</guid>
      <dc:creator>naimkhans_babi</dc:creator>
      <dc:date>2011-04-11T05:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Native SQL Error exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-error-exception/m-p/7724794#M1580485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;convert native sql into internal table using concatenate and generate a dynamic program call and run it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this I am not passing variables to native sql script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 06:39:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-error-exception/m-p/7724794#M1580485</guid>
      <dc:creator>naimkhans_babi</dc:creator>
      <dc:date>2011-04-11T06:39:27Z</dc:date>
    </item>
  </channel>
</rss>

