Case issue in Database table

Hi All,
We have an issue of lowercase in database table and we want to convert that lowercase data to upper case. The code for doing this operation is as follows:
SELECT * FROM zehs_volumes INTO TABLE i_volumes_temp.
LOOP AT i_volumes_temp.
DELETE zehs_volumes FROM i_volumes_temp.
IF sy-subrc is INITIAL.
  COMMIT WORK.
ELSE.
  ROLLBACK WORK.
ENDIF.
TRANSLATE i_volumes_temp-zehs_business TO UPPER CASE.
MODIFY i_volumes_temp.
CLEAR i_volumes_temp.
ENDLOOP.
SORT i_volumes_temp BY SUBID ZEHS_BUSINESS ZEHS_SITE ZEHS_ROLE
                       ZST_DATE ZED_DATE.
DELETE ADJACENT DUPLICATES
FROM i_volumes_temp COMPARING SUBID ZEHS_BUSINESS ZEHS_SITE
                              ZEHS_ROLE ZST_DATE ZED_DATE.
MODIFY zehs_volumes FROM TABLE i_volumes_temp.
IF sy-subrc is INITIAL.
  COMMIT WORK.
ELSE.
  ROLLBACK WORK.
ENDIF.
The problem wid the above code is that it first clears the entire database table and then fills it with the modified data from the internal table. But we do not want to take risk of emptying the database table. Is there any way out to perform the above operation?
Thanks in advance
Regards,
Yogesh Sharma

Hi Karthik,
Thanks for replying.
In our case the scenario is we need to delete wrong entires in the database table based on the primary input fields. There is already a utility to do so. But in the table some of the entries are present in the lower case.
For eg. Suppose we need to delete entry with field zehs_business = "Pioneer". When we input this SAP interpret it as PIONEER and we get an error message "No data exist".
So the code should we in such a way that all the value in field zehs_business should be translated to upper case otherwise SAP will give an error message of non-existence of data.
The code which you gave adds one more entry in database table with zehs_business = "PIONEER". Now the database table have two records one with "Pioneer" and other with "PIONEER". After the execution of DELETE statement only the record with zehs_business = PIONEER gets deleted....and the other record still exist.
Is there any way to avoid above situation....

Similar Messages

  • Issues seeing database tables in DW CS5

    Hello,  I'm writing PHP pages to manage, create new, edit and delete rows in some tables in a mySQL database I've created.
    I've connected successfuly and see all 5 tables in the database tab
    However, of the five tables in the database when I click on and expand the tables in the database tab only two show the rows that are set up.
    On the tables with the row information I can get and place data with no issue.
    On the tables without the row information I can pull data but not place new or update the rows.
    Any ideas?

    Hello,  I'm writing PHP pages to manage, create new, edit and delete rows in some tables in a mySQL database I've created.
    I've connected successfuly and see all 5 tables in the database tab
    However, of the five tables in the database when I click on and expand the tables in the database tab only two show the rows that are set up.
    On the tables with the row information I can get and place data with no issue.
    On the tables without the row information I can pull data but not place new or update the rows.
    Any ideas?

  • Issue with Database table adapter

    Hi,
    Iam working on OIM 9.1.0.1
    I login as an end user & self request the DB table which is configured.
    User can assign & the xelsysadm approves ..
    The approval task is completed as seen in the End User page. In the Task Assignment History -->Task status is Pending
    Can anyone help me out on this issue.
    Error seen on console.
    ERROR,19 Feb 2011 16:00:01,421,[XELLERATE.ACCOUNTMANAGEMENT],Class/Method: tcUse
    rOperationsBean/updateUserData encounter some problems: maoErrors:An error occur
    red while retrieving process information null
    ERROR,19 Feb 2011 16:00:01,437,[XELLERATE.SCHEDULER.TASK],Class/Method: tcTskUsr
    Provision/checkPolicyUpdateFlags encounter some problems: An error occurred whil
    e retrieving process information null
    Thor.API.Exceptions.tcAPIException: An error occurred while retrieving process i
    nformation null
    at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData(Unk
    nown Source)
    at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUser(Unknown
    Source)
    at com.thortech.xl.ejb.beans.tcUserOperationsSession.updateUser(Unknown
    Source)
    at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl.updateUser(t
    cUserOperations_voj9p2_EOImpl.java:4747)
    at Thor.API.Operations.tcUserOperationsClient.updateUser(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor320.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.security.Security.runAs(Security.java:41)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Sou
    rce)
    at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
    at $Proxy51.updateUser(Unknown Source)
    at com.thortech.xl.schedule.tasks.tcTskUsrProvision.checkPolicyUpdateFla
    gs(Unknown Source)
    at com.thortech.xl.schedule.tasks.tcTskUsrProvision.execute(Unknown Sour
    ce)
    at com.thortech.xl.scheduler.tasks.SchedulerBaseTask.run(Unknown Source)
    at com.thortech.xl.scheduler.core.quartz.QuartzWrapper$TaskExecutionActi
    on.run(Unknown Source)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.security.Security.runAs(Security.java:41)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Sou
    rce)
    at com.thortech.xl.scheduler.core.quartz.QuartzWrapper.execute(Unknown S
    ource)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:178)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.j
    ava:477)
    Running GENERICADAPTER
    Target Class = com.thortech.xl.gc.runtime.GCAdapterLibrary

    It's a new error now..
    The Create User task is Rejected with the below error in console.
    Running GENERICADAPTER
    Target Class = com.thortech.xl.gc.runtime.GCAdapterLibrary
    ERROR,21 Feb 2011 17:45:42,171,[XELLERATE.APIS],
    java.lang.NullPointerException
    at com.thortech.xl.ejb.beansimpl.GCOperationsBean.getModelFromConnectorD
    efinition(Unknown Source)
    at com.thortech.xl.ejb.beansimpl.GCOperationsBean.lookup(Unknown Source)
    at com.thortech.xl.ejb.beans.GCOperationsSession.lookup(Unknown Source)
    at com.thortech.xl.ejb.beans.GCOperations_do1ndy_EOImpl.lookup(GCOperati
    ons_do1ndy_EOImpl.java:576)
    at Thor.API.Operations.GCOperationsClient.lookup(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.security.Security.runAs(Security.java:41)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Sou
    rce)
    at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
    at $Proxy79.lookup(Unknown Source)
    at com.thortech.xl.gc.runtime.GCAdapterLibrary.executeFunctionality(Unkn
    own Source)
    at sun.reflect.GeneratedMethodAccessor373.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpMY_NEWTESTUSERS_GTC
    .GENERICADAPTER(adpMY_NEWTESTUSERS_GTC.java:125)
    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpMY_NEWTESTUSERS_GTC
    .implementation(adpMY_NEWTESTUSERS_GTC.java:70)
    at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Sour
    ce)
    at com.thortech.xl.dataobj.tcScheduleItem.eventPostInsert(Unknown Source
    at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcORC.insertNonConditionalMilestones(Unknown
    Source)
    at com.thortech.xl.dataobj.tcORC.completeSystemValidationMilestone(Unkno
    wn Source)
    at com.thortech.xl.dataobj.tcOrderItemInfo.completeCarrierBaseMilestone(
    Unknown Source)
    at com.thortech.xl.dataobj.tcOrderItemInfo.eventPostInsert(Unknown Sourc
    e)
    at com.thortech.xl.dataobj.tcUDProcess.eventPostInsert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcORC.autoDOBSave(Unknown Source)
    at com.thortech.xl.dataobj.util.tcOrderPackages.createOrder(Unknown Sour
    ce)
    at com.thortech.xl.dataobj.util.tcOrderPackages.orderPackageForUser(Unkn
    own Source)
    at com.thortech.xl.dataobj.tcOIU.provision(Unknown Source)
    at com.thortech.xl.dataobj.tcOIU.eventPostInsert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcOBI.checkApproved(Unknown Source)
    at com.thortech.xl.dataobj.tcOBI.eventPostUpdate(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcOBI.approve(Unknown Source)
    at com.thortech.xl.dataobj.tcRequestObject.handleApprovalLaunch(Unknown
    Source)
    at com.thortech.xl.dataobj.tcREQ.launchObjectApprovals(Unknown Source)
    at com.thortech.xl.dataobj.tcREQ.eventPostUpdate(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcREQ.checkRequestReceived(Unknown Source)
    at com.thortech.xl.dataobj.tcREQ.eventPostUpdate(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.schedule.jms.requestapproval.InitRequestApproval.exec
    ute(Unknown Source)
    at com.thortech.xl.schedule.jms.requestapproval.InitRequestApproval.exec
    ute(Unknown Source)
    at com.thortech.xl.schedule.jms.messagehandler.MessageProcessUtil.proces
    sMessage(Unknown Source)
    at com.thortech.xl.schedule.jms.messagehandler.MessageHandlerMDB.onMessa
    ge(Unknown Source)
    at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:46
    6)
    at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDL
    istener.java:371)
    at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:
    327)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4547)
    at weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
    at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
    at weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
    at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:505
    8)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
    gWorkManagerImpl.java:516)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    ERROR,21 Feb 2011 17:45:42,250,[XELLERATE.APIS],An exception occurred while crea
    ting the GenericConenctor Model from the Connector Definition file
    ERROR,21 Feb 2011 17:45:42,250,[XELLERATE.APIS],An exception occurred while gene
    rating Generic Connector model from the connector definition xml of the connecto
    r 'MY_NEWTESTUSERS'
    com.thortech.xl.gc.exception.ConnectorDefinitionOperationsException: An exceptio
    n occurred while creating the GenericConenctor Model from the Connector Definiti
    on file
    at com.thortech.xl.ejb.beansimpl.GCOperationsBean.getModelFromConnectorD
    efinition(Unknown Source)
    at com.thortech.xl.ejb.beansimpl.GCOperationsBean.lookup(Unknown Source)
    at com.thortech.xl.ejb.beans.GCOperationsSession.lookup(Unknown Source)
    at com.thortech.xl.ejb.beans.GCOperations_do1ndy_EOImpl.lookup(GCOperati
    ons_do1ndy_EOImpl.java:576)
    at Thor.API.Operations.GCOperationsClient.lookup(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.security.Security.runAs(Security.java:41)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Sou
    rce)
    at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
    at $Proxy79.lookup(Unknown Source)
    at com.thortech.xl.gc.runtime.GCAdapterLibrary.executeFunctionality(Unkn
    own Source)
    at sun.reflect.GeneratedMethodAccessor373.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpMY_NEWTESTUSERS_GTC
    .GENERICADAPTER(adpMY_NEWTESTUSERS_GTC.java:125)
    at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpMY_NEWTESTUSERS_GTC
    .implementation(adpMY_NEWTESTUSERS_GTC.java:70)
    at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
    at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Sour
    ce)
    at com.thortech.xl.dataobj.tcScheduleItem.eventPostInsert(Unknown Source
    at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcORC.insertNonConditionalMilestones(Unknown
    Source)
    at com.thortech.xl.dataobj.tcORC.completeSystemValidationMilestone(Unkno
    wn Source)
    at com.thortech.xl.dataobj.tcOrderItemInfo.completeCarrierBaseMilestone(
    Unknown Source)
    at com.thortech.xl.dataobj.tcOrderItemInfo.eventPostInsert(Unknown Sourc
    e)
    at com.thortech.xl.dataobj.tcUDProcess.eventPostInsert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcORC.autoDOBSave(Unknown Source)
    at com.thortech.xl.dataobj.util.tcOrderPackages.createOrder(Unknown Sour
    ce)
    at com.thortech.xl.dataobj.util.tcOrderPackages.orderPackageForUser(Unkn
    own Source)
    at com.thortech.xl.dataobj.tcOIU.provision(Unknown Source)
    at com.thortech.xl.dataobj.tcOIU.eventPostInsert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcOBI.checkApproved(Unknown Source)
    at com.thortech.xl.dataobj.tcOBI.eventPostUpdate(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcOBI.approve(Unknown Source)
    at com.thortech.xl.dataobj.tcRequestObject.handleApprovalLaunch(Unknown
    Source)
    at com.thortech.xl.dataobj.tcREQ.launchObjectApprovals(Unknown Source)
    at com.thortech.xl.dataobj.tcREQ.eventPostUpdate(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcREQ.checkRequestReceived(Unknown Source)
    at com.thortech.xl.dataobj.tcREQ.eventPostUpdate(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
    at com.thortech.xl.schedule.jms.requestapproval.InitRequestApproval.exec
    ute(Unknown Source)
    at com.thortech.xl.schedule.jms.requestapproval.InitRequestApproval.exec
    ute(Unknown Source)
    at com.thortech.xl.schedule.jms.messagehandler.MessageProcessUtil.proces
    sMessage(Unknown Source)
    at com.thortech.xl.schedule.jms.messagehandler.MessageHandlerMDB.onMessa
    ge(Unknown Source)
    at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:46
    6)
    at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDL
    istener.java:371)
    at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:
    327)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4547)
    at weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
    at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
    at weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
    at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:505
    8)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
    gWorkManagerImpl.java:516)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.NullPointerException
    ... 76 more
    ERROR,21 Feb 2011 17:45:42,312,[XELLERATE.GC.FRAMEWORKPROVISIONING],An exception
    occurred while generating Generic Connector model from the connector definition
    xml of the connector 'MY_NEWTESTUSERS'

  • Rebate related issue with database table VKDFS & VBAK

    Hi everybody,
    I am facing the problem with the tables VKDFS and VBAK.
    In my program the report has to display the details of the agrement numbers concerning to the sale or billing doucmnets later on it has to create a credit memo for that particular customer.
    In the coding the program in very beging step, it is fetching all sales documents from VKDFS as per selections like following.
      select        * from  vkdfs into table ivkdfs
             where  fktyp  in r_fktyp
             and    vkorg  in s_vkorg
             and    fkdat  in s_fkdat
             and    kunnr  in s_kunnr
             and    fkart  in s_fkart
             and    vbeln  in s_vbeln
             and    faksk  in s_faksk
             and    vtweg  in s_vtweg
             and    spart  in s_spart
             and    netwr  in s_netwr
             and    waerk  in s_waerk.
    After this whatever the sales orders fetched here, for those all again its fetching from VBAK table as following.
    SVBAK[] = IVKDFS[]
    select * from vbak into table ivbak
      for all entries in svbak
      where vbeln = svbak-vbeln
      and   knuma in s_knuma
      and   auart in s_auart
      and   submi in s_submi
      and  (vbak_wtab).
    So, its filtering from VBAK.
    But the exact issue is that, there is one sales order which is available in VBAK but does not available in VKDFS table.
    So, my program fails to display the report regarding to that agreement number.
    As per my analysis I came to know that there are no entries in VKDFS table against to the sales orders in VBAK concerning agreement numbers.
    VKDFS-SD index: billing initiator table.
    I want to know how come this VKDFS table is updating against to VBAK table. If possible how to make this entry in that table against to the values in VBAK. But it should not effect other tables.
    Please let me know the solution if you people have any .
    Its an urgent and sev 1 tickets
    eagerly waiting for solution or some information.
    Thanks&Regards.
    J.

    Hi everybody,
    I am facing the problem with the tables VKDFS and VBAK.
    In my program the report has to display the details of the agrement numbers concerning to the sale or billing doucmnets later on it has to create a credit memo for that particular customer.
    In the coding the program in very beging step, it is fetching all sales documents from VKDFS as per selections like following.
      select        * from  vkdfs into table ivkdfs
             where  fktyp  in r_fktyp
             and    vkorg  in s_vkorg
             and    fkdat  in s_fkdat
             and    kunnr  in s_kunnr
             and    fkart  in s_fkart
             and    vbeln  in s_vbeln
             and    faksk  in s_faksk
             and    vtweg  in s_vtweg
             and    spart  in s_spart
             and    netwr  in s_netwr
             and    waerk  in s_waerk.
    After this whatever the sales orders fetched here, for those all again its fetching from VBAK table as following.
    SVBAK[] = IVKDFS[]
    select * from vbak into table ivbak
      for all entries in svbak
      where vbeln = svbak-vbeln
      and   knuma in s_knuma
      and   auart in s_auart
      and   submi in s_submi
      and  (vbak_wtab).
    So, its filtering from VBAK.
    But the exact issue is that, there is one sales order which is available in VBAK but does not available in VKDFS table.
    So, my program fails to display the report regarding to that agreement number.
    As per my analysis I came to know that there are no entries in VKDFS table against to the sales orders in VBAK concerning agreement numbers.
    VKDFS-SD index: billing initiator table.
    I want to know how come this VKDFS table is updating against to VBAK table. If possible how to make this entry in that table against to the values in VBAK. But it should not effect other tables.
    Please let me know the solution if you people have any .
    Its an urgent and sev 1 tickets
    eagerly waiting for solution or some information.
    Thanks&Regards.
    J.

  • Japanese and English together in database table?

    Hi all, on to my next challenge... ;-)
    I'm wondering if there are any issues with database tables that contain both Japanese and English (Roman) characters. I'm in the process of establishing an online language-learning site that will target (mostly) customers in Japan. As part of the registration process, I need to collect names in kanji (Japanese characters) along with other information in roman script (email, username, password, etc.).
    Right now I have these fields set to utf8_unicode_ci collation. Is this correct? Am I confusing character set with collation? I doubt very many of you have experience in this area, but if you do I'd love to hear from you.
    David

    Hi,
    I don´t know if my answer is of help in your particular situation -- however, I once made a CMS with ADDT where form pages had to contain both english & russian input fields, I succeeded having them display the respective chars differently this way:
    1. setting the page´s "content-type" to UTF-8
    2. no need to apply something to the "english" aka roman form fields, but...
    3. adding the following bold stuff to the "value" of a russian field, example for PHP:
    " size="100" maxlength="240" />
    I actually didn´t define any "collation" for the MySQL database, so I can´t say something about that.
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Efficient way of updating data to database table

    what is the efficient way of updating data to database table  .
    i have huge amount of data in my internal table  , how to use update statement in this case .
    1. database table having 20 fields  ,
    2. one is key field and suppose 20 th field i want to change  .
    3. I have data for only 2 fields , i.e for ( 1 st and last 20 th field ) .
    i can't use update statement in loop , as it is not good practice(hits database several times ) .
    do it effects all the 20 fields for  particular record .

    Hi,
    Use UPDATE statement , check below description from SAP help.
    UPDATE dbtab FROM TABLE itab. or UPDATE (dbtabname) FROM TABLE itab.
    Effect
    Mass update of several lines in a database table.Here, the primary key for identifying the lines tobe updated and the values to be changed are taken from the lines of theinternal table itab. 
    The system field SY-DBCNT contains the number of updated lines,i.e. the number of lines in the internal table itab which havekey values corresponding to lines in the database table.
    Regards
    L Appana

  • Issue with fields of a database table

    Hi All,
    While browsing through database table T2515, i have observed that in 'fields' tab, there are only 2 fields visible ie MANDT and WWSSN.
    When we see the contents of table, there will be one more additional field called BEZTEK.
    Now my requirement is to retrieve data from both WWSSN and BEZTEK fields.
    How to define internal table and how to write select statement in such cases?
    Moreover, from where this BEZTEK will get populate, when we see the contents of table in se11?
    Regards
    Pavan

    Hi,
    BEZTEK may be coming from the Text table related to T2515.  See the text table of T2515 (SE11 -> Menu option Goto -> Text Table).
    Regards
    Vinod

  • Issue creating a Database table with a decimal key field

    Hi guys!
    Can you try this?
    - Create a Database Table ZTEST via SE11 with just the client field and a decimal field (which has to be a key field)
    - Create a corresponding text table for ZTEST with SPRAS, and a TEXT field
    - Create the dialog maintance view and enter some random data through SM30 (5 or 6 rows)
    Then go to SE11, display table ZTEST and click contents to show the data you just entered.
    Is there anything strange? In my case there is, actually: Not all text fields are shown, nevertheless if i try to display the data through SM30 the data is shown correctly....
    I've tried this in several releases and is always the same.
    Do you know why this is?
    Thanks in advance.

    Thanks for the answer.
    Unfortunately, this is not the case, the tables are correctly linked.
    Please look at the following snapshot, the first one, corresponds to the SE11 of the original table, the second one is the SE11 of the text table, and finally the third one is the SM30 of the original table.
    [Snapshot|http://img100.imageshack.us/img100/5071/testkl.jpg]

  • Database table update issue

    Hello experts, Need your Help...
    I am trying to update database table using Update command. And I am doing COMMIT WORK AND WAIT. after the successful update.
    But my code sometimes does not work and the table is not updated.
    Sometimes the code works and sometimes not.. for the same data.
    Can anybody think of any possible reason?
    Thanks in advance,
    --Kumail

    Hello Guys,
    Here is the code, here we have all the keys... as it updates correctly sometimes. But doesnt update sometimes... for same data...... I have added COMMITT and WAIT statements to solve this problem.... but no luck....
            UPDATE zfxx_bsr_data
                SET zfxxstatus_glr  = zfxx_bsr_data-zfxxstatus_glr
                zfxxstatus_issue = zfxx_bsr_data-zfxxstatus_issue
                    zfxxerdat_glr   = sy-datum
                    zfxxuser_glr    = sy-uname
                    zfxxremark_glr  = zfxx_bsr_data-zfxxremark_glr
                    zfxxertime_glr  = sy-uzeit
                  doc_ind         = w_doc_ind                  
                  zfxx_attach_acc = w_zfxx_att_acc      
              WHERE bukrs        EQ t001-bukrs
              AND   saknr        EQ zfxx_bsr_data-saknr
              AND   zfxxperiod   EQ zfxx_bsr_data-zfxxperiod
              AND   zfxxfield    EQ c_ba
              AND   zfxxfieldval EQ tgsb-gsber.
            IF sy-subrc EQ 0.
              WAIT UP TO 3 SECONDS.
              COMMIT WORK.
              WAIT UP TO 3 SECONDS.
            ENDIF.

  • TSQL - Dynamic Query Case statment update issue - to update table by left shifting the rows

    Hi all
    I need an help on my tsql query in 2000 to fix the case statement.
    I have a table like shown below.
    On this table where ever I see PortID as 101 and 105 I need to remove it and shift the rows from right to left.
    ie on First row PortID1 is 101 so I need to remove it and replace it with PortId2 and similarly PortID2 replaced my PortID3 and so on.
    ie like on excel if you delete cell we need to shift the rows to left .
    I wrote an dynamic update statement i,m not sure on the assigning dynamic case statment.
    CREATE TABLE [TravelRank]
    [Destination] [varchar] (50) NULL,
    [PortID1] [int] NULL ,
    [Distance1] [int] NULL ,
    [Rating1] [int] NULL ,
    [PortID2] [int] NULL ,
    [Distance2] [int] NULL ,
    [Rating2] [int] NULL ,
    [PortID3] [int] NULL ,
    [Distance3] [int] NULL ,
    [Rating3] [int] NULL ,
    [PortID4] [int] NULL ,
    [Distance4] [int] NULL ,
    [Rating4] [int] NULL
    INSERT into [TravelRank]
    select 'Virgin Islands','101','10','5','102','20','5','103','31','5','109','41','5'
    Union all
    select 'Guinea','101','15','3','102','22','3','105','32','2','110','45','4'
    Union all
    select 'Benin ','102','12','4','106','28','4','104','33','3','109','48','2'
    Union all
    select 'Ecuador','102','18','5','101','29','5','108','34','1','111','45','5'
    Union all
    select 'Belarus ','103','17','4','105','24','4','108','45','4','112','46','3'
    Union all
    select 'Cook Islands','105','11','2','108','23','2','101','32','2','107','42','4'
    Here is my code to fix
    declare @SQL varchar(4000)
    declare @left varchar(1)
    declare @right varchar(1)
    select @left = '1',@right = '2'
    while @left < 4
    begin
    select @SQL = '
    update t1.PortID' + @left + ' = t2.PortID' + @right + '
    t1.Distance' + @left + ' = t2.Distance' + @right + '
    t1.Rating' + @left + ' = t2.Rating' + @right + '
    'case @left
    when '1' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+3 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+3 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+3 as varchar(1)) +'
    ' when '2' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+2 as varchar(1)) +'
    ' when '3' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    ' when '3' then
    ' t1.PortID' + @left + ' = null '
    t1.Distance' + @left + ' = null '
    t1.Rating' + @left + ' = null '
    else '' end'
    from [TravelRank] t1
    inner join [TravelRank] t2
    on t1.destination = t2.destination
    where t1.PortID1 = 101'
    print @SQL
    -- exec (@SQL)
    select @left = cast(cast(@left as int) + 1 as varchar(1))
    , @right = cast(cast(@right as int) + 1 as varchar(1))
    end
    Thanks a lot in advance.

    declare @SQL varchar(4000)
    declare @left varchar(1)
    declare @right varchar(1)
    select @left = '1',@right = '2'
    while @left < 4
    begin
    select @SQL = '
    update t1.PortID' + @left + ' = t2.PortID' + @right + '
    t1.Distance' + @left + ' = t2.Distance' + @right + '
    t1.Rating' + @left + ' = t2.Rating' + @right + '
    '+CASE @left
    when '1' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+3 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+3 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+3 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+3 as varchar(1)) +'
    ' when '2' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.PortID' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+2 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+2 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+2 as varchar(1)) +'
    ' when '3' then
    ' t1.PortID' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.PortID' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Distance' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Distance' + cast(cast(@right as int)+1 as varchar(1)) +'
    t1.Rating' + cast(cast(@left as int)+1 as varchar(1)) + ' = t2.Rating' + cast(cast(@right as int)+1 as varchar(1)) +'
    ' when '3' then
    ' t1.PortID' + @left + ' = null '+
    ' t1.Distance' + @left + ' = null '+
    ' t1.Rating' + @left + ' = null '
    else '' END + '
    from [TravelRank] t1
    inner join [TravelRank] t2
    on t1.destination = t2.destination
    where t1.PortID1 = 101'
    print @SQL
    -- exec (@SQL)
    select @left = cast(cast(@left as int) + 1 as varchar(1))
    , @right = cast(cast(@right as int) + 1 as varchar(1))
    end
    You were missing a couple of concats. This runs now, but I'm not completely sure if it's the output you were expecting.

  • Best Practice for Designing Database Tables?

    Hi,
    I work at a company for tracking devices (GPS Devices). Our SQL Server database is designed to have a table for each device we sell, currently there is 2500 tables in our database and they all have the same columns they only differ in table name. Each device
    sends about 4K records per day.
    currently each table hold from 10K records to 300K records
    What is the best practice to design a database in this situation? 
    When accessing database from a C# application, which is better to use, direct SQL commands or views? 
    a detailed description about what is best to do in such scenario would be great. 
    Thanks in advance.
    Edit:
    Tables columns are:
    [MessageID]
          ,[MessageUnit]
          ,[MessageLong]
          ,[MessageLat]
          ,[MessageSpeed]
          ,[MessageTime]
          ,[MessageDate]
          ,[MessageHeading]
          ,[MessageSatNumber]
          ,[MessageInput]
          ,[MessageCreationDate]
          ,[MessageInput2]
          ,[MessageInput3]
          ,[MessageIO]

    Hello Louis, thank you so much for your informative post. I'll describe in detail what situations I came through my 9 months of work in the company (working as a software engineer, but I am planning to take over database maintenance since no one is maintaining
    it right now and I cannot do anything else in the code to make it faster)
    At every end of the month our clients generate report for the previous month for all their cars, some clients have 100+ cars, and some have few. This is when real issue start, they are calling their data from our server through internet while having 2000
    unit sending data to our server, they keep on getting read time out since SQL Server gives priority to insert and hold all select commands. I solved it temporary in the code using "Read Uncommitted" once I initialize a connection through C#. 
    The other issue is generating reports for a month or two takes lots of time when selecting 100+ units. Thats what I want to solve, the problem is the one who wrote the C# app used hard coded SQL Statements
    AND
    the company is refusing to upgrade from SQL Server 2003 and Windows Server 2003. 
    Now talking about reports, there are summary reports, stops reports, zone reports ..etc most of them depend usually on at least MessageTime, MessageDate, MessageSpeed, MessageIO and MessageSatNumber.
    So from your post I conclude that for now I need to set snapshots so that select statements don't get kicked out in favor for insert commands, but does SQL Server automatically select from the snapshots or do I have to tell it to do so? 
    Other than proper indexing what else I need? Tom
    Phillips suggested Table partitioning but I don't think it is needed in my case since our database size is 78GB
    When I run code analysis on the app, Visual Studio tells me I better use stored procedures, views than using hard coded Select Statements, what difference will this bring me when talking about performance?
    Thanks in advance. 

  • [Forum FAQ] How to configure a Data Driven Subscription which get multi-value parameters from one column of a database table?

    Introduction
    In SQL Server Reporting Services, we can define a mapping between the fields that are returned in the query to specific delivery options and to report parameters in a data-driven subscription.
    For a report with a parameter (such as YEAR) that allow multiple values, when creating a data-driven subscription, how can we pass a record like below to show correct data (data for year 2012, 2013 and 2014).
    EmailAddress                             Parameter                      
    Comment
    [email protected]              2012,2013,2014               NULL
    In this article, I will demonstrate how to configure a Data Driven Subscription which get multi-value parameters from one column of a database table
    Workaround
    Generally, if we pass the “Parameter” column to report directly in the step 5 when creating data-driven subscription.
    The value “2012,2013,2014” will be regarded as a single value, Reporting Services will use “2012,2013,2014” to filter data. However, there are no any records that YEAR filed equal to “2012,2013,2014”, and we will get an error when the subscription executed
    on the log. (C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles)
    Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportParameterException: Default value or value provided for the report parameter 'Name' is not a valid value.
    This means that there is no such a value on parameter’s available value list, this is an invalid parameter value. If we change the parameter records like below.
    EmailAddress                        Parameter             Comment
    [email protected]         2012                     NULL
    [email protected]         2013                     NULL
    [email protected]         2014                     NULL
    In this case, Reporting Services will generate 3 reports for one data-driven subscription. Each report for only one year which cannot fit the requirement obviously.
    Currently, there is no a solution to solve this issue. The workaround for it is that create two report, one is used for view report for end users, another one is used for create data-driven subscription.
    On the report that used create data-driven subscription, uncheck “Allow multiple values” option for the parameter, do not specify and available values and default values for this parameter. Then change the Filter
    From
    Expression:[ParameterName]
    Operator   :In
    Value         :[@ParameterName]
    To
    Expression:[ParameterName]
    Operator   :In
    Value         :Split(Parameters!ParameterName.Value,",")
    In this case, we can specify a value like "2012,2013,2014" from database to the data-driven subscription.
    Applies to
    Microsoft SQL Server 2005
    Microsoft SQL Server 2008
    Microsoft SQL Server 2008 R2
    Microsoft SQL Server 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    For every Auftrag, there are multiple Position entries.
    Rest of the blocks don't seems to have any relation.
    So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
    Try out this snippet.
    DATA lt_data TYPE TABLE OF string.
    DATA lv_data TYPE string.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename = 'C:\temp\test.txt'
      CHANGING
        data_tab = lt_data
      EXCEPTIONS
        OTHERS   = 19.
    CHECK sy-subrc EQ 0.
    TYPES:
    BEGIN OF ty_str,
      a1 TYPE string,
      a2 TYPE string,
      a3 TYPE string,
      p1 TYPE string,
      p2 TYPE string,
      p3 TYPE string,
    END OF ty_str.
    DATA: lt_str TYPE TABLE OF ty_str,
          ls_str TYPE ty_str,
          lv_block TYPE string,
          lv_flag TYPE boolean.
    LOOP AT lt_data INTO lv_data.
      CASE lv_data.
        WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
             OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
          lv_block = lv_data.
          lv_flag = abap_false.
        WHEN OTHERS.
          lv_flag = abap_true.
      ENDCASE.
      CHECK lv_flag EQ abap_true.
      CASE lv_block.
        WHEN '[Auftrag]'.
          SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
        WHEN '[Position]'.
          SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
          APPEND ls_str TO lt_str.
      ENDCASE.
    ENDLOOP.

  • Error while connecting Database Table

    Hi, I am trying to connect to the Oracle Database Table using Out-Of-Box Database Table Adapter. While trying to configure, i am able to connect to the desired database and tables but when i trying to save the configuration i am getting the folllowing error :
    com.waveset.util.XmlParseException: XML Error: 3:16: The markup in the document following the root element must be well-formed.
    Will appreciate any help on this ...
    Thanks

    I have seen that before and we have never been able to find the cause of the issue.
    If you have a support contract log a case, we might be able to find more if we have two cases with the same issue.
    WilfredS

  • Printing out results in case of object-relational table (Oracle)

    I have made a table with this structure:
    CREATE OR REPLACE TYPE Boat AS OBJECT(
    Name varchar2(30),
    Ident number,
    CREATE OR REPLACE TYPE Type_boats AS TABLE OF Boat;
    CREATE TABLE HOUSE(
    Name varchar2(40),
    MB Type_boats)
    NESTED TABLE MB store as P_Boat;
    INSERT INTO House VALUES ('Name',Type_boats(Boat('Boat1', 1)));
    I am using java to print out all the results by calling a procedure.
    CREATE OR REPLACE package House_boats
    PROCEDURE add(everything works here)
    PROCEDURE results_view;
    END House_boats;
    CREATE OR REPLACE Package.body House_boats AS
    PROCEDURE add(everything works here) AS LANGUAGE JAVA
    Name House_boats.add(...)
    PROCEDURE results_view AS LANGUAGE JAVA
    Name House_boats.resuts_view();
    END House_boats;
    However, I am not able to get Results.view working in case of object-relation table. This is how I do it in the situation of relational table.
    CALL House_boats.results_view();
    House_boats.java file which is loaded using LOADJAVA:
    import java.sql.*;
    import java io.*;
    public class House_boats {
    public static void results_view ()
       throws SQLException
       { String sql =
       "SELECT * from House";
       try { Connection conn = DriverManager.getConnection
    ("jdbc:default:connection:");
       PreparedStatement pstmt = conn.prepareStatement(sql);
       ResultSet rset = pstmt.executeQuery();
      printResults(rset);
      rset.close();
      pstmt.close();
       catch (SQLException e) {System.err.println(e.getMessage());
    static void printResults (ResultSet rset)
       throws SQLException { String buffer = "";
       try { ResultSetMetaData meta = rset.getMetaData();
       int cols = meta.getColumnCount(), rows = 0;
       for (int i = 1; i <= cols; i++)
       int size = meta.getPrecision(i);
       String label = meta.getColumnLabel(i);
       if (label.length() > size) size = label.length();
       while (label.length() < size) label += " ";
      buffer = buffer + label + " "; }
      buffer = buffer + "\n";
       while (rset.next()) {
      rows++;
       for (int i = 1; i <= cols; i++) {
       int size = meta.getPrecision(i);
       String label = meta.getColumnLabel(i);
       String value = rset.getString(i);
       if (label.length() > size) size = label.length();
       while (value.length() < size) value += " ";
      buffer = buffer + value + " ";  }
      buffer = buffer + "\n";   }
       if (rows == 0) buffer = "No data found!\n";
       System.out.println(buffer); }
       catch (SQLException e) {System.err.println(e.getMessage());}  }
    How do I print out the results correctly in my case of situation?
    Thank you in advance

    I have made a table with this structure:
    I am using java to print out all the results by calling a procedure.
    However, I am not able to get Results.view working in case of object-relation table. This is how I do it in the situation of relational table.
    How do I print out the results correctly in my case of situation?
    There are several things wrong with your code and methodology
    1. The code you posted won't even compile because there are several syntax issues.
    2. You are trying to use/test Java in the database BEFORE you get the code working outside the DB
    3. Your code is not using collections in JDBC properly
    I suggest that you use a different, proven approach to developing Java code for use in the DB
    1. Use SIMPLE examples and then build on them. In this case that means don't add collections to the example until ALL other aspects of the app work properly.
    2. Create and test the Java code OUTSIDE of the database. It is MUCH easier to work outside the database and there are many more tools to help you (e.g. NetBeans, debuggers, DBMS_OUTPUT windows, etc). Trying to debug Java code after you have already loaded it into the DB is too difficult. I'm not aware of anyone, even at the expert level, that develops that way.
    3. When using complex functionality like collections first read the Oracle documentation (JDBC Developer Guide and Java Developer's Guide). Those docs have examples that are known to work.
    http://docs.oracle.com/cd/B28359_01/java.111/b31225/chfive.htm
    http://docs.oracle.com/cd/E11882_01/java.112/e16548/oraarr.htm#sthref583
    The main issue with your example is #3 above; you are not using collections properly:
    String value = rset.getString(i);
    A collection is NOT a string so why would you expect that to work for a nested table?
    A collection needs to be treated like a collection. You can even treat the collection as a separate result set. Create your code outside the database and use the debugger in NetBeans (or other) on this replacement code for your 'printResults' method:
    static void printResults (ResultSet rset) throws SQLException {
        try {
           ResultSetMetaData meta = rset.getMetaData();
           while (rset.next()) {
               ResultSet rs = rset.getArray(2).getResultSet();
               rs.next();
               String ndx = rs.getString(1);
               Struct struct = (Struct) rs.getObject(2);
               System.out.println(struct.getSQLTypeName());
               Object [] oa = struct.getAttributes();
               for (int j = 0; j < oa.length; j++) {
                  System.out.println(oa[j]);
        } catch  (SQLException e) {
           System.err.println(e.getMessage());
    That code ONLY deals with column 2 which is the nested table. It gets that collection as a new resultset ('rs'). Then it gets the contents of that nested table as an array of objects and prints out the attributes of those objects so you can see them.
    Step through the above code in a debugger so you can SEE what is happening. NetBeans also lets you enter expressions such as 'rs' in an evaluation window so you can dynamically try the different methods to see what they do for you.
    Until you get you code working outside the database don't even bother trying to load it into the DB and create a Java stored procedure.
    Since your current issue has nothing to do with this forum I suggest that you mark this thread ANSWERED and repost it in the JDBC forum if you need further help with this issue.
    https://forums.oracle.com/community/developer/english/java/database_connectivity
    When you repost you can include a link to this current thread if you want. Once your Java code is actually working then try the Java Stored procedure examples in the Java Developer's Guide doc linked above.
    At the point you have any issues that relate to Java stored procedures then you should post them in the SQL and PL/SQL forum
    https://forums.oracle.com/community/developer/english/oracle_database/sql_and_pl_sql

  • DataTime type shows as Timestamp(6) in BAM Database Table

    Hi,
    I am new in BAM,
    Am facing an issue with BAM Data Object. I have two DateTime fields in DataObject. But when I look in BAM database Table,the field data type is stored as TIMESTAMP(6).
    I want both the elements in DateTime format. Is there any reason why BAM stores DateTime field as TIMESTAMP(6) in Database. If this is the case how can i change the datatype back to datetime in BAM.
    Please help.
    Thanks.

    Thanks All,
    Got my answer.
    I would like to ask one more question, If i create new Data Object from BAM architect, Added fields. Now if i want to add more fields or have to change any data Type of existing field.
    Is there any restart required for BAM server after making the changes.
    Thanks.

Maybe you are looking for

  • Best way to add new dual band Extreme to existing b/g network

    I've been using a Snow Extreme and b/g Express, but have recently been having dropped/slow connection issues. I think this may be at least partially caused from the many other networks and other wireless devices in the neighborhood - I can see 30 or

  • Single queue: concurrent processing of messages in multiple consumers

    Hi, I am new to jms . The goal is to  process messages concurrently from a queue in an asynchronous listener's onMessage method  by attaching a listener instance to multiple consumer's with each consumer using its own session and running in a separat

  • Increasing canvas size and re-clipping (intentionally)

    Hi, So I bolluxed up a little bit while creating my first full-bleed print piece. I used Ps to edit the image, Ai to add some stuff, and ignored Id completely for the printer. Now I have a perfect 8.5 x 11 image that I want to print all the way to th

  • Smartforms Dump

    Hello experts, I copied a smartforms and adapted to new needs. The original report print one or more pages normally, but my smartform doesn't. The problem is in a Main window. In this main has a main table, this main table has only header and footer.

  • Write Back in OBI 11.1.1.6

    Hi, whats the directory to put the xml template in 11.1.6? customMessages dir does not exists. Thanks for any info Edited by: Robo [Maind] on Jun 15, 2012 12:58 PM