How to insert the records using sql query

hi,
i insert the record uisng sql query and DOTNET programme successfully and increase the doc num .ubut when i try to  add record using SAP B1 the old Doc no show.It means its not consider the docnums which are not inserted by sql query.
how can i solve this problem?
Regards,
M.Thippa Reddy

You are not support use Insert / Update / Delete on SAP Databases directly.
SAP will not support any database, which is inconsistent, due to SQL-Queries, which modify datasets or the datastructure of the SAP Business One Database. This includes any update-, delete- or drop-statements executed via SQL-Server Tools or via the the query interface of SAP Business One
Check SAP Note: 896891 Support Scope for SAP Business One - DB Integrity
[https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&note_numm=896891]

Similar Messages

  • How to get this output using sql query?

    Hi,
      How to get this output using sql query?
    Sno Name Age ADD Result
    1 Anil 23 delhi Pass
    2 Shruti 25 bangalor Pass
    3 Arun 21 delhi fail
    4 Sonu 23 pune Pass
    5 Roji 26 hydrabad fail
    6 Anil 28 delhi pass
    Output
    Sno Name Age ADD Result
    1 Anil 23 delhi pass
    28 delhi pass

    Hi Vamshi,
    Your query is not pretty clear.
    write the select query using Name = 'ANIL' in where condition and display the ouput using Control-break statements.
    Regards,
    Kannan

  • How to hide repeated details using SQL Query?

    How to hide repeated details using SQL Query?
    For Ex:
    ------------------------+
    DEPTNO| ENAME | JOB |
    ------|-------| --------|
    10 | JAMES | MANAGER |
    10 | BLAKE | CLERK |
    10 | FORD | SALESMAN|
    20 | SCOTT | MANAGER |
    20 | ADAMS | CLERK |
    20 | KING | SALESMAN|
    ------------------------+
    How we can display the above details in the following way?
    ------------------------+
    DEPTNO| ENAME | JOB |
    ------|-------| --------|
    10 | JAMES | MANAGER |
    | BLAKE | CLERK |
    | FORD | SALESMAN|
    20 | SCOTT | MANAGER |
    | ADAMS | CLERK |
    | KING | SALESMAN|
    ------------------------+
    Thanks Advance

    Hi,
    you can use BREAK ON DEPTNO in SQL*Plus or use LAG.
    SQL> ed
    Wrote file afiedt.buf
      1  select nullif(department_id
      2                , lag(department_id) over (partition by department_id order by last_name)
      3         ) dept_id
      4  , last_name, job_id
      5*  from employees where department_id in (30,50) and rownum <=10
    SQL> /
       DEPT_ID LAST_NAME                 JOB_ID
            30 Baida                     PU_CLERK
               Colmenares                PU_CLERK
               Himuro                    PU_CLERK
               Khoo                      PU_CLERK
               Raphaely                  PU_MAN
               Tobias                    PU_CLERK
            50 Fripp                     ST_MAN
               Kaufling                  ST_MAN
               Vollman                   ST_MAN
               Weiss                     ST_MAN
    10 rows selected.

  • How to insert the data using matrix

    Hi
      All how to insert the data using matrix feild
      plz help me
       thanks
        Loy

    Hi Loy,
    The best way to fill an entire matrix is to use a DBDatasource, here is some sample code:
    Dim oForm As SAPbouiCOM.Form
    oForm = SBO_App.Forms.Item("YourFormTypeID")
            '1. Add a DBDataSource to the form
            oForm.DataSources.DBDataSources.Add("OUSR")
            Dim oColumnDBS As SAPbouiCOM.Column
            Dim oColumnUDS As SAPbouiCOM.Column
            Dim i As Integer
            Dim GenEdt As SAPbouiCOM.EditText
            Dim oMatrix As SAPbouiCOM.Matrix
            Dim oColumns As SAPbouiCOM.Columns
            Dim oDBDataSource As SAPbouiCOM.DBDataSource
            oMatrix = oForm.Items.Item("7").Specific
            oColumns = oMatrix.Columns
            '2. DBDataSource: Binding a field / alias of the table to a column
            oColumnDBS = oColumns.Item("V_1")
            oColumnDBS.DataBind.SetBound(True, "OUSR", "U_NAME")
            '3. getting the data sources bound to the form
            oDBDataSource = oForm.DataSources.DBDataSources.Item("OUSR")
            oMatrix.Clear()
            ' Querying the DB Data source
            oDBDataSource.Query()
            ' Adding the data to the matrix
            oMatrix.LoadFromDataSource()
    When you want to fill a specific field use :
    GenEdt = oMatrix.Columns.Item("V_2").Cells.Item(1).Specific
                    GenEdt.String = "Hello"

  • How to find the records using contains with the word like this 'some text-some text'?

    Hi,
    How to find the records using the full text contains keyword and that column contains ‘some text-some text’
    In the above some text can be anything.
    Does anybody know please let me know.
    Thanks,

    Hello,
    You can try to create a Full Text Index on the table and use CONTAINS() to get the record which contains the specify words.
    For example:
    SELECT * FROM TABLE WHERE CONTAINS(column_name, 'some text')
    Reference:
    Full-Text Search (SQL Server)
    Creating Full Text Catalog and Full Text Search
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • How Can insert the records into Excel_sheet by using SQL Task-SSIS ?

    As per requirement ,
    insert the records in excel sheet(DT)  by using SQL Task-SSIS .
    I used SQL query in SQL Task-SSIS:
    e.g.., INSERT INTO [DT$B1:B1] VALUES ('COMMM')
    but error:Executing the query "INSERT INTO [DT$B1:B1] VALUES ('COMMM') " failed with the following error: "This table contains cells that are outside the range of cells defined in this spreadsheet.". Possible failure reasons: Problems
    with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Please any suggestion  ...
    -MADHU

    then first create a table inside Excel sheet based on your source data. You can Execute sql task for that using excel connection. then use insert to populate it
    see an example here where I create a dynamic sheet using execute sql task
    http://visakhm.blogspot.in/2013/09/exporting-sqlserver-data-to-multiple.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to measure the performance of sql query?

    Hi Experts,
    How to measure the performance, efficiency and cpu cost of a sql query?
    What are all the measures available for an sql query?
    How to identify i am writing optimal query?
    I am using Oracle 9i...
    It ll be useful for me to write efficient query....
    Thanks & Regards

    psram wrote:
    Hi Experts,
    How to measure the performance, efficiency and cpu cost of a sql query?
    What are all the measures available for an sql query?
    How to identify i am writing optimal query?
    I am using Oracle 9i... You might want to start with a feature of SQL*Plus: The AUTOTRACE (TRACEONLY) option which executes your statement, fetches all records (if there is something to fetch) and shows you some basic statistics information, which include the number of logical I/Os performed, number of sorts etc.
    This gives you an indication of the effectiveness of your statement, so that can check how many logical I/Os (and physical reads) had to be performed.
    Note however that there are more things to consider, as you've already mentioned: The CPU bit is not included in these statistics, and the work performed by SQL workareas (e.g. by hash joins) is also credited only very limited (number of sorts), but e.g. it doesn't cover any writes to temporary segments due to sort or hash operations spilling to disk etc.
    You can use the following approach to get a deeper understanding of the operations performed by each row source:
    alter session set statistics_level=all;
    alter session set timed_statistics = true;
    select /* findme */ ... <your query here>
    SELECT
             SUBSTR(LPAD(' ',DEPTH - 1)||OPERATION||' '||OBJECT_NAME,1,40) OPERATION,
             OBJECT_NAME,
             CARDINALITY,
             LAST_OUTPUT_ROWS,
             LAST_CR_BUFFER_GETS,
             LAST_DISK_READS,
             LAST_DISK_WRITES,
    FROM     V$SQL_PLAN_STATISTICS_ALL P,
             (SELECT *
              FROM   (SELECT   *
                      FROM     V$SQL
                      WHERE    SQL_TEXT LIKE '%findme%'
                               AND SQL_TEXT NOT LIKE '%V$SQL%'
                               AND PARSING_USER_ID = SYS_CONTEXT('USERENV','CURRENT_USERID')
                      ORDER BY LAST_LOAD_TIME DESC)
              WHERE  ROWNUM < 2) S
    WHERE    S.HASH_VALUE = P.HASH_VALUE
             AND S.CHILD_NUMBER = P.CHILD_NUMBER
    ORDER BY ID
    /Check the V$SQL_PLAN_STATISTICS_ALL view for more statistics available. In 10g there is a convenient function DBMS_XPLAN.DISPLAY_CURSOR which can show this information with a single call, but in 9i you need to do it yourself.
    Note that "statistics_level=all" adds a significant overhead to the processing, so use with care and only when required:
    http://jonathanlewis.wordpress.com/2007/11/25/gather_plan_statistics/
    http://jonathanlewis.wordpress.com/2007/04/26/heisenberg/
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Insert a record using sql broker service

    Hi Guys,
    I need some samples to use sql broker service for creation of a record in other database in order to reduce the delay in creating number of records at the same time.

    Hello,
    In SQL Server Service Broker you can use the "Internal Activation" to start a stored procedure when a message comes in; in such a stored procedure you can do what ever you want to do, also inserting data into a table.
    See MSDN
    Service Broker Tutorials
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to insert the data using  SyncoBo Object

    Hi ,
        please provide the code for inserting the data such tat my meRepMeta.xml
    contains
                  one Top Row
                  4 Child Row
    i done the coding for inserting top row

    Hi Saravana,
        I am not sure about the query based on sync_key value but i am suggesting  the code snippet that you can use to get the SyncBo by the SyncBoName and SyncKey.
      public SyncBo getSyncBoInstance(String syncBoName, String syncKey) {
              SyncBoDescriptor sbd = descriptorFacade.getSyncBoDescriptor(syncBoName);
              try {
                   SyncBo sb = dataFacade.getSyncBo(sbd, syncKey);
                   return sb;
              } catch (PersistenceException pex) {
                   System.out.println(pex.getMessage());
                   return null;
              Based on the SyncBo value from the previous code snippet , you can obtain the rowCollection thru this method. 
    public RowCollection[] getRows()
                            throws PersistenceException
    Ex:
    sb.getRows()
    Once you obtain the RowCollection for the particular syncBo,you can iterate thru rowCollection to get the row entities.
    //To get the iterator of the Row entities in this RowCollection.
    MeIterator it = rowList.iterator();
    From each row entity you can get  the field values by this method
    public MeIterator getFieldValues()
    I would suggest you to go through the API Doc which is clearly explained about all the methods which would be useful for you to do all sort of operation.
    Regards,
    Rajan

  • How to achieve this result using sql query?

    hello gurus,
    i have a table like this
    id    name
    1       a
    2       b
    3       c
    4       d
    5       e
    6       f
    7       g
    8       h
    9       i
    10     j
    11     k
    12     l
    13     m now my result should be like this
    id    name  id   name   id   name
    1       a     6       f      11     k
    2       b     7       g     12     l
    3       c     8       h     13     m
    4       d     9       i
    5       e     10      jhow to achieve it by sql query ?
    thanks and regards,
    friend
    Edited by: most wanted!!!! on Feb 22, 2012 5:55 AM

    hi,
    Did you mean this:
    with a as
    (select 1 id ,'a' name from dual
    union all select 2 id ,'b' name from dual
    union all select 3 id ,'c' name from dual
    union all select 4 id ,'d' name from dual
    union all select 5 id ,'e' name from dual
    union all select 6 id ,'f' name from dual
    union all select 7 id ,'g' name from dual
    union all select 8 id ,'h' name from dual
    union all select 9 id ,'i' name from dual
    union all select 10 id ,'j' name from dual
    union all select 11 id ,'k' name from dual
    union all select 12 id ,'l' name from dual
    union all select 13 id ,'m' name from dual
    select
      id_1
      ,name_1
      ,id_2
      ,name_2
      ,id_3
      ,name_3
    from
      select
        id id_1
        ,name name_1
        ,lead(id,5) over (order by id) id_2
        ,lead(name,5) over (order by id) name_2
        ,lead(id,10) over (order by id)  id_3
        ,lead(name,10) over (order by id) name_3
        ,rownum r
      from
        a
    where
      r <=5
    D_1                   NAME_1 ID_2                   NAME_2 ID_3                   NAME_3
    1                      a      6                      f      11                     k     
    2                      b      7                      g      12                     l     
    3                      c      8                      h      13                     m     
    4                      d      9                      i                                   
    5                      e      10                     j Regards,
    Peter

  • How to update the columns using sql queries?

    create table emp(eno number(5),ename varchar2(20),dno number(2),dname varchar2(20),loc_id number(3), location varchar2(10));
    insert into emp(eno,ename,dno,loc_id) values(1,'tom1',10,1);
    insert into emp(eno,ename,dno,loc_id) values(2,'tom2',20,2);
    insert into emp(eno,ename,dno,loc_id) values(3,'tom3',30,3);
    insert into emp(eno,ename,dno,loc_id) values(4,'tom4',40,4);
    insert into emp(eno,ename,dno,loc_id) values(5,'tom5',50,5);
    insert into emp(eno,ename,dno,loc_id) values(6,'tom6',60,6);
    insert into emp(eno,ename,dno,loc_id) values(7,'tom7',70,7);
    insert into emp(eno,ename,dno,loc_id) values(8,'tom8',80,8);
    create table dept(dno number(3),dname varchar2(10));
    insert into dept values(10,'RM');
    insert into dept values(10,'DD');
    insert into dept values(10,'TD');
    create table location(loc_id number(3),location varchar2(20));
    insert into location values(1,'palani');
    insert into location values(1,'salem');
    insert into location values(1,'kalpattu');
    insert into location values(1,'thirukoyilur');
    insert into location values(2,'thaeni');
    insert into location values(2,'villupuram');
    insert into location values(2,'yercaud');
    insert into location values(3,'thiruvanamalai');
    insert into location values(3,'trichy');
    insert into location values(7,'tanjore');
    insert into location values(4,'tirunelveli');
    insert into location values(4,'namakal');
    insert into location values(5,'bangalore');
    insert into location values(6,'chennai');
    insert into location values(6,'calcutta');
    insert into location values(7,'tirupathy');
    insert into location values(7,'bombay');
    insert into location values(7,'kumbokonam');
    My requirement is to update the department name and location of toms present in employee table without using cursors, loops.
    The column department number and loc_id are used for joins.
    I am in a situation to deliver my code on time.

    try this
    update emp tt
    set (dname,location ) = (
    select res,res1 from (select a.eno,a.ename,a.dno,b.dname,a.loc_id,c.location
    from emp a,
    dept b,
    location c
    where a.dno = b.dno
    and a.loc_id = c.loc_id
    ) t
    where tt.eno = t.eno
    model
    return updated rows
    partition by (eno)
    dimension by (row_number() over (order by eno) as rn)
    measures(cast (dname as varchar2(50))  as res,cast (location as varchar2(300)) as res1)
    rules
    upsert
    iterate(1000)
    until(presentv(res[iteration_number + 2],1,0) = 0)
    res[0] = res[0] ||','|| res[iteration_number + 1],
    res1[0] = res1[0] ||','|| res1[iteration_number + 1]))
    ;output
    1     tom1     10     ,RM,RM,RM,RM,DD,TD,DD,DD,TD,TD,TD,DD     1     ,palani,salem,kalpattu,thirukoyilur,palani,thirukoyilur,kalpattu,thirukoyilur,palani,salem,kalpattu,salem
    2     tom2     20          2     
    3     tom3     30          3     
    4     tom4     40          4     
    5     tom5     50          5     
    6     tom6     60          6     
    7     tom7     70          7     
    8     tom8     80          8     

  • How to insert the data even the trigger returned null

    Hi Gurus,
    I have a question regarding on how to insert the record even the condition being used by a "before insert trigger" returned null.
    The scenario is:
    2 tables have the same structure:
    Table A (Name varchar2 (100), No Number)
    Table B (Name_1 varchar2 (100), No Number)
    A script is using to load the data into table A daily, and a “before insert trigger” is being used to get the value for A.Name = B.Name whenever the condition A.No equals to B.No.
    If the B.No exists, then the trigger work fine, otherwise the records will be rejected, this is not the way we wanted, so I just wonder, is there any way to load all the data to the other fields but still using this trigger ?
    Thanks,
    Tran

    Either amend the select in the trigger that gets the name value to not raise a NO_DATA_FOUND exception (e.g. change "select name..." to "select min(name)..." ) or handle the NO_DATA_FOUND exception in an exception handler.
    e.g.
    EXCEPTION
      WHEN no_data_found THEN
        :new.name = 'where the streets have no name';

  • Dataload using sql query

    Hi,
    i need to load the data using sql query in to essbase cube by using maxl .If any one knows this please let me know.
    i
    thanks in advance

    Here is a sample maxl script I use to clear, load, and calculation a BSO Application and Database. Both the Application and Database are titled "STAT_2".
    /*** Login to essbase server ***/
    /*** login $1 $2 on $3; ***/
    login 'username 'password' on 'server';
    /*** Set output file to spool all error messages only ***/
    spool stdout on to 'C:\Hyperion\Automation\Logs\STAT_2_ALL_Load_Essbase.LOG';
    spool stderr on to 'C:\Hyperion\Automation\Errors\STAT_2_ALL_Load_Essbase.ERR';
    /*** Clear data in STAT_2 ***/
    /** execute calculation 'STAT_2'.'STAT_2'.'ClrA2Yr'; **/
    /*** Import data from the FACT_STAT_2YEARS table using a load rule ***/
    import database 'STAT_2'.'STAT_2' data connect as 'SQLUserName' identified by 'SQLPassword' using server rules_file 'LdA_All.rul' on error write to 'C:\Hyperion\Automation\Logs\STAT_2_ALL_Load_Essbase.log';
    /*** Calculate data in STAT_2 ***/
    /** execute calculation 'STAT_2'.'STAT_2'.'ClcA2Yr'; ***/
    spool off;
    logout;
    exit;

  • How do i get the approximate size of back up file required to save on disk using sql query because i want to show the required sapce for backup on my application

    hi i am face with problem that is i want to show the how much approximate space required for backup or .bak file to get backup using sql query because i want to show the required memory for backup file on my java application  

    Hi FIROZ
    TENNALI
    Is this still an issue, or can we close the thread?
    * closing a thread by marking the answer/s (there is a link beneath each response) and you can vote for useful responses as well (there is a link to vote on the left of each response)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • How to update and insert the records without using Table_comparison and Map_operation?

    How to update and insert the records without using Table_comparison and Map_operation?

    Use either join or MERGE see this Inserting, Updating, and Deleting Data by Using MERGE

Maybe you are looking for

  • Hotmail error on new iPhone 5s

    I've just upgraded and my hotmail connection on longer works... it just says 'cannot get mail- the connection to the server failed' Why is this? and how do I solve it? thanks, Holly

  • Can we get OKET screen in display mode ..

    Hi all I am working on OKET - Maintain settings for price Calculation  and need to get this screen  in display mode .. can anybody please help me or provide me transaction code where i will get this screen in display mode . is Display settings for pr

  • Upload read dataset only one line

    hi all i have a problem, i want to upload a file from applikation server. When i want to read dataset into a xstring field, it read only the first line not all why? here is my code type-pools dset. data lf_filename type string value '/opt/interface/i

  • Mozilla v18 tab will not open with any controls how do I fix

    my tab will not open a new tab when i use any of the open tab functions (file open tab, ctrl +t, or just he + sign on the tab line. I do not have any of the ask toolbars installed. I alos woul like to kow about the pin and tab functions that I read a

  • Start up computer not loading & freezing every minute

    If  anyone can shed some light on this I would be so grateful. So I started up my computer in safe mode as the computer keeps freezing with the multi coloured wheel of death, and it is not loading the icons on the desktop or the bar at the bottom. Ju