Open sql insert not working

Hello SdNers,
I was trying to insert records into table CSKA Cost Elements (Data Dependent on Chart of Accounts).
I have an excel file with 45 records.
I am able to upload to records from the file and display it on the list processing screens.
It is not getting inserted to DB table...CSKA.
data : begin of t_ks06 occurs 0,
       KOKRS type KOKRS,      " Controlling area
       KSTAR type KSTAR,      " Cost element
       DATAB type DATAB,      " Valid from date
       DATBI type DATBI,      " Valid to  date
       KTEXT type KTEXT,      " Name
       LTEXT type LTEXT,      " Description
       KATYP type KATYP,      " Cost element cat
       KOSTL type KOSTL,      " Cost center
       end of t_ks06.
data : wa like line of t_ks06.
data : it_excel type alsmex_tabline occurs 0 with header line.
selection-screen begin of block b1 with frame title text-001.
parameter: f_name type rlgrap-filename default 'C:\Documents and Settings\Administrator\Desktop\Project_data\Cost_element_KS06.xls'.
parameter : p_begcol type i default 1 no-display,
            p_begrow type i default 2 no-display,
            p_endcol type i default 8 no-display,
            p_endrow type i default 46 no-display.
selection-screen end of block b1.
at selection-screen on value-request for f_name.
perform f_get_file using f_name.
start-of-selection.
perform f_xls_itab using f_name changing it_excel.
perform f_move_data.
perform f_insert_db.
perform f_display_data.
form f_get_file  using    p_file_nam.
call function 'KD_GET_FILENAME_ON_F4'
exporting
   program_name        = syst-repid
   dynpro_number       = syst-dynnr
*   FIELD_NAME          = ' '
*   STATIC              = ' '
*   MASK                = ' '
  changing
    file_name           = f_name
exceptions
   mask_too_long       = 1
   others              = 2.
endform.                    " f_get_file
form f_xls_itab  using    p_file_nam changing p_it_excel.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  exporting
    filename                      = f_name
    i_begin_col                   = p_begcol
    i_begin_row                   = p_begrow
    i_end_col                     = p_endcol
    i_end_row                     = p_endrow
  tables
    intern                        = it_excel
exceptions
   inconsistent_parameters       = 1
   upload_ole                    = 2
   others                        = 3.
endform.                    " f_xls_itab
form f_move_data.
data : lv_index type i.
field-symbols <fs>.
* Sorting the internal table
sort it_excel by row col.
clear it_excel.
loop at it_excel.
  move it_excel-col to lv_index.
* Assigning each record to the internal table row.
  assign component lv_index of structure wa to <fs>.
* Assigning the field value to a field symbol
  move it_excel-value to <fs>.
  at end of row.
  append wa to t_ks06.
*   flg_mv = 1.
  clear wa.
  endat.
endloop.
endform.                    " f_move_data
form f_display_data.
  write:/1 sy-uline(140).
  write:/1 sy-vline,  'Cont area',        " Controlling area
         16 sy-vline, 'Cost ele',         " Cost element
         31 sy-vline, 'Valid from',       " Valid from  date
         46 sy-vline, 'Valid to '  ,      " Valid to date
         61 sy-vline, 'Name',             "Cost element cat
         76 sy-vline, 'Description',      " Cost center
         101 sy-vline,  'Cost ele cat',   " Cost element cat
         126 sy-vline, 'Cost center',     " Cost center
         140 sy-vline.
write:/1 sy-uline(140).
skip 1.
clear wa.
loop at t_ks06 into wa.
  write:/2 sy-uline(139).
  write:/2  sy-vline,  wa-KOKRS,      " Controlling area
         16 sy-vline, wa-KSTAR,      " Cost element
         31 sy-vline, wa-DATAB,      " Valid from date
         46 sy-vline, wa-DATBI,      " Valid to date
         61 sy-vline, wa-KTEXT,      " Name
         76 sy-vline, wa-LTEXT,      " Description
         101 sy-vline, wa-KATYP,     " Cost element cat
         120 sy-vline, wa-KOSTL,     " Cost center
         140 sy-vline.
endloop.
endform.                    " f_display_data
form f_insert_db .
if t_ks06[] is initial.
  write:/ 'No records fetched from file' color 3.
else.
  clear wa.
  loop at t_ks06 into wa.
  insert into CSKA values wa.
  endloop.
*    if sy-dbcnt ge 1.
*    perform f_display_data.
*    endif.
endif.
endform.                    " f_insert_db
Help highly appreciated and would be rewarded.
Regards,
Ranjith N

Hello Ranjinth,
To insert the record into data base table. you need to create a work area type of data base table.
because for insert purpose we need the all the field in header or in work area for inserting the new record into data base table. it doesn't mean that you need to use old the field that is avaible in data base table.
you can use only those field that you need in your program with primary key.Because primary key is mandatory to enter for inserting new record.
you can try this..
wa_wrk1 type CSKA.
to insert record.
INSERT CSKA FROM wa_work1.
hope it will help you.
Thanks.
Arun Kayal.

Similar Messages

  • 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
    Chandana

    Hi 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/

  • Open dataset is not working in background in PRD

    Dear All,
    Open dataset is not working in background in PRD .
    OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    Whike running in foregroundits working dev as well as prd.
    but when i am running in background  its giving error like file not found .
    but al11 is working (i mean my file path is working ).
    Thanks N Regards,
    Srinivasa Reddy

    your authority team shall check the batch user of that abap!
    Could you please tell us the detailed error message?
    grx
    Andreas

  • Problem description: mac mail not opening, software updates not working, app store not opening. imac osx 10.9.5

    Problem description:
    mac mail not opening, software updates not working, app store not opening. 10.9.5
    EtreCheck version: 2.0.11 (98)
    Report generated 1 December 2014 16:51:49 CET
    Hardware Information: ℹ️
      iMac (21.5-inch, Late 2009) (Verified)
      iMac - model: iMac10,1
      1 3.06 GHz Intel Core 2 Duo CPU: 2-core
      12 GB RAM Upgradeable
      BANK 0/DIMM0
      4 GB DDR3 1067 MHz ok
      BANK 1/DIMM0
      4 GB DDR3 1067 MHz ok
      BANK 0/DIMM1
      2 GB DDR3 1067 MHz ok
      BANK 1/DIMM1
      2 GB DDR3 1067 MHz ok
      Bluetooth: Old - Handoff/Airdrop2 not supported
      Wireless:  en1: 802.11 a/b/g/n
    Video Information: ℹ️
      NVIDIA GeForce 9400 - VRAM: 256 MB
      iMac 1920 x 1080
      BenQ GL2240 1920 x 1080 @ 60 Hz
    System Software: ℹ️
      OS X 10.9.5 (13F34) - Uptime: 1:32:17
    Disk Information: ℹ️
      WDC WD5000AAKS-40V2B0 disk0 : (500.11 GB)
      S.M.A.R.T. Status: Verified
      EFI (disk0s1) <not mounted> : 210 MB
      Macintosh HD (disk0s2) /  [Startup]: 499.25 GB (164.03 GB free)
      Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
      HL-DT-ST DVDRW  GA11N 
    USB Information: ℹ️
      EPSON EPSON Epson Stylus S22 Series
      Canon MX410 series
      ASMedia AS2105 1 TB
      S.M.A.R.T. Status: Verified
      EFI (disk3s1) <not mounted> : 210 MB
      Backup (disk3s2) /Volumes/Backup : 999.86 GB (506.24 GB free)
      Apple Inc. Built-in iSight
      Apple Internal Memory Card Reader 7.95 GB
      S.M.A.R.T. Status: Verified
      EOS_DIGITAL (disk1s1) /Volumes/EOS_DIGITAL : 7.94 GB (7.83 GB free)
      Western Digital My Book 1140 2 TB
      S.M.A.R.T. Status: Verified
      EFI (disk2s1) <not mounted> : 210 MB
      2TB (disk2s2) /Volumes/2TB : 2.00 TB (1.50 TB free)
      Wacom Co.,Ltd. CTE-450
      Contour Design ShuttlePRO v2
      Apple Computer, Inc. IR Receiver
      Apple Inc. BRCM2046 Hub
      Apple Inc. Bluetooth USB Host Controller
    Gatekeeper: ℹ️
      Mac App Store and identified developers
    Kernel Extensions: ℹ️
      /Applications/Parallels Desktop.app
      [not loaded] com.parallels.kext.hidhook (9.0 24217.979618) Support
      [not loaded] com.parallels.kext.hypervisor (9.0 24217.979618) Support
      [not loaded] com.parallels.kext.netbridge (9.0 24217.979618) Support
      [not loaded] com.parallels.kext.usbconnect (9.0 24217.979618) Support
      [not loaded] com.parallels.kext.vnic (9.0 24217.979618) Support
      /Applications/Toast 10 Titanium/Toast Titanium.app
      [not loaded] com.roxio.BluRaySupport (1.1.6) Support
      /Library/Extensions
      [loaded] at.obdev.nke.LittleSnitch (4052 - SDK 10.8) Support
      [not loaded] xxx.qnation.PeerGuardian (1.1.9) Support
      /System/Library/Extensions
      [not loaded] com.FTDI.driver.FTDIUSBSerialDriver (2.2.18 - SDK 10.6) Support
      [not loaded] com.pctools.iantivirus.kfs (1.0.1) Support
      /Users/[redacted]/Library/Services/ToastIt.service/Contents/MacOS
      [not loaded] com.roxio.TDIXController (2.0) Support
    Startup Items: ℹ️
      ParallelsDesktopTransporter: Path: /Library/StartupItems/ParallelsDesktopTransporter
      WkSvMacX: Path: /Library/StartupItems/WkSvMacX
      Startup items are obsolete and will not work in future versions of OS X
    Launch Agents: ℹ️
      [running] at.obdev.LittleSnitchUIAgent.plist Support
      [not loaded] com.adobe.AAM.Updater-1.0.plist Support
      [loaded] com.adobe.CS4ServiceManager.plist Support
      [running] com.epson.epw.agent.plist Support
      [loaded] com.oracle.java.Java-Updater.plist Support
    Launch Daemons: ℹ️
      [running] at.obdev.littlesnitchd.plist Support
      [failed] com.adobe.fpsaud.plist Support
      [loaded] com.adobe.versioncueCS4.plist Support
      [loaded] com.barebones.textwrangler.plist Support
      [running] com.cleverfiles.cfbackd.plist Support
      [not loaded] com.gopro.stereomodestatus.plist Support
      [loaded] com.microsoft.office.licensing.helper.plist Support
      [loaded] com.oracle.java.Helper-Tool.plist Support
      [loaded] com.oracle.java.JavaUpdateHelper.plist Support
      [invalid?] com.tvmobili.tvmobilisvcd.plist Support
      [loaded] fi.polar.libpolar.plist Support
      [running] fi.polar.polard.plist Support
      [failed] xxx.qnation.PeerGuardian.kextload.plist Support
    User Launch Agents: ℹ️
      [loaded] com.adobe.ARM.[...].plist Support
      [loaded] com.facebook.videochat.[redacted].plist Support
      [loaded] com.google.keystone.agent.plist Support
      [loaded] com.macpaw.CleanMyMac.helperTool.plist Support
      [loaded] com.macpaw.CleanMyMac.trashSizeWatcher.plist Support
      [running] com.macpaw.CleanMyMac.volumeWatcher.plist Support
      [invalid?] com.plexapp.helper.plist Support
      [not loaded] com.spotify.webhelper.plist Support
    User Login Items: ℹ️
      Garmin Express Service Application (/Applications/Garmin Express.app/Contents/Library/LoginItems/Garmin Express Service.app)
      SmartDaemon Application (/Library/Application Support/CleverFiles/SmartDaemon.app)
      SilverKeeper Scheduler ApplicationHidden (/Applications/SilverKeeper.app/Contents/Resources/SilverKeeper Scheduler.app)
      Dropbox Application (/Applications/Dropbox.app)
      Garmin ANT Agent UNKNOWN (missing value)
    Internet Plug-ins: ℹ️
      DirectorShockwave: Version: 11.5.7r609 Support
      Google Earth Web Plug-in: Version: 6.1 Support
      Default Browser: Version: 537 - SDK 10.9
      Flip4Mac WMV Plugin: Version: 3.2.0.16   - SDK 10.8 Support
      PandoWebInst: Version: 1.0 Support
      AdobePDFViewerNPAPI: Version: 10.1.12 Support
      FlashPlayer-10.6: Version: 15.0.0.189 - SDK 10.6 Support
      DivXBrowserPlugin: Version: 2.0 Support
      Silverlight: Version: 5.1.10411.0 - SDK 10.6 Support
      Flash Player: Version: 15.0.0.189 - SDK 10.6 Mismatch! Adobe recommends 15.0.0.239
      iPhotoPhotocast: Version: 7.0 - SDK 10.8
      QuickTime Plugin: Version: 7.7.3
      SharePointBrowserPlugin: Version: 14.0.0 Support
      AdobePDFViewer: Version: 10.1.12 Support
      GarminGpsControl: Version: 4.2.0.0 - SDK 10.8 Support
      JavaAppletPlugin: Version: Java 7 Update 71 Check version
    User Internet Plug-ins: ℹ️
      fbplugin_1_0_3: Version: (null) Support
    Safari Extensions: ℹ️
      Open in Internet Explorer
    Audio Plug-ins: ℹ️
      DVCPROHDAudio: Version: 1.3.2
    3rd Party Preference Panes: ℹ️
      Adobe Version Cue CS4  Support
      DivX  Support
      Flash Player  Support
      Flip4Mac WMV  Support
      GoPro  Support
      Growl  Support
      Java  Support
      MacFUSE  Support
      MenuMeters  Support
      Perian  Support
    Time Machine: ℹ️
      Skip System Files: NO
      Auto backup: NO - Auto backup turned off
      Destinations:
      Back Up [Local]
      Total size: 0 B
      Total number of backups: 0
      Oldest backup: -
      Last backup: -
      Size of backup disk: Excellent
      Backup size 0 B > (Disk size 0 B X 3)
    Top Processes by CPU: ℹ️
          12% Google Chrome
          12% WindowServer
          4% Dock
          2% Little Snitch Agent
          2% SystemUIServer
    Top Processes by Memory: ℹ️
      399 MB iTunes
      322 MB mds_stores
      216 MB Google Chrome Helper
      193 MB Google Chrome
      155 MB com.apple.IconServicesAgent
    Virtual Memory Information: ℹ️
      6.64 GB Free RAM
      3.51 GB Active RAM
      1.36 GB Inactive RAM
      1.11 GB Wired RAM
      1.91 GB Page-ins
      0 B Page-outs

      [not loaded] com.pctools.iantivirus.kfs (1.0.1) Support
    Un-install according to the developer's un-install instructions.
    You do not need to use cleaning programs. They can destroy your computer operation as they may already have done.
    CleanMyMac - Uninstall
    CleanMyMac2 Un-install
    After un-installing, run this program to make sure you got all the pieces.
    EasyFind – Spotlight Replacement
    Do a backup.
    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder.  Select Library. Then go to Preferences/com.apple.appstore.plist. Move the .plist to your desktop.
    Restart, open the application and test. If it works okay, delete the plist from the desktop.
    If the application is the same, return the .plist to where you got it from, overwriting the newer one.
    Thanks to leonie for some information contained in this.

  • What will you do if any SQL is not working.in oracle 10g...apps 11.5.10.2

    What will you do if any SQL is not working. in oracle 10g....apps 11.5.10.2

    928714 wrote:
    yes sir.If you help me in answering my questions i wll be very thankful to you sir.
    tnx,I haven't a clue.
    As you have been advised in many of your posts, go study the documentation for whichever specific topic you are interested in.
    For me to answer your questions, I would need to go get that documentation.
    Then I would need to read that documentation.
    Then I would need to write a forum post that interprets what I think I learned from that documentation.
    It is so very much faster if YOU go do that instead of posting to a forum and expecting others to do it. You will remember what you study for a lot longer time if you teach yourself.

  • I have an Iphone 4 and the camera shutter wont open, I have tried most things and it has still not opened, it has not worked since I have got it. What should I do?

    I have an Iphone 4 and the camera shutter wont open, I have tried most things and it has still not opened, it has not worked since I have got it. What should I do?

    Here's basic troubleshooting for iOS:
    https://sites.google.com/site/appleclubfhs/support/advice-and-articles/troublesh ooting-ios
    (Note that my links to other pages may promote my organization, and this should not be taken as an endorsement by Apple)

  • Force encryption on SQL Server not working?

    Hello Everyone,
    I'm running SQL Server 2008 64-bit. I've installed a self-signed cert on the box and set  "Force Encryption"  and restarted SQL server. 
    I setup a client machine to trust the authority of the cert installed on the server. When I connect to that SQL server from SSMS from a client machine and select the "encrypt connection" option in the client Connection properties, SSMS correctly complains
    that the cert on the server does not match the computer name I asked to log into . This is because, although the cert is trusted, the dns name dos not match the CN in the cert <- Perfect, exactly what I am expecting.
    When I connect to the same SQL server from the same client but  UNCHECK "encrypt connection" on the client, I'm able to login. Considering I've checked the "Force Encryption" on the server, the server should have rejected the connection. Why not?
    Ameer Deen

    Hi all,
    We are implementing a Merge Synchronization solution which involves three SQL Servers located on three Azure locations worldwide and one on-premises location. We need to secure communications between all servers. We are evaluating the encryption of all server
    communications through SSL:
    http://technet.microsoft.com/en-us/library/ms191192.aspx
    When we configure one server (let’s call it server A) to accept only encrypted connections (with Force Encryption=Yes) we still can connect from other server (let’s call it server B) that do not have the certificate installed. We would expect the server
    B to fail in the attempt of connect as server A should only accept encrypted communications and those should need the certificated to encrypt/decrypt everything (commands and data).
    We have also review the following forum post that is very similar to this one:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/bde679d9-ff83-4fa7-b402-42e336a97106/force-encryption-on-sql-server-not-working
    In all cases the Microsoft answer is:
    “When the
    Force Encryption option for the Database Engine is set to YES, all communications between client and server is encrypted no matter whether the “Encrypt
    connection” option (such as from SSMS) is checked or not. You can check it using the following DMV statement”
    When we run the provided DMV statement to check if encryption is enabled:
    -- To check whether connections are encrypted between server and clients
    SELECT encrypt_option
    FROM sys.dm_exec_connections
    We get “TRUE”. So theoretically encryption is enabled.
    Then:
    Why can we run SQL statements against server A from server B (with SSMS) without any certificate?
    Are we wrong when we expect server A to refuse any client that do not have the right certificate?
    How can server B, without any certificate, decrypt the data encrypted by server A?
    Our intention is to encrypt all server in the same way so all of them will accept only encrypted communications. We are assuming that the Merge Agent will be able to communicate with the Publisher and the Subscriber through this encrypted environment. May
    anyone please confirm ti?
    Thanks for your help.
    Best Regards
    Benjamin Moles

  • I need a reliable office suite.   Open Office is not working well for me.  Any suggestions?

    I need a good reliable office suite.  Open Office is not working well for me.  Any suggestions?

    If you mean Open Office is not always able to correctly open documents received from clients created with MS Office, then the only real solution is to purchase Office 2011 for Mac. As good as some of the free alternatives are, they can't duplicate every feature of MS Office.

  • Sql is not working after changing from MsAccess into sql server

    Following Sql  is not working after changing from MsAccess into sql server. 
    sum(trn.sales) as sales,
    sum(trn.cost) as cost,
    sales - cost as profit // Here is not working . can we not use sales a column. Please advise
    from trn
    Kind Regards
    pol
    polachan

    It will not work if use two different column from the table or column  from two  different table
    Example
    sum(trn.sales * trn.rate) as salesAmount,
    sum(trn.cost) as cost,
    sum(trn.salesAmount)-sum(trn.cost) as profit ----- Here is not working . can we not use sales a column. Please advise
    from trn
    Regards
    polachan

  • Insert SQL does not work properly when called using CALL

    I have a stored procedure (TEST_SP) which is used to insert a record in this perticular case. The SQL statement is 2526 characters long. I'm using
    dim Params : Params=chr(1) & "Insert query" & Chr(1) & "=300"
    runsql=&"{call TEST_SP(?,?)}"&Params 
    dim db : db=dbSelect("",0,"","")
    dbExecSQL db,runsqlto execute the stored procedure. I'm facing an issue when the 2000th character on the insert SQL (pUPDSQL) is a single quote, where the SQL is not getting executed (i.e. record is not getting created).
    The same stored procedure and the same SQL when run as below
    runsql=runsql&"DECLARE "
    runsql=runsql&"PUPDSQL VARCHAR2(4000); "
    runsql=runsql&"PRES VARCHAR2(300); "
    runsql=runsql&"BEGIN "
    runsql=runsql&"PUPDSQL := 'INSERT query..."
    runsql=runsql&"PRES:=300; "
    runsql=runsql&"MRT_LKIDFULUP(PUPDSQL => PUPDSQL,PRES => PRES); "
    runsql=runsql&"END; "
    dim db : db=dbSelect("",0,"","")
    dbExecSQL db,runsqlis working fine. Does anyone know if there is a limitaion in ODBC Call function or any explanation to above behaviour? I'm connecting to a Oracle 11g database using Microsoft ODBC for Oracle driver on Window 7
    The stored procedures:
    create or replace procedure TEST_SP(pUPDSQL IN VARCHAR2,pRES OUT VARCHAR2)
    AS
    BEGIN
    DECLARE
      emsg VARCHAR2(100);
    BEGIN
    if pUPDSQL&lt;&gt;'-1' then
      emsg:='Cant exec UPDATE';
      EXECUTE IMMEDIATE pUPDSQL;
        if SQL%RowCount=0 then
        pRES:='ERR:No row updated';
        return;
      end if;
    end if;
    pRES:='OK:';
    EXCEPTION
      WHEN OTHERS THEN
       pRES:='ERR:' || emsg;
    END;
    END;Edited by: BluShadow on 11-Dec-2012 15:47
    added {noformat}{noformat} tags for readability.  Please read {message:id=9360002} and learn to do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    ... I'm facing an issue when the 2000th character on the insert SQL (pUPDSQL) is a single quote, ...Perhaps you need two single quotes? like:
    runsql=runsql&"PUPDSQL := 'INSERT query...Values(..,..,,,''This value in two single quotes'',..,...)' "
    ... I'm connecting to a Oracle 11g database using Microsoft ODBC ...Dump windoze ODBC and better use the Oracle client ODBC.
    :p

  • Open Sql Insert

    Hi Friends!
       Using insert can we use direct to insert record in database table its possibe whats the syntax.

    Hi Rahul,
    1. INSERT INTO  dbtab      VALUES wa. oder
    INSERT INTO (dbtabname) VALUES wa. oder
    INSERT  dbtab      FROM wa. oder
    INSERT (dbtabname) FROM wa.
    2. INSERT  dbtab      FROM TABLE itab. oder
    INSERT (dbtabname) FROM TABLE itab.
    3. INSERT  dbtab. oder
    INSERT *dbtab.
    Effect
    Inserts new lines in a database table (see relational database). You can specify the name of the database table either in the program itself in the form dbtab or at runtime as the contents of the variable dbtabname. In both cases, the database table must be defined in the ABAP Dictionary. By default, data is only inserted in the current client. Data can only be inserted using a view if the view refers to a single table and was defined in the ABAP Dictionary with the maintenance status "No restriction".
    INSERT belongs to the Open SQL command set.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs.See Open SQL and Unicode.
    Notes
    You cannot insert a line if a line with the same primary key already exists or if a UNIQUE index already has a line with identical key field values (with regard to this UNIQUE index).
    When inserting lines using a view, all fields of the
    database table that are not in the view are set to their initial value
    (see TABLES) - if they were defined with NOT NULL in the ABAP Dictionary. Otherwise they are set to NULL.
    Authorization checks (see The SAP Authorization Concept) are not supported by the INSERT statement. You must include these in the program yourself.
    Lines specified with the INSERT command are not finally added to the database table until after a database commit (see Logical Unit of Work (LUW)). Prior to this, you can cancel any changes to the database with a database rollback (see Programming Transactions).
    In the dialog system, you cannot rely on the locking mechanism used by the database system (see Database Locking) to synchronize simultaneous access to the same database by several users. Therefore, it is often necessary to use SAP's locking mechanism (see SAP Locking).
    PS: please reward if useful..

  • PL/SQL program not working when connect database via SqlNet

    Hi,
    This is a segment of a PL/SQL program before opening a cursor using input descriptor. It is working fine ( to get the value of unOutputCount ) without connect to a database via SqlNet, can anyone tell me why it is not working ( unOutputCount return 0)while connecting to a database via SqlNet and how to make it work without opening a cursor before DESCRIBE OUTPUT ...?
    EXEC SQL ALLOCATE DESCRIPTOR GLOBAL 'input_111'
    WITH MAX 100;
    EXEC SQL ALLOCATE DESCRIPTOR GLOBAL 'output_111'
    WITH MAX 100;
    EXEC SQL PREPARE STMT1 FROM :psSqlStatement;
    EXEC SQL DECLARE CURSOR1 CURSOR FOR STMT1;
    EXEC SQL DESCRIBE INPUT STMT1
    USING DESCRIPTOR GLOBAL 'input_111';
    /* Get count of input parameters in statement */
    EXEC SQL GET DESCRIPTOR GLOBAL 'input_111' :unInputCount = COUNT;
    EXEC SQL DESCRIBE OUTPUT STMT1
    USING DESCRIPTOR GLOBAL 'output_111';
    /* Get count of output parameters in statement */
    EXEC SQL GET DESCRIPTOR GLOBAL 'output_111'
    :unOutputCount = COUNT;

    Hi,
    Welcome to Oracle OTN Forums!
    I changed your code a little. I think this help you
    CREATE OR REPLACE
    PROCEDURE xx_test
    IS
      v_pid VARCHAR2(100);
      v_cn  VARCHAR2(100);
      v_id  VARCHAR2(1000);
      v_val VARCHAR2(1000);
      CURSOR C1
      IS
        (SELECT product_id, 'PRODUCT_ID'  cn
            FROM product1 );
      BEGIN
        FOR V1 IN C1
        LOOP
          FETCH C1 INTO v_pid, v_cn;
          dbms_output.put_line('==== '||v_pid||'==== '||v_cn);
          EXECUTE IMMEDIATE
          'SELECT product_id, DECODE(COUNT (product_id),1,MAX (product_id))||'''||V_CN||''' as val
            FROM product1
           WHERE product_id =:a
           GROUP BY product_id)' INTO v_id, v_val USING v_pid;
          dbms_output.put_line('==== '||v_id||'==== '||v_val);
          EXECUTE IMMEDIATE 'UPDATE product2 SET '||v_cn||' = ' ||''''|| v_val ||''''|| ' WHERE product_id = :b' USING v_pid;
          dbms_output.put_line('++++ '||v_cn||'++++ '||v_val||'++++ '||v_pid);
        END LOOP;
      END xx_test;

  • My first PL/SQL block not working with using Select query within begin

    I am new to PL/SQL , just started with basics of BLOCKS .
    I am having a query here in executing a block .
    When i am doing a insert oprtation in Blocks Begin method everything is working fine , but when ever i tried to do select operation , some error is being thrown .
    First of all This is my Table :
    select from try :*
    KEY      VALUE
    Key     Value
    Key1     Value1
    Key2     Value2
    Key3     Value3
    ======================
    This is the code which is not working : Please see the code and tell me what is the problem .
    DECLARE
    v_KEY    VARCHAR2(20);
    v_VALUE   VARCHAR2(20);
    BEGIN
    select key into v_KEY FROM try where v_value='Value' ;
    dbms_output.put_line(v_KEY);
    END;
    When i run this code , it is saying Data Not Found on this line " select key into v_KEY FROM try where v_value='Value' ;"
    wheer when i run tis individually it worked fine :
    select KEY FROM try where VALUE='Value' ;"
    please share your ideas .as why it isn't running ??
    Edited by: user10503747 on Sep 20, 2010 3:16 AM

    Hi,
    user10503747 wrote:
    I am new to PL/SQL , just started with basics of BLOCKS .
    I am having a query here in executing a block .
    When i am doing a insert oprtation in Blocks Begin method everything is working fine , but when ever i tried to do select operation , some error is being thrown .
    First of all This is my Table :
    select from try :*
    KEY      VALUE
    Key     Value
    Key1     Value1
    Key2     Value2
    Key3     Value3
    ======================
    This is the code which is not working : Please see the code and tell me what is the problem .
    DECLARE
    v_KEY    VARCHAR2(20);
    v_VALUE   VARCHAR2(20);
    BEGIN
    select key into v_KEY FROM try where v_value='Value' ;
    dbms_output.put_line(v_KEY);
    END;
    When i run this code , it is saying Data Not Found on this line " select key into v_KEY FROM try where v_value='Value' ;"
    wheer when i run tis individually it worked fine :
    select KEY FROM try where VALUE='Value' ;"
    please share your ideas .as why it isn't running ??
    Edited by: user10503747 on Sep 20, 2010 3:16 AMInstead of:
    {code}
    select key into v_KEY FROM try where v_value='Value' ;
    {code}
    perhaps you meant something like:
    {code}
    v_value := 'Value1';
    select key into v_KEY FROM try where v_value=Value ; -- No quotes
    {code}
    Until you assign a vlue to a variable, like v_value, it is NULL, so your original statement was equivalent to
    {code}
    select KEY FROM try where NULL='Value' ;
    {code}
    In PL/SQL, a SELECT ... INTO statement must return exactly one row, or else you will get an error (either NO_DATA_FOUND or TOO_MANY_ROWS). This is different from SQL, where a query cn return any number of rows, including 0, without raising an error.

  • French characters insertion not working fine

    Hi all,
    I'm using Oracle database 10.2.0.3, i migrate the database from 9i.
    My problem is in my new database version i mean 10g when i'm inserting french characters like "éèà" in my database it's not working fine, i check to my old database (9i) it's working and i compare the parameters (NLS parameters they are same). i cannot find where is the problem making this appear, if anybody can help me.
    here bellow that i did.
    SQL> insert into dept values(0,'échec','éèàù');
    1 ligne crÚÚe.
    SQL> commit;
    And from query i got:
    SQL> select * from dept where deptno=0;
    DEPTNO DNAME LOC
    0 ┐chec ┐┐┐┐
    here are some parameters i check:
    SQL> sho parameter nls;
    NAME TYPE VALUE
    nls_calendar string
    nls_comp string
    nls_currency string
    nls_date_format string
    nls_date_language string
    nls_dual_currency string
    nls_iso_currency string
    nls_language string AMERICAN
    nls_length_semantics string BYTE
    nls_nchar_conv_excp string FALSE
    nls_numeric_characters string
    NAME TYPE VALUE
    nls_sort string
    nls_territory string AMERICA
    nls_time_format string
    nls_timestamp_format string
    nls_timestamp_tz_format string
    nls_time_tz_format string
    I need your help because it's very important for our database.
    regards
    raitsarevo

    I goth nothong, i think it's not yet set here bellow the result:
    oracle@ab-db1:/abdb_data2/expdp$ env|grep NLS
    oracle@ab-db1:/abdb_data2/expdp$
    to my old server (9i) here the result:
    [oracle@abillity3db oracle]$ env|grep NLS
    ORA_NLS33=/home/oracle/product/9.2.0.4/ocommon/nls/admin/data
    [oracle@abillity3db oracle]$
    When i run the command env only i got for the new server HPux 10g:
    oracle@ab-db1:/abdb_data2/expdp$ env
    SFTP_PERMIT_CHOWN=1
    MANPATH=/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/usr/local/man/%L:/usr/local/man:/opt/ldapux/share/man:/opt/ldapux/ypldapd/man:/opt/ipf/man:/usr/dt/share/man:/opt/samba/man:/opt/samba/WTEC_Support_Tools/man:/opt/resmon/share/man/%L:/opt/resmon/share/man:/opt/openssl/man:/opt/openssl/prngd/man:/opt/wbem/share/man:/opt/VRTS/man:/opt/graphics/common/man:/opt/sfmdb/pgsql/man:/opt/sec_mgmt/share/man:/opt/dsau/man:/opt/gnome/man:/opt/perl/man:/opt/sec_mgmt/share/man/%L:/opt/ssh/share/man:/opt/gwlm/man/%L:/opt/gwlm/man:/opt/ignite/share/man/%L:/opt/ignite/share/man:/opt/aCC/share/man/%L:/opt/aCC/share/man:/opt/audio/share/man:/opt/ansic/share/man/%L:/opt/ansic/share/man:/opt/langtools/share/man/%L:/opt/langtools/share/man:/opt/cadvise/share/man/%L:/opt/cadvise/share/man:/opt/image/share/man:/opt/imake/man
    ORA_CRS_HOME=/home/oracle/crs
    TERM=xterm
    SHELL=/sbin/sh
    ERASE=^H
    SFTP_LOG_LEVEL=3
    SSH_CLIENT=192.168.0.45 1525 22
    SSH_TTY=/dev/pts/0
    SFTP_LOG_FACILITY=2
    USER=oracle
    LD_LIBRARY_PATH=/home/oracle/oracle/product/10.2.0/db_1/lib
    ORACLE_SID=abdb1
    COLUMNS=157
    MAIL=/var/mail/oracle
    PATH=/home/oracle/oracle/product/10.2.0/db_1/bin:/home/oracle/crs/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/ipf/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/fcms/bin:/usr/bin/X11:/opt/resmon/bin:/usr/contrib/kwdb/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/graphics/common/bin:/usr/sbin/diag/contrib:/opt/sfm/bin:/opt/upgrade/bin:/opt/sec_mgmt/bastille/bin:/opt/dsau/bin:/opt/dsau/sbin:/opt/gnome/bin:/opt/mozilla:/opt/perl/bin:/opt/sec_mgmt/spc/bin:/opt/ssh/bin:/opt/hpsmh/bin:/opt/gwlm/bin:/usr/contrib/bin/X11:/opt/ignite/bin:/opt/aCC/bin:/opt/cadvise/bin:/opt/langtools/bin:/opt/imake/bin:.
    LOG_SFTP=0
    PWD=/abdb_data2/expdp
    EDITOR=vi
    TZ=EAT-3
    PS1=oracle@ab-db1:$PWD$
    LINES=60
    SHLVL=1
    SFTP_PERMIT_CHMOD=1
    HOME=/home/oracle
    LOGNAME=oracle
    SSH_CONNECTION=192.168.0.45 1525 192.168.0.233 22
    SFTP_UMASK=
    ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1
    _=/usr/bin/env
    OLDPWD=/abdb_data2
    And for the old server RHL (9i):
    [oracle@abillity3db oracle]$ env
    PWD=/home/oracle
    ORACLE_SID=abillity
    HOSTNAME=abillity3db
    LD_LIBRARY_PATH=/home/oracle/product/9.2.0.4/lib:
    PVM_RSH=/usr/bin/rsh
    LESSOPEN=|/usr/bin/lesspipe.sh %s
    XPVM_ROOT=/usr/share/pvm3/xpvm
    USER=oracle
    LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
    MACHTYPE=i386-redhat-linux-gnu
    MAIL=/var/spool/mail/oracle
    INPUTRC=/etc/inputrc
    EDITOR=vi
    LANG=en_US
    ORACLE_BASE=/home/oracle
    ORACLE_HOME=/home/oracle/product/9.2.0.4
    LOGNAME=oracle
    SHLVL=1
    ORA_NLS33=/home/oracle/product/9.2.0.4/ocommon/nls/admin/data
    SHELL=/bin/bash
    HOSTTYPE=i386
    OSTYPE=linux-gnu
    HISTSIZE=1000
    LAMHELPFILE=/etc/lam/lam-helpfile
    PVM_ROOT=/usr/share/pvm3
    HOME=/home/oracle
    TERM=xterm
    SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
    PATH=/home/oracle/product/9.2.0.4/bin:/opt/IBMJava2-131/bin:/opt/IBMJava2-131/jre/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin
    SSH_TTY=/dev/pts/1
    _=/usr/bin/env
    I saw that in my old server environment variable LANG=en_US is set but in the new not.
    What's your advice.
    Thanks Nicolas
    raitsarevo

  • Sql developer not working which i got when i installed oracle 11g on win7

    Hi i successfully instaled my oracle 11g on windows 7,but when iam trying to use my sql developer chich i got by default with 11g is not working ..when i open it its asking me for "select the path of java.exe file" when i browse and given the right path .iits again giving me the same pop and not throughing any error msg at least.
    Could u pls help me out on this??

    Well, not supported does not necessarly mean does not work, but if you have problem, then your only way is to find a solution on your own or through other fellows who are doing the same.
    Anyway, you could ask your question in the SQL Developer dedicated forum, but again, you could have some unexpected issues by working on non-supported config :
    SQL Developer
    Nicolas.

Maybe you are looking for

  • Install issue AI CS6

    I downloaded AI CS6 and do not see where to open the program. I see it installed in the Application Manager, but where do I launch the program from? I ordered the monthly cloud program. I am running Windows 7 premium. I did see an error when installi

  • Best computer for The Sims 3?

    I'm looking at getting a new computer to use for The Sims 3, and I rally have no idea what to look for. The laptop I've been using (Compaq Presario c700, wasn't intended for Sims when I bought it) is incredibly slow when I try playing. I need to be a

  • I am getting the error "server responded with an error" with respect to Calendar.

    The request "name of appointment" in "medical" in account "iCloud" failed.  400 to operation CalDAVUploadDropBoxFileQueuecableoperation".  How do I fix this error?  Nothing I am doing is removing it.

  • Not receiving the email to enable reset of my Sync password. Have tried several times across days. No email.

    I had to change my Sync password a couple of weeks ago for security reasons, but now neither password works. Attempts to reset my password via the email method don't work, because while Sync says it has sent one, I never receive it. According to Sync

  • Special numbering in pages in ios

    I need to use roman numerals for the first 6 or so pages of a document (actually, the title page needs to be non-numbered), then Arabic from page 6-70, which need to be numbered 1-63.  I cannot find a way to set my footer up for this.  In fact, I can