Prevent from inserting more than 10 repeated values in a row

hi
i have a table with 3 column id , code , desc
i want to prevent inserting to this table ( raise an exception ) when someone try to insert a row that it's code value already in "code" column for 10 times , that means he wants to insert or update another row that it's value of "code" repeated 10 times .
how i can do that ?
thx in adv

ssaeeds wrote:
thx for your replay , but is there another way other than using trigger ?You can use a Materialized view with Fast refresh option to achieve this. But the validation will occur only when you commit your changes and not during the DML operation itself.
Below is a working example.
SQL*Plus: Release 10.2.0.5.0 - Production on Tue May 15 03:49:34 2012
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create table tablename(id number, code varchar2(10), descr varchar2(100))
  2  /
Table created.
SQL> create materialized view log on tablename with rowid, sequence (code) including new values
  2  /
Materialized view log created.
SQL> create materialized view tablename_mv build immediate refresh fast on commit
  2  as
  3  select code, count(code) code_cnt
  4    from tablename
  5   group by code
  6  /
Materialized view created.
SQL> alter materialized view tablename_mv add constraint tablename_mv_ck check(code_cnt<11)
  2  /
Materialized view altered.
SQL> insert into tablename
  2  select level id, 'a' code, 'xxxxxxxxxx' descr
  3    from dual
  4  connect by level <= 10
  5  /
10 rows created.
SQL> set linesize 130
SQL> select * from tablename
  2  /
        ID CODE       DESCR
         1 a          xxxxxxxxxx
         2 a          xxxxxxxxxx
         3 a          xxxxxxxxxx
         4 a          xxxxxxxxxx
         5 a          xxxxxxxxxx
         6 a          xxxxxxxxxx
         7 a          xxxxxxxxxx
         8 a          xxxxxxxxxx
         9 a          xxxxxxxxxx
        10 a          xxxxxxxxxx
10 rows selected.
SQL> commit
  2  /
Commit complete.
SQL> insert into tablename values (11, 'a', 'xxxxxxxxxx')
  2  /
1 row created.
SQL> commit
  2  /
commit
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-02290: check constraint (ARBORU.TABLENAME_MV_CK) violated

Similar Messages

  • AddOn: Prevent from loading more than once

    Good Afternoon
    Experts:
    I appreciate you patience as I resurrect this topic since it has become an
    increasing concern here.  We need a way to restrict our AddOn from "being in"
    Task.mgr more than once.  We are working with Terminal Services.  A couple ways we have found more than one instance in TM is the User just opening another session or opening another session after a "problem/Issue/Crash". 
    I have this code which restricts the AddOn from starting more than once here on my local machine:
    Public Sub Main()
            Try
                Dim x As Integer = 0
                Dim Ctr As Integer = 0
                Dim som() As System.Diagnostics.Process
                som = System.Diagnostics.Process.GetProcesses
                Dim Name As String
                For x = 0 To som.Length - 1
                    Name = som(x).ProcessName.ToUpper
                    If som(x).ProcessName = "Test.Enhance" Then
                        Ctr += 1
                    End If
                Next x
                If Ctr > 0 Then
                    MsgBox("LBSI.Enhance AddOn is already started...Exiting application.", MsgBoxStyle.Critical)
                    Exit Try
                Else
                    ReInitializeAddOn()
                    Application.Run()
                End If
            Catch ex As Exception
                HandleException("Main", ex, True)
            End Try
        End Sub
    Is there a better more elegant way to do this? How about for Terminal Services?
    Thanks in advance for your insight,
    EJD

    Not answered...so I will close.

  • How to prevent the User from loading more than one seq file?

    Hi,
    I would like to prevent the tester operator from loading more than one test sequence.  Any ideas how to do it?
    Thanks
    Rafi

    Hi Marty,
    Marty_H wrote:
    Hello mhousel,
    Testexec.exe by default loads the sequence files that were last open when it runs.  It is often desired behavior to have multiple sequence files load automatically. 
    [Mark Housel] Maybe for some but certainly not for me. 
    This should be easily handled by TestStand without any problems.  What do you mean by "chaos ensues"? 
    Certainly Teststand doesn't care a bit how many sequences are open.  But, when my sequences open they initialize HW of the ATE associated with
    that sequence file during the sequenceFileLoad callback.  e.g. I allocate TELNET handles to a terminal
    server that connects to multiple console within the system and als for
    the UUT.
    If a second sequence opens it knows nothing about the other sequence and again tries to open a TELENT session to the same port of the
    terminal server and obviously fails, so my sequence reports that it
    can't properly initialize the ATE HW.  Bad juju!
    Are your sequence files set to run automatically when they are loaded?
    I guess so.  Other than the trick of logging in as the special noExecution user and having special code in my sequence and modified Process Model I have no idea how to prevent a sequence fronm "runnin" when opened.
    If you want to prevent Testexec.exe from loading multiple files, you should be able to close out one of the open files when it loads and that sequence file should not load in the future.  I hope that helps.
    The trick I read somewhere else of modifying the Testexec.uir file to never re-load a sequence file automatically seemes to have covered up solved the problem.
    Thanks,
    Mark

  • Unable to insert more than 9 rows at a time

    Hi there,
    I have to insert more than 5000 rows in my table at a time,but i am not able to insert more than 10 ROWS AT ATIME.
    Do we need to do some that at the data base level for this to happen??????
    Thanks in Advance.

    Rather than give us unhelpful comments like "still its not taking", why don't you show us exactly what you're doing? We can't help you if you don't give us enough information.
    I've tried it and it works fine:
    SQL> create table customer (dealership_id number,
      2  region varchar2(100),
      3  customer_no number,
      4  firstname varchar2(100),
      5  lastname varchar2(100),
      6  address varchar2(100),
      7  city varchar2(100),
      8  state varchar2(100),
      9  zip varchar2(100),
    10  country varchar2(100),
    11  phone_number varchar2(100),
    12  email varchar2(100),
    13  gender varchar2(1),
    14  age number,
    15  transaction_date date);
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1  begin
      2  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
      3  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
      4  TRANSACTION_DATE ) VALUES (
      5  1, 'West', 546, 'Maria L', 'Umali', '515 W 59th St', 'San Francisco', 'California'
      6  , 10019, 'United Sta', '2122478223', 'null', 'F', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
      7  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
      8  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
      9  TRANSACTION_DATE ) VALUES (
    10  24, 'East', 547, 'Justa', 'Viafara', '66 Avenue C', 'Charleston', 'West Virginia'
    11  , 10009, 'United Sta', '2126736156', 'null', 'F', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    12  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    13  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    14  TRANSACTION_DATE ) VALUES (
    15  22, 'East', 548, 'C', 'Vignola', '41 Carmine St', 'Miami', 'Florida', 10014, 'United Sta'
    16  , '2122436687', 'null', 'F', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    17  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    18  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    19  TRANSACTION_DATE ) VALUES (
    20  2, 'West', 549, 'Catherine', 'Vignola', '16 Barrow St', 'San Diego', 'California'
    21  , 10014, 'United Sta', '2129297697', '[email protected]', 'F', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    22  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    23  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    24  TRANSACTION_DATE ) VALUES (
    25  10, 'West', 550, 'Ashley', 'Weare', '275 W 96th St', 'Oakland', 'California', 10025
    26  , 'United Sta', '2128652935', '[email protected]', 'F', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    27  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    28  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    29  TRANSACTION_DATE ) VALUES (
    30  9, 'West', 551, 'Shamire A', 'Zobadi', '446 W 46th St', 'San Jose', 'California', 10036
    31  , 'United Sta', '2129740994', 'null', 'F', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    32  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    33  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    34  TRANSACTION_DATE ) VALUES (
    35  20, 'East', 552, 'Iride', 'Ciaccio', '130 Wisner Ave', 'Baltimore', 'Maryland', 12550
    36  , 'United Sta', '9145612058', '[email protected]', 'F', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    37  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    38  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    39  TRANSACTION_DATE ) VALUES (
    40  17, 'Central', 553, 'Cecil', 'Jackson', '30 Lake Dr', 'Houston', 'Texas', 12550, 'United Sta'
    41  , '9145617354', '[email protected]', 'F', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    42  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    43  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    44  TRANSACTION_DATE ) VALUES (
    45  4, 'West', 554, 'M P', 'Prabhu', '590 River Rd', 'Scottsdale', 'Arizona', 12550, 'United Sta'
    46  , '9145656155', 'null', 'F', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    47  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    48  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    49  TRANSACTION_DATE ) VALUES (
    50  16, 'Central', 555, 'Jacob', 'Agam', '221 E 61st St', 'Ann Arbour', 'Michigan', 10021
    51  , 'United Sta', '2127524408', '[email protected]', 'M', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    52  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    53  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    54  TRANSACTION_DATE ) VALUES (
    55  23, 'East', 556, 'Alkis', 'Agaphogleous', '208 W 15th St', 'Fairfax', 'Virginia', 10011
    56  , 'United Sta', '2126478725', '[email protected]', 'M', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    57  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    58  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    59  TRANSACTION_DATE ) VALUES (
    60  19, 'East', 557, 'Ponti C', 'Cia', '251 Central Park W', 'New York', 'New York', 10024
    61  , 'United Sta', '2128777400', '[email protected]', 'M', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    62  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    63  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    64  TRANSACTION_DATE ) VALUES (
    65  27, 'West', 558, 'Steve', 'Ciabbatoni', '71 Broadway', 'Phoenix', 'Arizona', 10006
    66  , 'United Sta', '2128639140', '[email protected]', 'M', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    67  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    68  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    69  TRANSACTION_DATE ) VALUES (
    70  13, 'Central', 559, 'Pascale', 'Coadou', '307 E 89th St', 'Austin', 'Texas', 10028
    71  , 'United Sta', '2128769343', '[email protected]', 'M', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    72  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    73  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    74  TRANSACTION_DATE ) VALUES (
    75  21, 'East', 560, 'Arthur G', 'Coake', '95 W 95th St', 'Boston', 'Massachusetts', 10025
    76  , 'United Sta', '2122221851', '[email protected]', 'M', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    77  INSERT INTO CUSTOMER ( DEALERSHIP_ID, REGION, CUSTOMER_NO, FIRSTNAME, LASTNAME, ADDRESS, CITY,
    78  STATE, ZIP, COUNTRY, PHONE_NUMBER, EMAIL, GENDER, AGE,
    79  TRANSACTION_DATE ) VALUES (
    80  15, 'Central', 561, 'B P', 'Coakley', '139 W 35th St', 'Minneapolis', 'Minnesota'
    81  , 10001, 'United Sta', '2126863187', 'null', 'M', 39, TO_Date( '01/10/2005 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'));
    82* end;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> select count(*) from customer;
      COUNT(*)
            16

  • How to insert more than 12 items using BDC for MB1C

    Hi,
    When we use LSMW for data transfer of MB1C transaction, more than 12 items can be  inserted in a document.
    But using BDC only 12 and below is possible, if the flat file system has more that 12 item, then the document is not created.
    How to insert more than 12 item in a document.
    Regards

    Hi Gow,
    I have uploaded the MB1C through a BDC and it is working fine for n no of items.
    Here is the code. May be this will be of your help.
    *& Report  ZMB1C
    report ZMB1C
           no standard page heading line-size 255.
    type-pools : slis.
    tables : t100.
    data: begin of record,
            MATNR(018),
            ERFMG(017),
            EXBWR(016),
          end of record.
    data : itab like table of record with header line.
    data : w_bdcdata type bdcdata.
    data : t_bdcdata type standard table of bdcdata initial size 1.
    data : messtab type standard table of bdcmsgcoll with header line.
    data : mstring(300).
    data : vf_index type i,
           no_lines type i,
           count type i value 0.
    data : v_bldat(20),
           v_budat(20).
    *Excel Sheet Data Upload Details
    data : vf_start_col type i value '1',      "start column
           vf_start_row type i value '2',      "start row
           vf_end_col   type i value '100',    "maximum column
           vf_end_row   type i value '10000'.  "maximum row
    */ Internal Table For Excel Data
    data : it_excel type  kcde_cells occurs 0 with header line.
    */ Field symbol
    field-symbols : <fs>.
    data : begin of it_messtab occurs 0,
           plant(10) type c,
           status(10) type c,
           message(90) type c,
           end of it_messtab.
    *Data for ALV display
    data : wa_fcat type slis_fieldcat_alv,
           colcnt type i.
    data : it_fieldcat type slis_t_fieldcat_alv,
           i_events type slis_t_event.
    data : l_title type sychar70.
    data : l_repid like sy-repid.
    * Selction Screen
    selection-screen begin of block b1 with frame title text-000.
    parameters : p_file like ibipparms-path obligatory,
                 p_mode like ctu_params-dismode default 'A'.
    selection-screen end of block b1.
    selection-screen begin of block b2 with frame title text-001.
    parameters : p_bldat like MKPF-BLDAT obligatory,
                 p_budat like MKPF-BUDAT obligatory,
                 p_bwart like RM07M-BWARTWA obligatory,
                 p_werks like RM07M-WERKS obligatory,
                 p_lgort like RM07M-LGORT obligatory.
    selection-screen end of block b2.
    * At Selction Screen
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = ''
        IMPORTING
          file_name     = p_file.
    *Start of Selection Event
    start-of-selection.
      call function 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          filename                = p_file
          i_begin_col             = vf_start_col
          i_begin_row             = vf_start_row
          i_end_col               = vf_end_col
          i_end_row               = vf_end_row
        TABLES
          intern                  = it_excel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          others                  = 3.
      if sy-subrc <> 0.
    * MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      if it_excel[] is initial.
        MESSAGE I000(ZCL_TCSABAP).
      else.
        sort it_excel by row col.
        loop at it_excel.
          move : it_excel-col to vf_index.
          assign component vf_index of structure itab to <fs>.
          move : it_excel-value to <fs>.
          at end of row.
            append itab.
            clear itab.
          endat.
        endloop.
      endif.
      if not itab[] is initial.
        DESCRIBE TABLE itab LINES no_lines.
        clear messtab.
        refresh messtab.
        CONCATENATE p_bldat+6(2) '.' p_bldat+4(2) '.' p_bldat(4) into v_bldat.
        CONCATENATE p_budat+6(2) '.' p_budat+4(2) '.' p_budat(4) into v_budat.
        perform map_rec.
        call transaction 'MB1C' using t_bdcdata mode p_mode update 'A'
        messages into messtab .
        clear t_bdcdata.
        refresh t_bdcdata.
        loop at messtab where msgtyp = 'E' or msgtyp = 'S' .
          select single * from t100 where sprsl = messtab-msgspra
                                    and   arbgb = messtab-msgid
                                    and   msgnr = messtab-msgnr.
          if sy-subrc = 0.
            mstring = t100-text.
            if mstring cs '&1'.
              replace '&1' with messtab-msgv1 into mstring.
              replace '&2' with messtab-msgv2 into mstring.
              replace '&3' with messtab-msgv3 into mstring.
              replace '&4' with messtab-msgv4 into mstring.
            else.
              replace '&' with messtab-msgv1 into mstring.
              replace '&' with messtab-msgv2 into mstring.
              replace '&' with messtab-msgv3 into mstring.
              replace '&' with messtab-msgv4 into mstring.
            endif.
            condense mstring.
            it_messtab-message = mstring(300).
            it_messtab-plant = p_werks.
            if messtab-msgtyp = 'E'.
              it_messtab-status = 'Error'.
            else.
              it_messtab-status = 'Success'.
            endif.
            append it_messtab.
            clear it_messtab.
          endif.
        endloop. "messtab
        if not it_messtab[] is initial.
          perform buildcatalog.
          perform display.
        endif.
      endif.
    *&      Form  Map_Rec
    *       text
    form  map_rec.
      perform bdc_dynpro      using 'SAPMM07M' '0400'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'RM07M-WVERS3'.
      perform bdc_field       using 'BDC_OKCODE'
                                    'NPE'.
      perform bdc_field       using 'MKPF-BLDAT'
                                    v_bldat.
      perform bdc_field       using 'MKPF-BUDAT'
                                    v_budat.
      perform bdc_field       using 'RM07M-BWARTWA'
                                    p_bwart.
      perform bdc_field       using 'RM07M-WERKS'
                                    p_werks.
      perform bdc_field       using 'RM07M-LGORT'
                                    p_lgort.
      perform bdc_field       using 'XFULL'
      perform bdc_field       using 'RM07M-XNAPR'
                                    'X'.
      perform bdc_field       using 'RM07M-WVERS2'
      perform bdc_field       using 'RM07M-WVERS3'
                                    'X'.
      loop at itab.
        count = count + 1.
        perform bdc_dynpro      using 'SAPMM07M' '0410'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'MSEG-EXBWR'.
        if count <> no_lines.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=NPE'.
        elseif count = no_lines.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=BU'.
        endif.
        perform bdc_field       using 'MSEG-MATNR'
                                      itab-MATNR.
        perform bdc_field       using 'MSEG-ERFMG'
                                      itab-ERFMG.
        perform bdc_field       using 'MSEG-EXBWR'
                                      itab-EXBWR.
      endloop. "itab
    endform. "Map_Rec
    **      Form  BDC_DYNPRO
    form bdc_dynpro using program dynpro.
      clear w_bdcdata.
      w_bdcdata-program  = program.
      w_bdcdata-dynpro   = dynpro.
      w_bdcdata-dynbegin = 'X'.
      append w_bdcdata to t_bdcdata.
    endform.                    "bdc_dynpro
    **      Form  BDC_FIELD
    form bdc_field using fnam fval.
      if fval <> space.
        clear w_bdcdata.
        w_bdcdata-fnam = fnam.
        w_bdcdata-fval = fval.
        append w_bdcdata to t_bdcdata.
      else.
        clear w_bdcdata.
        w_bdcdata-fnam = fnam.
        w_bdcdata-fval = fval.
        append w_bdcdata to t_bdcdata.
      endif.
    endform.                    "bdc_field
    *       FORM buildcatalog                                             *
    form buildcatalog.
      clear wa_fcat.
      clear it_fieldcat.
      colcnt = colcnt + 1.
      wa_fcat-col_pos      = colcnt.
      wa_fcat-fieldname    = 'PLANT'.
      wa_fcat-tabname      = it_messtab.
      wa_fcat-seltext_l    = 'PLANT'.
      wa_fcat-key          = 'X'.
      wa_fcat-outputlen  = '10'.
      append wa_fcat to it_fieldcat.
      clear wa_fcat.
      colcnt = colcnt + 1.
      wa_fcat-col_pos      = colcnt.
      wa_fcat-fieldname    = 'STATUS'.
      wa_fcat-tabname      = it_messtab.
      wa_fcat-seltext_l    = 'STATUS'.
      wa_fcat-outputlen  = '10'.
      append wa_fcat to it_fieldcat.
      clear wa_fcat.
      colcnt = colcnt + 1.
      wa_fcat-col_pos      = colcnt.
      wa_fcat-fieldname    = 'MESSAGE'.
      wa_fcat-tabname      = it_messtab.
      wa_fcat-seltext_l    = 'Message'.
      wa_fcat-outputlen  = '90'.
      append wa_fcat to it_fieldcat.
    endform.                    "buildcatalog
    *       FORM display                                                  *
    form display.
      l_title = text-002.
      l_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = l_repid
          i_grid_title       = l_title
          it_fieldcat        = it_fieldcat
          it_events          = i_events[]
        TABLES
          t_outtab           = it_messtab
        EXCEPTIONS
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    "display
    Regards,
    Amit

  • How to insert more than 32k xml data into oracle clob column

    how to insert more than 32k xml data into oracle clob column.
    xml data is coming from java front end
    if we cannot use clob than what are the different options available

    Are you facing any issue with my code?
    String lateral size error will come when you try to insert the full xml in string format.
    public static boolean writeCLOBData(String tableName, String id, String columnName, String strContents) throws DataAccessException{
      boolean isUpdated = true;
      Connection connection = null;
      try {
      connection = ConnectionManager.getConnection ();
      //connection.setAutoCommit ( false );
      PreparedStatement PREPARE_STATEMENT = null;
      String sqlQuery = "UPDATE " + tableName + " SET " + columnName + "  = ?  WHERE ID =" + id;
      PREPARE_STATEMENT = connection.prepareStatement ( sqlQuery );
      // converting string to reader stream
      Reader reader = new StringReader ( strContents );
      PREPARE_STATEMENT.setClob ( 1, reader );
      // return false after updating the clob data to DB
      isUpdated = PREPARE_STATEMENT.execute ();
      PREPARE_STATEMENT.close ();
      } catch ( SQLException e ) {
      e.printStackTrace ();
      finally{
      return isUpdated;
    Try this JAVA code.

  • Function with more than one return value

    Hi
    Please let me know how to write a function with more than one return value and in what scenario should we go for this option.
    Thank you

    user12540019 wrote:
    Please let me know how to write a function with more than one return value and in what scenario should we go for this option.Yes. And the following is the correct approach (using OUT variables is not!) - you deal with the multiple values as a data structure. This example uses an custom (user-defined) SQL data type as the structure.
    SQL> create or replace type TXYcoord is object(
      2          x       number,                  
      3          y       number                   
      4  );                                       
      5  /                                        
    Type created.
    SQL>
    SQL>
    SQL> create or replace function fooCoordinate( someParam number ) return TXYCoord is
      2  begin                                                                         
      3          -- doing some kind of calculation using input parameters              
      4          --  etc..
      5
      6          -- returning the multiple return values as a proper data structure
      7          return(
      8                  TXYcoord( 0, 0 )
      9          );
    10  end;
    11  /
    Function created.
    SQL>
    SQL> -- selecting the data structure
    SQL> select
      2          sysdate,
      3          fooCoordinate(123)      as XY
      4  from       dual;
    SYSDATE             XY(X, Y)
    2010-02-01 08:49:23 TXYCOORD(0, 0)
    SQL>
    SQL> -- selecting the properties/fields of the data structure
    SQL> select
      2          sysdate,
      3          treat( fooCoordinate(123) as TXYcoord).x        as X,
      4          treat( fooCoordinate(123) as TXYcoord).y        as Y
      5  from       dual;
    SYSDATE                      X          Y
    2010-02-01 08:49:23          0          0
    SQL>

  • Insert more than one contact in the same page/document

    Hello,
    I have tried without success to insert more than one contact into the same page of a document.
    For example, if i insert 2 Address book fields in a page, when i drag a contact from the address book then it populates automatically the 2 fields, and it is impossible to separate these fields and to populate them with 2 different entries (on the same page).
    And when you drag more than one contact to Pages, it asks you if you want to create one document per contact.
    Would it be possible to just insert 2 or more different contacts on the same page/document ?
    Thanks in advance for any help,
    Fred.

    Unfortunately, this can't be done with Pages, nor could it be done with AppleWorks. I think the assumption is that you would merge into a letter & one letter sent per person. In checking the 3 postcard templates in Pages 3, none of them have address book fields to drop contacts into.
    There is a workaround, but it might not be worth the effort. Create your postcard as a single, large document in page layout in landscape & merge to a new document. Then, in the print dialog, choose Layout from the drop-down menu that says Copies & Pages & choose 4 from the Pages per Sheet menu. You might also want to add a hairline border for cut lines.

  • Cannot insert more than 4000 characters using PL/SQL SP  to LONG columns

    I have created a stored procedure which will insert more than 4000 characters in a table having long column.
    The stored procedure body is as follows :
    CREATE OR REPLACE PROCEDURE INSERTTOTEST(P_ZUNIQUEID IN  VARCHAR2,P_LONGVAL  IN LONG)
    AS
    BEGIN
    insert into CLOBVALUESHOW(zuniqueid, longval) VALUES (p_zuniqueid, p_longval) ;
    COMMIT;
    END INSERTTOTEST;
    When I use the RPAD function as below, it executes without any error :
    EXEC INSERTTOTEST('ABCD123',rpad('',32000,'*'))*
    But when I run with real-time values like the following string value :
    '[ERROR] [JTA_Command_Insert_tCatalog]Error invoking Transaction Command action: JTATransactionCommand - A SQL Command Exception occured against JNJ_MDD_OCD_CPL_DS with the following command BEGIN INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1988211','09','ALB','33','NA','0','','','','ALB','8','522','305','710','50','17','208','165','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1988211','09','ALB','33','NA','0','','','','ALB','8','522','305','710','50','17','208','165','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('8257289','67','GGT','15','NA','0','','','','GGT','8','543','305','710','50','21','323','250','','','SP','1','0','','0','0','0','0','0','2','0','0','0','2','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1513209','12','PHOS','33','11','12','','','','PHOS','8','507','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1513209','12','PHOS','33','11','12','','','','PHOS','8','507','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1513209','12','PHOS','33','11','12','','','','PHOS','8','507','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1450261','03','CA','33','NA','0','','','','Ca','8','506','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1450261','03','CA','33','NA','0','','','','Ca','8','506','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1450261','03','CA','33','NA','0','','','','Ca','8','506','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1513209','12','PHOS','33','11','12','','','','PHOS','8','507','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0'); INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, tCatalog_SAPImport.StoreTemp, tCatalog_SAPImport.CartonCode, tCatalog_SAPImport.GrossLeakLimit, tCatalog_SAPImport.LeakLimit, tCatalog_SAPImport.CompValue, tCatalog_SAPImport.ProductType,tCatalog_SAPImport.CheckWeighHi, tCatalog_SAPImport.CheckWeighLo, tCatalog_SAPImport.SO_MASK, tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1450261','03','CA','33','NA','0','','','','Ca','8','506','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0');'*
    I get the error -
    Error starting at line 1 in command:
    exec P_TESTCLOB(6, '[ERROR] [JTA_Command_Insert_tCatalog]Error invoking Transaction Command action: JTATransactionCommand - A SQL Command Exception occured against JNJ_MDD_OCD_CPL_DS with the following command BEGIN INSERT INTO tCatalog_SAPImport( tCatalog_SAPImport.CatalogNo, tCatalog_SAPImport.SONumber, tCatalog_SAPImport.ChemName, tCatalog_SAPImport.RH, tCatalog_SAPImport.ExpireMonth, tCatalog_SAPImport.SlidesPerCart, tCatalog_SAPImport.IDEXX_PART_NBR, tCatalog_SAPImport.TOP_FOIL_MATL_NBR, tCatalog_SAPImport.BTM_FOIL_MATL_NBR, tCatalog_SAPImport.AltChemName, ………..tCatalog_SAPImport.CAL_CURVE_PFX, tCatalog_SAPImport.PROD_INP_TYP, tCatalog_SAPImport.CTN_TUBE, tCatalog_SAPImport.SLIDE_STYLE, tCatalog_SAPImport.PROD_DESIG, tCatalog_SAPImport.SFM_AUD_RT, tCatalog_SAPImport.SPL_RT, tCatalog_SAPImport.FIRST_SLIDES_REM, tCatalog_SAPImport.SPL_FRONT, tCatalog_SAPImport.SPL_REAR, tCatalog_SAPImport.BARCODE_TYP, tCatalog_SAPImport.CHK_WEIGH_AIM, tCatalog_SAPImport.FOIL_TYP, tCatalog_SAPImport.CART_CLIP_PRES, tCatalog_SAPImport.TOP_LBL_TYP, tCatalog_SAPImport.FREEZER_MTH, tCatalog_SAPImport.OVERAGE_MTH) VALUES('1450261','03','CA','33','NA','0','','','','Ca','8','506','305','710','50','11','323','262','','','SP','1','0','','0','0','0','0','0','2','0','0','0','1','0','0');' *(the statement continues, I have trimmed it as it is not possible that amount of length in the forum. )*
    Error report:
    ORA-06550: line 1, column 1398:
    PLS-00103: Encountered the symbol "1988211" when expecting one of the following:
    ) , * & = - + < / > at in is mod remainder not rem =>
    <an exponent (**)> <> or != or ~= >= <= <> and or like like2
    like4 likec between || multiset member submultiset
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Can anyone tell me why I am getting this error executing the same STORED PROCEDURE while inserting into the LONG column but when using RPAD functions for executing the same STORED PROCEDURE its not happening ?

    >
    But then why will the problem happen with this long string ?
    >
    You don't have a 'long string'. You have a lot of single-quoted strings combined with some unquoted strings.
    There are embedded singel quotes in what you call 'this long string'.
    Try using a different string delimiter so that the quotes do not cause a problem.
    You can use an exclamation point ('!') since there is none in the text you provided.
    Here is an example of what will not work because there is one embedded single quote
    'name LIKE '%DBMS_%%'This is the same value using exclamation as the delimiter - this works because there is no exclamation in the string
    q'!name LIKE '%DBMS_%%'!'1. q must be the first character
    2. ' (single quote) must be the next character
    3. ! (or any delimiter you choose) is the next character
    4. abcdefg. . . -- this is your string that can include single quotes but not an exclamation point
    5. ! is the next to last character - must be the same delimiter used as the third character
    6. ' (single quote) is the last character
    See the 'Text Literals' section of the SQL Reference for more examples
    http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm
    Note that this one will not work because the string includes the percent
    This is the same value using exclamation as the delimiter - this works because there is no exclamation in the string
    q'%name LIKE '%DBMS_%%'%'

  • Insert more than 4000 characters using sql plus

    I have a SQL script that creates a database. The problem is that some of the fields are longer than 4000 characters in the INSERT statement and Oracle doesn't seem to like it.
    The field is a clob and works fine in the application (i.e. I can insert more than 4000 characters using the app) - how do I achieve this in a SQL script?
    Any help is much appreciated.
    Cheers,
    Steve

    Hi,
    This pl/sql block works absolutely fine in SQL*Plus inserting > 4000 characters into clob column:
    declare
    l_str varchar2(8000);
    l_str1 varchar2(2400) := 'first part of the verly long string...';
    l_str2 varchar2(2400) := 'second part of the verly long string...';
    begin
    l_str := l_str1 || l_str2;
    insert into tmpl values (l_str);
    end;
    So, you'll have to replace inserts with pl/sql blocks in your script.
    Tested in Oracle 8.1.7.0.0
    Regards,
    Andrew Velitchko
    BrainBench MVP for Developer/2000
    http://www.brainbench.com

  • Want to Prevent Inventory Transfer More than Planned Quantity

    Dear Experts,
    I want to Prevent Inventory Transfer More than Planned Quantity. so that No one can Post any Issue for Production More than Planned Quantity has Assigned that Production Order. Using SAP Business One B1 .
    Please Advice ......
    Thanks In Advance ,
    Ajibul Hakim

    Hello Gordon,
    Thanks for your Reply . I want to Prevent Inventory transfer , which will Exceed the Planned Limit. but yesterday I Have Tried Myself again and I have succeed ! so thanks you again ,
    Also thanks to Nagarajan for your kind reply and i wanted to do like that but I want to restrict Inventory transfer...
    I have Done Like this....
    IF @object_type='67' 
      BEGIN
      IF @transaction_type='A' OR @transaction_type='U'-----Add
          BEGIN
            IF exists(SELECT * FROM  WTR1 T0
          LEFT JOIN OWTR T1 ON T1.DocEntry=T0.DocEntry
            WHERE  (T0.U_PlanQTY<(T0.Quantity+T0.U_TotalIssue)) AND T1.U_OrderType='100'
                         AND T0.DocEntry=@list_of_cols_val_tab_del)
            BEGIN
             SET @ERROR=1
             SELECT @ERROR_message = N'Issued Quantity Can not More than Planned Qty ,Check again and reconfirm please '
            END
          END   
       END
    Thanks,
    Ajibul Hakim
    Message was edited by: Ajibul Hakim

  • Sending more than one name value pair via ajaxRequest.add()

    Hi all,
    I'm implementing AJAX in Oracle Application Express to perform DML operations on a table. I need to send more than one name value pair via the ajaxRequest object. Can someone guide me how to achieve this? Say for example i need to send 2 values(need to send 2 form elements when submit button is clicked) P3_region and P3_scope. i tried the following methods.
    Method 1:
    ======
    ajaxRequest.add('P3_region',document.getElementById('P3_region').value);
    ajaxRequest.add('P3_scope',document.getElementById('P3_scope').value);
    Method 2:
    ======
    ajaxRequest.add('P3_region',document.getElementById('P3_region').value,'P3_scope',document.getElementById('P3_scope').value);
    Neither of them is fruitful. Can someone guide me how to achieve this?
    Regards,
    Balaji Radhakrishnan.

    Hi Roel,
    The javascript goes like this.
    <script language="JavaScript" type="text/javascript">
    function getElement1()
    document.getElementById('P3_Element1').value = '';
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=Element1Process',0);
    ajaxRequest.add('P3_Element2',document.getElementById('P3_Element2').value);
    ajaxRequest.add('P3_Element3',document.getElementById('P3_Element3').value);
    ajaxRequest.add('P3_Element4',document.getElementById('P3_Element4').value);
    ajaxRequest.add('P3_Element5',document.getElementById('P3_Element5').value);
    ajaxRequest.add('P3_Element6',document.getElementById('P3_Element6').value);
    ajaxResult = ajaxRequest.get();
    if(ajaxResult)
    var wsArray = ajaxResult.split("~");
    document.getElementById('P3_Element1').value = wsArray[0];
    </script>
    The application Process goes like this..
    declare
    v_Element1 VARCHAR2(60);
    begin
    select distinct Element1 into v_Element1 from TableA where Element2=:P3_Element2 AND Element3=:P3_Element3 AND Element4=:P3_Element4 AND Element5=:P3_Element5 AND Element6=:P3_Element6;
    htp.prn(v_Element1);
    exception
    when others then
    v_Element1 := 'Invalid Header Combination';
    htp.prn(v_Element1);
    end;
    The requirement goes like this..
    When i give Element2, Element3,Element4,Element5,Element6 as input in the form page the Element1 should get displayed automatically without refreshing the page. But when i use the above javascript and application process i get the Element1 loaded with some html scripts. I call the javascript using onChange() function.
    Regards,
    Balaji Radhakrishnan.

  • How can i insert more than one record a time in a JSP page?

    Hi experts,
    I'm working with JDeveloper version 3.2 application server 9i.
    I want to insert more than 1 record using a jsp page and then perform a commit at the end.
    do you can help me with this problem/challenge?
    Thank you,
    Regards,
    Mario

    statement.executeBatch() maybe?

  • Depreciation calculated on credit memo is more than its own value

    Hi,
    We have noticed that the depreciation calculated on credit memo is more than its own values.
    please refer the screen shot below:
    24.05.2010     108,044.64     120     Goods receipt     108,044.64-     0     USD
    24.05.2010     108,044.64     120     Goods receipt     108,044.64-     0     USD
    24.05.2010     108,044.64     120     Goods receipt     108,044.64-     0     USD
    09.06.2010     128,064.75     120     Goods receipt     128,064.75-     0     USD
    22.06.2010     110,601.38     120     Goods receipt     110,601.38-     0     USD
    22.06.2010     7,346.35-     105     Credit memo in acquis. year45,337.47     0     USD
    22.06.2010     7,346.35     100     External asset acquisition     45,337.47-     0     USD
    Please let us know the possible reasons...
    Thanks a lot..

    Hi,
    Here are the details:
    Depreciation start date:21.11.2004
    Operating readiness: 23.12.2004
    Asset value date: 16.08.2010
    useful life: 01 period
    Kindly tell me know in case you need further info
    Thanks..
    Edited by: FI User on Oct 21, 2010 9:47 AM

  • BAPI_PR_CHANGE (Not Able to insert more than 3 Line Items)

    Hi Friends,
    I have Issue with BAPI_PR_CHANGE.
    I could Able to insert up to 3 lines items using this BAPI but if I am Trying to Insert More Than 3 BAPI throwing Dump.
    Any Idea on this?
    Any Parameter I need to pass for more than 3 line items.
    Let me know any help on this BAPI...I am on ecc 6.0.
    Thanks,
    Yogesh Patil

    We are on ECC 6.0 and have no problems creating a PR with 100+ line items or adding multiple lines to a existing PR . Please paste the first page of the dump to help me answer your question.
    Thanks,
    Raj

Maybe you are looking for