Strange Insert result in a ProC program

In the following lines of codes, I tried to insert some records of a table into another. There is a cursor witch has an ORDER BY clause on the field N_RIB. The insert comes after some work.
Just a example of what's going bad :
Source Table N_RIB : 2, 3, 1
Program Insert Work : 1, 2, 3
Result Table N_RIB : 2, 3, 1
So the order by clause doesn't affect how records are inserted.
Here is some of my code :
void InsertionRibs( char N_PMP[11], char N_EXT_PMP[11] )
int n_rib;
char c_cle_rib[5];
int n_cle_rib;
char c_bq[6], c_gu[6], c_cpt[12];
char ribOK[3];
char domiciliation[61];
EXEC SQL WHENEVER SQLERROR DO sql_error( "Erreur ORACLE" );
EXEC SQL DECLARE sel_ribs CURSOR FOR
SELECT n_rib,
l_banq_cpt_princ,
l_guich_cpt_princ,
l_cpt_princ
FROM bol_ribs
WHERE PMP_N_PMP = :N_PMP
ORDER BY N_RIB;
EXEC SQL OPEN sel_ribs;
for( ; ; )
EXEC SQL FETCH sel_ribs INTO :n_rib, :c_bq, :c_gu, :c_cpt;
if( sqlca.sqlcode == ORA_NOTFOUND ) break;
if( sqlca.sqlcode > 0 )
printf( "Erreur Fatale: %s", sqlca.sqlerrm.sqlerrmc );
break;
if( sqlca.sqlcode < 0 )
printf( "Erreur : %s", sqlca.sqlerrm.sqlerrmc );
n_cle_rib = CalculCleRib(c_bq, c_gu, c_cpt);
sprintf( c_cle_rib, "%02d", n_cle_rib );
strcpy( domiciliation, "" );
EXEC SQL INSERT INTO TAB_RIBS ( SELECT
:n_rib,
PMP_N_PMP,
PMP_N_EXT_PMP,
L_PREPO_VIL_BQ,
L_RIB_LIBELLE,
C_PAYS_CPT_PRINC,
L_BANQ_CPT_PRINC,
L_GUICH_CPT_PRINC,
L_CPT_PRINC,
:c_cle_rib,
to_date(D_DEB_UTIL,'YYYYMMDD'),
to_date(D_FIN_UTIL,'YYYYMMDD'),
L_PHONE_RESP_CPT,
L_VILLE,
:domiciliation,
C_REF_ANT,
L_NOM_RESP_CPTE,
C_TYPE_RIB
FROM BOL_RIBS
WHERE PMP_N_PMP = :N_PMP
AND N_RIB = :n_rib );
EXEC SQL COMMIT;
EXEC SQL CLOSE sel_ribs;
Please help me quickly if possible.

http://advsys.net/ken/download.htm
My guess is something to do with the Graphic card from reading about the PC version...
http://www.pouet.net/prod.php?which=54245

Similar Messages

  • Error while using threads in proc program

    Hi,
    I am getting the error fetched column value NULL (-1405) in proc program while using the threads.
    The execution of the program is as follows.
    Tot_Threads = 5 (Total threads, totally 5 records with value instance names)
    No_Of_threads = 1 (No Of threads executed at the same time)
    Example :
    INSTANCE_NAME – Link1, link2, link3, link4, link5 (All different Databases)
    NO_OF_THREADS - 5
    Threading Logic:
    Based on the maintanence NO_OF_THREADS, the program will process.
         If (NO_OF_THREADS == 0)
              Process_Sequence
         else
              if NO_OF_THREADS == TOT_THREADS
                   Process_Type1
              else
                   Process_Type2
    In a loop for all different instances,
    New context area will be created and allocated.
         New oracle session will be created.
         New structure will be created and all global parameters are assigned to that structure.
         For each instance, a new thread will be created (thr_create) and all the threads will call
         the same(MainProcess) function which takes the structure as parameter.
         At the end of every session, the corresponding oracle session will logged out.
    Process_Type1 logic :
         /* For Loop for all threads in a loop */
         for(Cnt=0;Cnt < Tot_Threads;Cnt++)
              /* Allocating new contect for every different thread */
              EXEC SQL CONTEXT ALLOCATE :ctx[Cnt];
              /* Connected to new oracle session */
              logon(ctx[Cnt],ConnStr);          
    /* Assigning all the global parameters to the structure and then passing it to InsertBatching function */
              DataSet[Cnt].THINDEX=Cnt;
              DataSet[Cnt].sDebug=DebugMode;
              strcpy(DataSet[Cnt].THNAME,(char *)InsNameArr[Cnt].arr);
              DataSet[Cnt].ctx=ctx[Cnt];
              /* creating new threads for time in a loop */
    RetVal = thr_create(NULL,0,InsertBatching,&DataSet[Cnt],THR_BOUND,&threads[Cnt]);
              sprintf(LocalStr1,"\nCreated thread %d", Cnt);
              DebugMessage(mptr,LocalStr1,DebugMode);
         for(Cnt=0;Cnt <Tot_Threads;Cnt++)
              /* Waiting for threads to complete */
              if (thr_join(threads[Cnt],NULL,NULL))
                   printf("\nError in thread Finish \n");
                   exit(-1);
              /* Logout from the specific oracle session */     
              logoff(ctx[Cnt]);
              /* Free the context area after usage */
              EXEC SQL CONTEXT FREE :ctx[Cnt];     
    used functions:
              thr_create with thr_suspend option
              thr_join to wait for the thread to complete
    Process_Type2 logic :
         Here the idea is , if the load is heavy , then we can change the maintanence of NO_OF_THREADS (Ex - 2), so that only two threads will be executed in the same time , others should wait for      the same to complete ,once the first two threads completed and the next two should be started and then in the same manner it will do for all the threads.
    The parameters passing and the structure passing are same as above.
    Here all threads will be created in suspended mode, and then only No_Of_threads(2) will
    be started, others will be in suspended mode, once the first two is completed then the
    other two thread will be started and in the same manner other threads.
         used functions:
              thr_create with thr_suspend option
              thr_continue to start the suspended thread
              thr_join to wait for the thread to complete
    Process_Sequence logic :
    Here the idea is , to run the program for all the instances , without creating the threads.Hence in the for loop , one by one instance will be taken and call the same function to Process. This will call the same function repeated for each different value. The parameters passing and the structure passing are same as above.
         The InsertBatching function will prepare the cursor and pick all records for batching and then , it will call other individual functions for processing. For all the functions the structure variable will be passed as parameter which holds all the neccessary values.
    Here in all the sub functions , we have used
         EXEC SQL CONTEXT USE :Var;
         Var is corresponding context allocated for that thread, which we assume that the corresponding context is used in all sub functions.
         EXEC SQL INCLUDE SQLCA;
    This statement we have given in InsertBatching Function not in all sub functiosn
    Example for the Sub functions used in the program :-
    /* File pointer fptr and dptr are general file pointers , to write the debub messages, DataStruct will hold all global parameters and also context area .
    int Insert(FILE fptr,FILE dptr,DataStruct d1)
    EXEC SQL BEGIN DECLARE SECTION;
         VARCHAR InsertStmt[5000];
    EXEC SQL END DECLARE SECTION;
    char LocalStr[2000];
    EXEC SQL CONTEXT USE :d1.ctx;
    InsertStmt will hold insert statement      
    EXEC SQL EXECUTE IMMEDIATE :InsertStmt;
    if (ERROR)
         sprintf(LocalStr,"\nError in Inserting Table - %s",d1.THNAME);
         DebugMessage(dptr,LocalStr,d1.sDebug);
         sprintf(LocalStr,"\n %d - %s - %s",sqlca.sqlcode,ERROR_MESG,d1.THNAME);
         DebugMessage(dptr,LocalStr,d1.sDebug);
         return 1;
    return 0;
    I get this error occationally and not always. While preparing the sql statement also i am getting this error.
    The code contains calls to some stored procedures also.
    Thanks in advance

    in every select nvl is handled and this error is occuring while preparing statements also

  • The ABAP/4 Open SQL array insert results in duplicate database records

    Hi,
    Iam getting following error :
    The ABAP/4 Open SQL array insert results in duplicate database records.
    Error in ABAP application program.
    The current ABAP program "SAPLV60U" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    " Information on where terminated
    The termination occurred in the ABAP program "SAPLV60U" in "VBUK_BEARBEITEN".
    The main program was "SAPMSSY4 ".
    The termination occurred in line 503 of the source code of the (Include)
    program "LV60UF0V"
    of the source code of program "LV60UF0V" (when calling the editor 5030).
    Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
    the
    procedure "VBUK_BEARBEITEN" "(FORM)" but was not handled locally, not declared
    in the
    RAISING clause of the procedure.
    The procedure is in the program "SAPLV60U ". Its source code starts in line 469
    of the (Include) program "LV60UF0V "."
    Please assist how to proceed further ..
    Many thanks
    Mujeeb.

    Sorry, THe correct note is 402221.
    Description from the note
    << Please do not post SAP notes - they are copyrighed material >>
    Edited by: Rob Burbank on Feb 22, 2009 3:46 PM

  • The ABAP/4 Open SQL array insert results in duplicate Record in database

    Hi All,
    I am trying to transfer 4 plants from R/3 to APO. The IM contains only these 4 plants. However a queue gets generated in APO saying 'The ABAP/4 Open SQL array insert results in duplicate record in database'. I checked for table /SAPAPO/LOC, /SAPAPO/LOCMAP & /SAPAPO/LOCT for duplicate entry but the entry is not found.
    Can anybody guide me how to resolve this issue?
    Thanks in advance
    Sandeep Patil

    Hi Sandeep,
              Now try to delete ur location before activating the IM again.
    Use the program /SAPAPO/DELETE_LOCATIONS to delete locations.
    Note :
    1. Set the deletion flag (in /SAPAPO/LOC : Location -> Deletion Flag)
    2. Remove all the dependencies (like transportation lane, Model ........ )
    Check now and let me know.
    Regards,
    Siva.
    null

  • He ABAP/4 Open SQL array insert results in duplicate database records

    Dear Gurus,
    II am getting a dump when I run MD02/ MD03. (t- code to run MRP)
    Below is the message system is showing:
    Please help
    Thanks in Advance
    Best Regards
    Adhish
    Short text
    The ABAP/4 Open SQL array insert results in duplicate database records.
    What happened?
    Error in the ABAP Application Program
    The current ABAP program "SAPLM61U" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
    in
    procedure "INSERT_MDSBI_IN_MDSB" "(FORM)", nor was it propagated by a RAISING
    clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    If you use an ABAP/4 Open SQL array insert to insert a record in
    the database and that record already exists with the same key,
    this results in a termination.
    (With an ABAP/4 Open SQL single record insert in the same error
    situation, processing does not terminate, but SY-SUBRC is set to 4.)
    1 *----
    2 * ARRAY-INSERT auf MDSB
    3 *----
    4 FORM INSERT_MDSBI_IN_MDSB.
    INSERT MDSB6 FROM TABLE MDSBI.
    7 ADD SY-DBCNT TO STATS-RESBI. "statistics
    8 ENDFORM.

    Hi,
    There must be inconsistency in the number range. This happens when the current number in the number range for dependent requirements is lower than the highest number in the database table of the dependent requirements RESB.
    Please check the current number in transaction OMI2. Here in the interval you can see the current number. Then please check the highest number in table RESB. If the current number in OMI2 is lower than the highest number in table RESB then this should be the reason for the dump.
    Check and revert. If that's not the case we'll look into other possibilities.
    In mean time check for SAP Note 138108.

  • Firefox 4 is freezing on GMail tab at frequent intervals on Windows 7, resulting in a message "Program not responding". Remains open but becomes unresponsive for a fill minutes or seconds. And problem repeat, repeat...

    Firefox 4 is freezing on GMail tab at frequent intervals on Windows 7, resulting in a message "Program not responding".
    Remains open but becomes unresponsive for a fill minutes or seconds. And problem repeat, repeat...

    Check this out;
    http://www.clamxav.com/ free malware scanner for Mac OS X
    https://discussions.apple.com/docs/DOC-3291

  • Help!! PROC  program

    Hello
    REDHAT 8 and Oracle 920
    When I make sample proc program
    the message as follow
    cc -o tst sample1.o -L/oracle/product/8.1.7/lib/ -lclntsh `cat /oracle/productm
    sample1.o: In function `main':
    sample1.o(.text+0x67b): the `gets' function is dangerous and should not be used.
    /usr/i386-glibc-2.1-linux/i386-glibc21-linux/bin/ld: warning: libwtc8.so, neede)
    /oracle/product/8.1.7/lib//libclntsh.so: undefined reference to `wtcstu'
    /oracle/product/8.1.7/lib//libclntsh.so: undefined reference to `wtclkm'
    /oracle/product/8.1.7/lib//libclntsh.so: undefined reference to `wtcsrin'
    /oracle/product/8.1.7/lib//libclntsh.so: undefined reference to `wtcMerr'
    /oracle/product/8.1.7/lib//libclntsh.so: undefined reference to `wtcsrin0'
    /oracle/product/8.1.7/lib//libclntsh.so: undefined reference to `wtcsrfre'
    /oracle/product/8.1.7/lib//libclntsh.so: undefined reference to `wtcLerr'
    collect2: ld returned 1 exit status
    make: *** [all] Error 1
    How can i do?

    correct
    [oracle@linux01 oracle]$ echo $LD_LIBRARY_PATH
    /oracle/product/8.1.7/lib

  • The ABAP/4 Open SQL array insert results in duplic

    Hi All,
        During monitoring of our SAP SRM system in SM58 transaction we have received the below error. Please advise on this.
    The ABAP/4 Open SQL array insert results in duplic
    SM58 for Wf-BATCH user
    SRM/MM: FM SPPF_PROCESS
    thanks and regards
    mohammed

    What action did you performed?

  • Exist RFC Function or Bapi for insert Records form a external program?

    i create a Ztable same as tell me here:
    http://abaplovers.blogspot.com/2008/02/creating-table-in-sap.html
    5 String Fileds 2 Date Fields 2 Numeric Fields
    my question is exist a RFC Function or Bapi for insert Records form a external program (Delphi/Visual Basic)?
    Any advices?
    Thanks.

    hi madhurao123 thanks for answer.
    But Why block the Thread?
    This question is no so basic, yet never learn, the forum must be open to these questions maybe open a forum somewhere basic but must be able to do these basic questions.
    IT Toolbox commented the same thing, but if not here or ITtoolbox or where else can ask basic questions?
    Advise me, thank you.

  • Insert result of sql into table

    Hi all, how do I insert result of sql into table marco_ttmp ?
    I tried this, but it doesn't work, it returns "ORA-00928: missing SELECT keyword"
    insert into marco_ttmp (var_id,arcdate,contragentid,lpnd,lusd,lkk)
    with
    rrk as (
    select '01112010' as mydate FROM dual d
    union all
    select '01122010' as mydate FROM dual d
    rru as (
    select '33' contragentid from dual d
    union all 
    select '56' contragentid from dual d
    b as (
    select '01112010' as arcdate, '33' as contragentid, 'tt' as t from dual
    union all
    select '01122010' as arcdate, '56' as contragentid, 'un' as t from dual
    union all
    select '01122010' as arcdate, '33' as contragentid, 'kp' as t from dual
    union all
    select '01112010' as arcdate, '56' as contragentid, 'ur' as t from dual
    d as (
    select '01112010' as arcdate, '33' as contragentid, 'dr' as y from dual
    union all
    select '01122010' as arcdate, '56' as contragentid, 'rh' as y from dual
    union all
    select '01122010' as arcdate, '33' as contragentid, 'tr' as y from dual
    union all
    select '01112010' as arcdate, '56' as contragentid, 'wn' as y from dual
    v as ( select '555' as kkt from dual ),
    kkt as ( select count(*)+5 kkt from v )
    --insert into marco_ttmp (var_id,arcdate,contragentid,lpnd,lusd,lkk)
    select substr(rrk.mydate,4,2) || '.' || rru.contragentid var_id,
    rrk.mydate as arcdate,
    rru.contragentid as contragentid,
    count(b.arcdate) lpnd,count(d.arcdate) lusd,
    kkt.kkt lkk
    from kkt cross join rrk cross join rru
    left outer join b on b.arcdate = rrk.mydate and b.contragentid = rru.contragentid
    left outer join d on d.arcdate = rrk.mydate and d.contragentid = rru.contragentid
    group by rrk.mydate, rru.contragentid, kkt.kkt

    Moved "insert into" to the beginning of statement, everything works.
    insert into marco_ttmp (var_id,arcdate,contragentid,lpnd,lusd,lkk)
    with
    rrk as (
    select '01112010' as mydate FROM dual d
    union all
    select '01122010' as mydate FROM dual d
    rru as (
    select '33' contragentid from dual d
    union all 
    select '56' contragentid from dual d
    b as (
    select '01112010' as arcdate, '33' as contragentid, 'tt' as t from dual
    union all
    select '01122010' as arcdate, '56' as contragentid, 'un' as t from dual
    union all
    select '01122010' as arcdate, '33' as contragentid, 'kp' as t from dual
    union all
    select '01112010' as arcdate, '56' as contragentid, 'ur' as t from dual
    d as (
    select '01112010' as arcdate, '33' as contragentid, 'dr' as y from dual
    union all
    select '01122010' as arcdate, '56' as contragentid, 'rh' as y from dual
    union all
    select '01122010' as arcdate, '33' as contragentid, 'tr' as y from dual
    union all
    select '01112010' as arcdate, '56' as contragentid, 'wn' as y from dual
    v as ( select '555' as kkt from dual ),
    kkt as ( select count(*)+5 kkt from v )
    select substr(rrk.mydate,4,2) || '.' || rru.contragentid var_id,
    rrk.mydate as arcdate,
    rru.contragentid as contragentid,
    count(b.arcdate) lpnd,count(d.arcdate) lusd,
    kkt.kkt lkk
    from kkt cross join rrk cross join rru
    left outer join b on b.arcdate = rrk.mydate and b.contragentid = rru.contragentid
    left outer join d on d.arcdate = rrk.mydate and d.contragentid = rru.contragentid
    group by rrk.mydate, rru.contragentid, kkt.kkt

  • I would like to put the results of a proc on a local database into a table in my azure db. What is the best way to do this?

    I would like to put the results of a proc on a local database into a table in my azure db.  What is the best way to do this?  I dont see the ability to link.  The local db is on my desktop and is mssql12.
    McC

    I am not sure if i set up the linked server correctly here is the schema and an attempt to run a select and the resulting error:
    SELECT  *
    FROM  [CN5E6E9LM2.DATABASE.WINDOWS.NET,1433].[Mkerr_db].dbo.addr
    OLE DB provider "SQLNCLI11" for linked server "CN5E6E9LM2.DATABASE.WINDOWS.NET,1433" returned message "Unspecified error".
    Msg 40515, Level 16, State 2, Line 1
    Reference to database and/or server name in 'Mkerr_db.sys.sp_tables_info_90_rowset_64' is not supported in this version of SQL Server.
    McC

  • ABAP/4 Open SQL array insert results in duplicate database records in SM58

    Hi Everyone,
    I am testing a file to idoc scenario in my Quality system. When I passed the input file, the mapping executed successfully and there are no entries in SMQ2 but still the idoc wasn't created in the ECC system. When I have checked in TRFC, I am getting the error  ABAP/4 Open SQL array insert results in duplicate database records for IDOC_INBOUND_AYNCHRONOUS function module. I thought this is a data issue and I have tested with a fresh data which was never used for testing in Quality but even then I am getting the same error.Kindly advise.
    Thanks,
    Laawanya

    use FM idoc_status_write_to_database to change the IDoc status from 03 to 30 and then  run WE14 or  RSEOUT00 to change the status back to 03
    resending idoc from status 03 ...is a data duplicatino issue on receiving side...why do u need to do that ?
    Use WE19 tcode to debug
    In we19
    1)U can choose your Idoc number in existing Idoc textbox
    2)Press execute
    3)u will display ur Idoc struct
    4)Dbl click on any field then u can modify its content
    5)PressStd Outbound Processing Btn to process modified Idoc
    Thats it

  • Error: The ABAP/4 Open SQL array insert results in duplic in EWM

    Hi Friends,
    During outbound process in EWM, my completed EWM delivery gets stuck in SMQ1 with error "The ABAP/4 Open SQL array insert results in duplic". I performed following checks and found all the ok. Please help me with your insights.
    - Checked the Master data Products, Business Partners,are CIFed properly. Yes they are done properly.
    - Checked if inbound is stuck in same way. But its not.
    - Checked if there is any enhancement stopping in ECC. There is some enhancement in Document_save in ECC outbound delivery which I got it commented. Still the problem is same.
    Please suggest what could be the root cause.
    Thanks
    Trivedi

    Hi Rushikesh,
    I checked all Number ranges (O/D in EWM and ECC, HU and Batches). All are ok. I tried taking help of ABAPer to see if any Run time errors occuring but no use.
    Regards,
    Trivedi

  • Inserting results from select query into another table

    Hi: Is there a way to insert results returned from a SQL query into another table within the same SQL statement.
    For example
    SELECT a.SRCID,
    SUM(DECODE(a.CLASS_ID,91147,1,0)) BLOCK,
    SUM(DECODE(a.CLASS_ID,91126,1,0)) ALLOW,
    FROM EVENT_DATA a
    where
    a.class_id in (91147,91126)
    GROUP BY SRCID
    order by TOTAL DESC;The columns returned SRCID, BLOCK and ALLOW need to go into another table called AGGREGATE_COUNT. This table has fields SRCID, BLOCK and ALLOW. Or is the only way this can be done from outside of SQL like using perl or C.
    Thanks
    Ray

    INSERT INTO aggregate_count
         ( chart_id
         , srcid
         , block
         , allow
    SELECT 2234  chart_id
         , srcid
         , SUM(DECODE(class_id, 91147, 1, 0))
         , SUM(DECODE(class_id, 91126, 1, 0))
      FROM event_data
    WHERE class_id IN (91147, 91126)
    GROUP BY chart_id, srcid
    ORDER BY total DESC;

  • Strange runtime result on forms 10g

    Hi,
    I am using forms 10G. Db is 10G.
    When I run the simple Scott’s emp table
    It runs on internet explorer and instead of giving emp table information it shown something like that:
    <html> <head> ORACLE FORMS.</head>
    <body onload="document.pform.submit();" >
    <form name="pform" action="http://lalo:8889/forms90/f90servlet" method="POST">
    <input type="hidden" name="form" value="I:\test\emp.fmx">
    <input type="hidden" name="userid" value="SCOTT/TIGER@orcl">
    <input type="hidden" name="obr" value="yes">
    <input type="hidden" name="array" value="YES">
    </form> </body></html>
    what is this?
    How should we get the forms simple screen on runtime?
    Where should we get entry so on it runs independently?
    Though is running well on 6i.
    Juma

    This is a duplicate of strange runtime result on forms 10g
    See my response to your original thread.

Maybe you are looking for

  • Mail: how is the number # of each mail in a mailbox assigned?

    Hi there, Today I have finally transfered all my POP3-mailboxes into IMAP mailboxes. I did this by setting up new IMAP Accounts in mail and then just draging the old mails from the POP3-accounts into the new IMAP account. Now, strangely out of my 3 t

  • Standby database 10.2

    HI , I have problem with my standby database, all parameters are good work but in my alert log file have following error; ORA-16401: archivelog rejected by RFS, pls help me what the problem??? On Primary: spfileORCL.ora *.control_files='/u01/oracle/o

  • *** I can't see my "drafts" folder anymore

    I must have done something wrong here. I can't see my "drafts" folder in my list of mailboxes anymore in MacMail. How do I get it back so I can see the draft emails I'm working on? Thanks in advance.

  • Estimated time to implement Service desk with ChaRM

    Hi, I am going to be involved in a SolMan implementation, covering more or less the whole standard scenario of Help desk and Change Request Management. Apart from developments, approximately how much time shall I consider for the project, and what is

  • Security issue with Web Services on Oracle SOA suite? (Serious?)

    Hi, I have recently installed and set up the SOA 10.1.3 on my local machine. I created a simple test web service and deployed - worked ok. I then added simple plain text security to the service, and again opened it up for testing using the test servi