Dynamic sql is throwing dump after upgrade to EHP 7.0

Hi All,
My customer recently upgraded to EHP 7.0.
I have one query like below :
select * from (ls_table_list-tabname) into
                         table <table>
                         where (condition).
where ls_table-tabname is the table name, <table> is with the structure of same table and condition is very simple where condition. (id = 'XXXXX').
We are getting dump with "CX_SY_DYNAMIC_OSQL_SYNTAX" and the dump message is "
When parsing a dynamic statement, an error occurred.
Before upgrade same statements were working fine.
Please send us the response asap. Its urgent.
Thanks in advance,
Sreedhar

Hi Divyanshu,
Following is the text of Short dump :
Category ABAP Programming Error
Runtime error SAPSQL_PARSE_ERROR
Exception CX_SY_DYNAMIC_OSQL_SYNTAX
ABAP program / GETPF / SAPLTABLE_CONTENT_CHECK
Application component not assigned
Date and Time 07.02.2014 14:57:48
Short text
When parsing a dynamic statement, an error occurred.
What happened?
Error in ABAP application program.
The current ABAP program "/ GETPF / SAPLTABLE_CONTENT_CHECK" had to be canceled
be as it appears on
an instruction is encountered, which unfortunately can not be executed.
Error Analysis
There is an exception has occurred, which is discussed further below.
The exception, which is assigned to the class 'CX_SY_DYNAMIC_OSQL_SYNTAX'
was in the procedure "/ GETPF / TABLE_CONTENT_CHECK" "(FUNCTION)" neither
intercepted,
still propagated by a RAISING clause.
Since the caller of the procedure is not with the occurrence of the exception
could be expected, the running program was terminated.
Error was at below statement :
      SELECT * FROM (ls_table_list-tabname) INTO
TABLE <table>
WHERE (condition).

Similar Messages

  • SQL query is slow after upgrading from SQL 2008 to SQL 2008 R2

    Hello
    We were using SQL 2008 Standard, but after upgrading to R2, following query is much slower (takes 5 seconds instead of less than 1 second), how is this possible?
    Regards, Hennie
    SELECT
     P.BSN,
     P.Persnr,
     P.Roepnaam,
     P.Tussenvoegsels,
     P.Achternaam,
     P.Geslacht,
     COALESCE (P.Achternaam + ', ' + P.Roepnaam + ' ' + P.Tussenvoegsels, P.Achternaam + ', ' + P.Roepnaam, P.Achternaam) AS naamvolledig,
     P.Telmobiel,
     P.Telvast,
     P.Postcode,
     G.groep,
     COALESCE (RM.nieuweDag, GR.Dag) AS dag,
     COALESCE (RM.nieuweDatum, GR.datum) AS datum,
     DATEPART(ww, COALESCE (RM.nieuweDatum, GR.datum)) AS weeknummer,
     DATEPART(yyyy, COALESCE (RM.nieuweDatum, GR.datum)) AS jaar,
     CONVERT(VARCHAR(8),
      CASE WHEN GR.ID_lokaties = 3 THEN COALESCE (RM.nieuweBegintijd,
       CASE WHEN GR.Tijdspan = 2 THEN R.begintijd2 ELSE R.begintijd END)
      ELSE COALESCE (RM.nieuweBegintijd, GR.begintijd) END, 108) AS begintijdberekend,
     CONVERT(VARCHAR(8),
      CASE WHEN GR.ID_lokaties = 3 THEN COALESCE (RM.nieuweEindtijd,
       CASE WHEN GR.Tijdspan = 2 THEN R.eindtijd2 ELSE R.eindtijd END)
      ELSE COALESCE (RM.nieuweEindtijd, GR.eindtijd) END, 108) AS eindtijdberekend,
     CASE WHEN GR.ID_lokaties = 3 THEN
       CONVERT(NCHAR(5), COALESCE (RM.nieuweBegintijd,CASE WHEN GR.Tijdspan = 2 THEN R.begintijd2 ELSE R.begintijd END), 108) + '-' +
       CONVERT(NCHAR(5), COALESCE (RM.nieuweEindtijd, CASE WHEN GR.Tijdspan = 2 THEN R.eindtijd2 ELSE R.eindtijd END), 108)
      ELSE CONVERT(NCHAR(5),COALESCE (RM.nieuweBegintijd, GR.begintijd), 108) + '-' + CONVERT(NCHAR(5), COALESCE (RM.nieuweEindtijd, GR.eindtijd), 108)
      END AS Tijdspanne,
     CASE
      WHEN GR.ID_lokaties = 3 AND R.id_relaties = 9 THEN 'Werk Intern'
      WHEN GR.ID_lokaties = 3 THEN R.relatienaam
      ELSE L.lokatie END AS Lokatieberekend,
     R.relatienaam AS relatie,
     L.IntExt,
     RA.Omschrijving AS roosteractiviteit,
     A.instroomdatum,
     A.uitstroomdatum,
     TT.trajecttype,
     W.Naamvolledig AS Werkcoach,
     A.ID_groepen,
     T.ID_personen,
     A.ID_werkcoaches,
     CASE
      WHEN GR.ID_lokaties = 3 AND R.id_relaties = 9 THEN 20
      WHEN GR.ID_lokaties = 3 THEN R.id_relaties
      ELSE L.ID_relaties END AS ID_lokatieberekend,
     A.ID_relaties AS ID_relatie,
     R.nummer2 AS capaciteit,
     GR.ID_groepsroosters,
     CAST(CASE WHEN foto IS NOT NULL THEN 'Ja' ELSE NULL END AS char(2)) AS Foto,
     W.Email,
     W.TelefoonMobiel,
     W.TelefoonVast
    FROM
     dbo.personen AS P INNER JOIN
     dbo.trajecten AS T ON T.ID_personen = P.ID_personen INNER JOIN
     dbo.trajecttype AS TT ON T.ID_trajecttype = TT.ID_trajecttype INNER JOIN
     dbo.trajectactiviteiten AS A ON A.ID_trajecten = T.ID_trajecten INNER JOIN
     dbo.groepsroosters AS GR ON GR.ID_groepen = A.ID_groepen LEFT OUTER JOIN
     dbo.roosteractiviteit AS RA ON GR.ID_roosteractiviteit = RA.ID_roosteractiviteit INNER JOIN
     dbo.lokaties AS L ON GR.ID_lokaties = L.ID_lokaties INNER JOIN
     dbo.werkcoaches AS W ON A.ID_werkcoaches = W.ID_werkcoaches INNER JOIN
     dbo.groepen AS G ON A.ID_groepen = G.ID_groepen LEFT OUTER JOIN
     dbo.relaties AS R ON A.ID_relaties = R.ID_relaties LEFT OUTER JOIN
     dbo.roostermutaties AS RM ON P.ID_personen = RM.ID_personen AND GR.ID_groepsroosters = RM.ID_groepsroosters AND RM.aanwezig IS NULL
    WHERE
     (COALESCE (RM.nieuweDatum, GR.datum) BETWEEN GETDATE() - 1 AND GETDATE() + 13)
     AND (COALESCE (DATEDIFF(day, COALESCE (RM.nieuweDatum, GR.datum), A.uitstroomdatum), 0) >= 0)
     AND (DATEDIFF(day, A.instroomdatum, COALESCE (RM.nieuweDatum, GR.datum)) >= 0)
     AND ((SELECT COUNT(*) AS Expr1
      FROM dbo.roostermutaties AS RM2
      WHERE (P.ID_personen = ID_personen)
      AND (GR.ID_groepsroosters = ID_groepsroosters)
      AND (CONVERT(VARCHAR(8), begintijdafwezig, 108) = CONVERT(VARCHAR(8),
      CASE WHEN GR.ID_lokaties = 3 THEN COALESCE (RM.nieuweBegintijd,
      CASE WHEN GR.Tijdspan = 2 THEN R.begintijd2 ELSE R.begintijd END)
      ELSE COALESCE (RM.nieuweBegintijd, GR.begintijd) END, 108)) AND
      (CONVERT(VARCHAR(8), eindtijdafwezig, 108) = CONVERT(VARCHAR(8), CASE WHEN GR.ID_lokaties = 3 THEN COALESCE (RM.nieuweEindtijd,
      CASE WHEN GR.Tijdspan = 2 THEN R.eindtijd2 ELSE R.eindtijd END) ELSE COALESCE (RM.nieuweEindtijd, GR.eindtijd) END, 108))) = 0)

    We were using SQL 2008 Standard, but after upgrading to R2, following query is much slower (takes 5 seconds instead of less than 1 second), how is this possible?
    It is not uncommon to experience performance problems following an upgrade when there are issues with original query.  Non-sargable expressions like Olaf called out are often the culprit, as well as lack of useful indexes and statistics. 
    The optimizer cannot glean accurate row count estimates or use indexes efficiently so the resultant plan may not be optimal for the task at hand.  It is only by happenstance that old plan performed better; it could just as well be the other way around,
    but again only by chance since the optimizer is guessing.
    You might also try using EXISTS instead of SELECT COUNT(*)...= 0:
    AND EXISTS(SELECT *
    FROM dbo.roostermutaties AS RM2
    WHERE P.ID_personen = ID_personen
    AND GR.ID_groepsroosters = ID_groepsroosters
    AND CONVERT(VARCHAR(8), begintijdafwezig, 108) = CONVERT(VARCHAR(8),
    CASE WHEN GR.ID_lokaties = 3 THEN COALESCE (RM.nieuweBegintijd,
    CASE WHEN GR.Tijdspan = 2 THEN R.begintijd2 ELSE R.begintijd END)
    ELSE COALESCE (RM.nieuweBegintijd, GR.begintijd) END, 108)
    AND CONVERT(VARCHAR(8), eindtijdafwezig, 108) = CONVERT(VARCHAR(8), CASE WHEN GR.ID_lokaties = 3 THEN COALESCE (RM.nieuweEindtijd,
    CASE WHEN GR.Tijdspan = 2 THEN R.eindtijd2 ELSE R.eindtijd END) ELSE COALESCE (RM.nieuweEindtijd, GR.eindtijd) END, 108))
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Dynamic SQl results in DUMP

    Does someone see what is wrong in my dynamic SQL statement is reuslts in a dump!
    DUMP and CODE below!
    Runtime error          SAPSQL_WHERE_MISSING_VALUE                                                  
    Except.                CX_SY_DYNAMIC_OSQL_SYNTAX                                                   
    Datum en tijd          19.02.2009 13:30:13                                                                               
    Korte tekst                                                                               
    A comparison value is missing in a condition specified dynamically.                                                                               
    Wat is er gebeurd?                                                                               
    Error in the ABAP Application Program                                                                               
    The current ABAP program "!PR_RVVEEN_USED_FIELDS" had to be terminated because                
          it has                                                                               
    come across a statement that unfortunately cannot be executed.                                                                               
    Foutenanalyse                                                                               
    An exception occurred that is explained in detail below.                                      
         The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SYNTAX', was not                
          caught and                                                                               
    therefore caused a runtime error.                                                             
         The reason for the exception is:                                                              
         The current ABAP program has tried to execute an Open SQL statement                           
         in which a condition was (partially) specified dynamically. In the                            
         part specified at runtime, the program expects to find a literal as                           
         the comparison value.                                                                               
    ===============================================
    itable = 'pa0001'
      CALL FUNCTION 'DD_NAMETAB_TO_DDFIELDS'
        EXPORTING
          tabname  = iname
        TABLES
          ddfields = ddfields.
      LOOP AT ddfields.
    data: where_tab(30) occurs 1 with header line,
    where_clause(30) type c.
    concatenate ddfields-fieldname '<> " "' into where_clause SEPARATED BY space.
    append where_clause to where_tab.
    select pernr from (itable) into table lt_pernr where (where_tab).
      if sy-subrc = 0.
        write 'FIELD COTAINS A VALUE'.
      endif.
      ENDLOOP.

    I'm also missing a dot ('.') at the end of the line. Command should always end with a point.
    For numeric characters you can use '0000' (depending on number of characters).
    BTW. you are creating the dynamic where clause within the loop, without clearing (initializing ) anything. This will lead to the next problem.
    Edited by: Micky Oestreich on Feb 19, 2009 2:13 PM

  • BCS Short Dumps after Upgrade (3.5 to BI7)

    Hi SDN,
    We have recently upgraded our dev system from BW3.5 to BW 7 (SEM BW 6) and following the upgrade none of the queries based on the BCS virtual info provider(Remote Cube) ZVBCS01 are working or the listcube transaction on cube ZVBCS01 in RSA1.
    Both the queries and listcube short dump with DATREF_NOT_ASSIGNED (Details  "DATREF_NOT_ASSIGNED" "SAPLUCR0"  "LUCR0U08" "PROVIDE_SEM_DATA_TABLE_3")
    We have raised a call with SAP OSS they recommended to activate the InfoObject 0BCS_REPMOD from business content and regenerate the data basis. We did all this but still experience the short dumps. (We havenu2019t assigned 0BCS_REPMOD to any Infoproviders or the data basis)
    We will be unable to upgrade to BI7 unless we can resolve this issue so any help would be appreciated.
    Kind regards,
    Jamie Flaxman

    Thanks for the responses, we have managed to get BCS working now following the upgrade.
    Following the activation of the business content, I had to regen the Data Basis but the way I did it originally wasnu2019t enough to force a regeneration. So I had to make a small change to the data basis (move of field names and back again) which was enough to do the re-gen.
    We have experienced quite a few issues with the upgrade from SEM 4 to 6.
    Thanks for the help.
    Jamie Flaxman

  • Unable to connect to sql server 2008 r2 after upgrading from framework 4.0 to 4.5.2 in windows 7 environment

    Hi  All,
    BackGround
    I used to connect to database with Encrypt set true  in sql connection which helps  established encrypted data base connection . I verified  that created certificate in order
    to provide Encrypted connection to database for client is valid.
    Issue :Issue
    is un-able to connect to sql sever2008 r2 from vs2013 by enforcing encryption to true.
    while trying to test the connection from vs2013 error log getting recorded as well as error notification is getting populated as below .
    Step1 :
    from Vs2013 trying to connect to sql server 2008 r2
    step 2: on Click test Connection . getting below mentioned error notification
    Event Viewer Log:<o:p></o:p>
     <o:p></o:p>
    (Process Id: 7472)
    <o:p></o:p>
    .Net SqlClient Data Provider:<o:p></o:p>
    A connection was successfully established with the server, but then an error
    occurred during the login process. (provider: SSL Provider, error: 0 - The
    target principal name is incorrect.)<o:p></o:p>
       at
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception,
    Boolean breakConnection, Action`1 wrapCloseInAction)<o:p></o:p>
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)<o:p></o:p>
       at
    System.Data.SqlClient.TdsParserStateObject.SNIWritePacket(SNIHandle handle,
    SNIPacket packet, UInt32& sniError, Boolean canAccumulate, Boolean
    callerHasConnectionLock)<o:p></o:p>
       at System.Data.SqlClient.TdsParserStateObject.WriteSni(Boolean
    canAccumulate)<o:p></o:p>
       at System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte
    flushMode, Boolean canAccumulate)<o:p></o:p>
       at System.Data.SqlClient.TdsParser.TdsLogin(SqlLogin rec,
    FeatureExtension requestedFeatures, SessionData recoverySessionData)<o:p></o:p>
       at
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
    serverInfo, String newPassword, SecureString newSecurePassword, Boolean
    ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)<o:p></o:p>
       at
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo
    serverInfo, String newPassword, SecureString newSecurePassword, Boolean
    redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential
    credential, TimeoutTimer timeout)<o:p></o:p>
       at
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer
    timeout, SqlConnectionString connectionOptions, SqlCredential credential,
    String newPassword, SecureString newSecurePassword, Boolean
    redirectedUserInstance)<o:p></o:p>
       at
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    identity, SqlConnectionString connectionOptions, SqlCredential credential,
    Object providerInfo, String newPassword, SecureString newSecurePassword,
    Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions,
    SessionData reconnectSessionData)<o:p></o:p>
       at
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo,
    DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions
    userOptions)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool
    pool, DbConnection owningObject, DbConnectionOptions options,
    DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    owningObject, DbConnectionOptions userOptions, DbConnectionInternal
    oldConnection)<o:p></o:p>
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    owningObject, DbConnectionOptions userOptions, DbConnectionInternal
    oldConnection)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
    owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate,
    Boolean onlyOneCheckConnection, DbConnectionOptions userOptions,
    DbConnectionInternal& connection)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
    owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions,
    DbConnectionInternal& connection)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection
    owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions
    userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&
    connection)<o:p></o:p>
       at
    System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection
    outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1
    retry, DbConnectionOptions userOptions)<o:p></o:p>
       at
    System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)<o:p></o:p>
       at
    System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)<o:p></o:p>
       at System.Data.SqlClient.SqlConnection.Open()<o:p></o:p>
    Inner Exception:<o:p></o:p>
    :<o:p></o:p>
    The target principal name is incorrect

    The target principal name is incorrect
    Hi Rahul.U,
    Are you able to connect to SQL Server successfully from SQL Server Management Studio (SSMS) when enforcing encryption?
    According to above error message, it could be caused by the inappropriate server name or incorrect TrustServerCertificate configuration in the connection string from Visual Studio. There are some proposals for you troubleshooting this error.
    1. Make sure that you connect to the SQL server using the fully qualified domain name (FQDN).
    2. When connecting to a SQL Server instance with a valid certificate, please add the
    TrustServerCertificate
    parameter and set it to true in the connection string. For more details, please review this
    article.
    However, if you can successfully connect to SQL Server via SSMS, but still fail to connect to SQL Server from Visual Studio, I would like to recommend you post the question in the .Net Framework forum at
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=netdevelopment . It is appropriate and more experts will assist you.
    There are similar articles about error “The target principal name is incorrect” for your reference.
    http://serverfault.com/questions/458935/aws-rds-sql-server-ssl-connection-the-target-principal-name-is-incorrect
    http://www.derekseaman.com/2013/09/sql-2012-failover-cluster-pt-12-kerberos-n.html
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • OptimisticLockException in method after upgrade to EhP 1

    Hello!
    Using the NWDS 7.1 SP 5 I have developed a web service operation which updates a changed business object.
         @com.sap.caf.dt.CAFOperation(name = "savePurchaseRequisition")
         @javax.jws.WebMethod(exclude=false, operationName="savePurchaseRequisition")
         @javax.jws.WebResult(name="purchaseRequisitionId")
         public java.lang.String savePurchaseRequisition(
                   @javax.jws.WebParam(name="purchaseRequisition")
                   com.esprit.purchase_requisition.model.types.PurchaseRequisition purchaseRequisition)
                   throws com.sap.caf.rt.exception.CAFServiceException {
              LOGGER.entering("savePurchaseRequisition(com.esprit.purchase_requisition.model.types.PurchaseRequisition)");
              if(purchaseRequisition.getPurchaseRequisitionId() == null || "".equals(purchaseRequisition.getPurchaseRequisitionId())) {
                   PurchaseRequisition newPurchaseRequisition = this.getPurchaseRequisitionService().create(generateNewPurchaseRequisitonId());
                   purchaseRequisition.setKey(newPurchaseRequisition.getKey());
                   purchaseRequisition.setPurchaseRequisitionId(newPurchaseRequisition.getPurchaseRequisitionId());
                   purchaseRequisition.setCreatedAt(newPurchaseRequisition.getCreatedAt());
                   purchaseRequisition.setCreatedBy(newPurchaseRequisition.getCreatedBy());
                   purchaseRequisition.setModifiedAt(newPurchaseRequisition.getModifiedAt());
                   purchaseRequisition.setModifiedBy(newPurchaseRequisition.getModifiedBy());
              this.getPurchaseRequisitionService().update(purchaseRequisition);
              LOGGER.exiting("savePurchaseRequisition(com.esprit.purchase_requisition.model.types.PurchaseRequisition)");
              return purchaseRequisition.getPurchaseRequisitionId();
    This operation is very simple and worked fine.
    However, after updating our CE and my NWDS to EhP1, this operation results in the following exception:
    com.sap.caf.rt.exception.CAFOptimisticLockException: Optimistic lock failed for esprit.com/http://www.sap.com/caf/esprit.com:purchase_requisition.model/purchase_requisition.model.modeled.PurchaseRequisition with ID 3bd7beb0-5f2f-11de-9791-00144ff81523!
    Expected 2009-06-22T15:18:54.107+02:00, actual 2009-06-22T00:00:00.000Z
    Does anyone have an idea, what's going wrong here, and how to resolve this issue? Remark: The condition in the if-statement evaluates to false as expected.
    Best regards
    Alexander

    Hello Alexander!
    I has had same problem a some time ago.
    Well, to resolve it i needed when update a data to set exactly the same attributes Key and ModifiedAt of the original data persisted on database.
    I see your code and i´ll modify, only for tests, the logic of persistence, you persist create and to update on same code right?
    But when we create a new data, we use BO.create(), when we update, we don´t have to do this.
    Try this, i´m waiting for your reply.
    Best Regards, Ronaldo Rampelotti

  • Error after upgrading to EHP 4.

    Dear Experts,
    We have installed SAP HR 604 enhancement in our R3,
    after upgadation I am getting the following error in ESS portal,
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: ComponentUsage(FPMConfigurationUsage): Active component must exist when getting interface controller. (Hint: Have you forgotten to create it with createComponent()? Should the lifecycle control of the component usage be "createOnDemand"?
    Kindly Suggets,
    Warm Regards,
    Upendra Agrawal

    Dear Neeta,
    In my case the error was due to the expired SSO ticket.
    For this I referred the threads :
    [Re: RFC_ERROR_LOGON_FAILURE: System received an expired SSO ticket;
    [Re: JCO error- RFC_ERRORLOGON_FAILURE,SSO ticket expired;
    Check report RSPOR_SETUP in T-CODE SE38, it will give you the problem.
    Also,have a look :
    [http://help.sap.com/saphelp_nw04s/helpdata/en/45/18b6cfe1235d79e10000000a11466f/frameset.htm ]
    Warm Regards
    Upendra Agrawal

  • Oracle to MS SQL porting - dynamic sql - cursors

    I have a stored procedure written for oracle which needs to be ported to MS SQL. Used SSMA to do that but the dynamic sql statements are not getting ported and are the same. Below is a dynamic sql from the SP after making changes with SSMA.
    SET @dsql_statement =
    'declare '
    +
    ' p table_name%rowtype;'
    +
    ' c table_name%rowtype;'
    +
    ' TYPE DAT IS REF CURSOR;'
    +
    ' type dtt is table of table_name1%rowtype index by binary_integer;'
    +
    ' d dtt;'
    +
    ' aRC DAT;'
    +
    ' sq varchar2(1000);'
    +
    ' i NUMBER:=0;'
    +
    ' attributeLabel nvarchar2(255);'
    +
    ' attributename nvarchar2(255);'
    +
    ' attributetype nvarchar2(255);'
    +
    ' fkvalue nvarchar2(255);'
    +
    ' defaultfield nvarchar2(80);'
    +
    ' tablename nvarchar2(80);'
    +
    ' primarykeyfield nvarchar2(80);'
    +
    ' begin '
    +
    ' sq:=''SELECT * FROM mdbadmin.table_name WHERE lower(COLUMN1) IN'
    +
    ' (''''update'''',''''insert'''') AND COLUMN2 >= '
    +
    ISNULL(CAST(@COLUMN2 AS nvarchar(max)), '')
    +
    +
    ' ORDER BY COLUMN3,COLUMN2 ASC'';'
    +
    ' open aRC for sq;'
    +
    ' fetch aRC into c;'
    +
    ' loop '
    +
    ' fetch aRC into p;'
    +
    ' exit when aRC%NOTFOUND;'

    Some thing like
    dsql_statement :=  'begin '
    || ' for I in (SELECT * FROM mdbadmin.table_name WHERE lower(COLUMN1) IN '
    || ' (''update'',''insert'') AND COLUMN2 >= '
    || 'NVL(to_char('||'@COLUMN2'||'), '''') '
    || ' ORDER BY COLUMN3,COLUMN2 ASC ) '
    || 'loop '
    || 'end loop; '
    || 'end; '
    you can use for loop instead

  • Access Sequence JEXC missing after upgrade to EHP7

    Dear Experts,
    we are facing an error while saving excise invoice through transaction J1IIN in development system after upgrade to EHP 7, Access sequence JEXC missing  ( ) Message no. VE306, could you please suggest to find out solution.
    Regards,
    Amit Anasane

    Dear All,
    Thanks for helping with your valuable suggestions, finally i got solution of it,
    The root cause of this problem was the change in the table T682I by theEHP7 upgrade.The fields KOTABNR has been changed from NUMC(3) to CHAR(3).With NUMC type the wrong statement works anyway.With CHAR type it retrieves no records. thus creating this error message, so it was a pure ABAP programming error. i am closing this discussion once again thanks to all.
    Regards,
    Amit Anasane

  • SSIS packages are failing after upgrade to SQL server 2014

    Hi,
    I have some SSIS packages running on SQL server 2012 .
    After I upgraded to SQL server to 2014 from 2012 , the SSIS jobs are failing on the SQL agent.
    And i can see its related to Data source connectivity to the SQL agent. I hope it not able to identify the connection manager in SQL agent. And connection adapter is not upgraded.
    I read some articles about this and they say it not able to connect to SQL server agent job.
    And, I can see that the package is running if i run manually using SQL 2012 run time.
    Why its not running on SQL 2014 ?
    did i  miss anything while upgrading SQL server 2014 ?
    Please give me some suggestions to solve this issue. 
    And is there any way i can change the SQL server agent 2014 to adapt this and run ?
    Below is the error : 
    The Package filed to load due to error 0XC00100014 " One or more error occurres. There should be more specific errors preceding this one that expalins the details of the erroes. This message is used as a return value from functions that encounter
    errors.: This occures when CPackage::LoadFormXML fails.
    Regards,
    Vinodh Selvaraj.

    I think you have typed this error message by yourself.
    Anyway, as it says there should be more error preceeding to this. Do you have any other errors which describles the exact issue stating at what task it fails?
    If not, then there are various reasons behind this issue. 3rd party connection manager such as Oracle Attunity or it may be 32/64 bit issue.
    You may try executing package in 32 bit mode from SQL Agent Job.
    Please refer:
    http://blogs.msdn.com/b/farukcelik/archive/2010/06/16/why-package-load-error-0xc0010014-in-cpackage-loadfromxml-error-appears-while-trying-to-run-an-ssis-package.aspx
    http://www.bidn.com/blogs/timmurphy/ssas/1397/package-failed-to-load-due-to-error-0xc0010014
    -Vaibhav Chaudhari

  • Short dump in BP after upgrade to ECC 6.0

    Hi,
    We have upgraded system to ECC 6.0 from ECC 5.0
    After upgrade system is giving short dump in transaction BP, event tried to navigate on BP screen.
    Short dump description:
    A RAISE statement in the program "CL_OS_TRANSACTION=============CP" raised the exception condition  "OS_COMMIT_TOP_FAILED".                                             
    Since the exception was not intercepted by a superior program, processing was terminated.
    Please advise to resolve this issue.
    Regards,
    Dipak

    When exactly does this error appear? On save? clicking on a specific entry?
    I suggest opening an OSS call for this problem, this doesn't seem to known (at least I didn't find any notes)
    Markus

  • After upgrading to v11.1.4 error: The procedure entry point ?video ... could not be located in the dynamic lybrary link webkit.dll.  Please advise

    After upgrading to v11.1.4 I get the error when attempting to open iTunes:
    The procedure entry point ?videoTracks@QTMovie@@QBE?AV?$Vector@V?$Vector@V?$RefPtr@VQTTrack@@@***@@$0A@VC rashOnOverflow@2@@***@XZ could not be located in the dynamic link library C:Program Files (x86)Common FilesAppleApple Application SupportWebKit.dll.
    Please advise.  I uninstalled and re-installed all Apple products numerous times now - so this is not the solution.

    Try the following user tip:
    iTunes for Windows 11.1.4.62: "The procedure entry point: ?videoTracks@QTMovie@ [...] could not be located ..." error messages when launching iTunes

  • Invalid SQL command after upgrading to Oracle 9i

    After upgrading to Oracle 9i, the SQL queries in some of our existing reports are no longer valid.  The Oracle error returned is "old style outer join () can not be used with ANSI joins". It appears that the SQL query generated by Crystal Reports is correct in that it uses "LEFT OUTER JOIN" instead of just naming the tables separated by a comma, but it also includes the "()" qualifer on the matching columns which is no longer allowed.  Is there any way to overcome this error short of rewriting the reports based on a command?

    Hello,
    A couple suggestions come to mind.
    Business Objects tend to take problematic SQL generation very seriously at least on the SQL and Oracle platforms (due to their widespread use) and I would first grab the latest database/engine hotfixes to be certain it hasn't been tracked and corrected already. If you can clearly reproduce this issue (sounds like you can) then it should be easy to convince the support team at BOBJ to track the issue. However...
    Since their hotfix release cycle is rather slow especially for items that have workarounds (even sometimes painful workarounds) you may want to consider using a Stored Procedure instead of a Command.
    Commands have a notorious history of issues/limitations that tend to burn you later - especially when you have to update many reports. A stored procedure would likely render the + qualifier a moot point.
    Cheers, Dylan
    <p><strong>Dylan Lopez - </strong>604.628.4467 </p><p>Previously: Microsoft .NET Resource in Developer Support @ Business Objects</p><p>Currently: Principal @ Inno Software Inc / Independent Contractor Group</p>

  • Reports quit working after upgrade to SQL Server 2008

    Folks,
    I'm running Visual Studio 2008 (sp1) and recently upgraded to SQL Server 2008. Reports worked fine until after upgrade. Now I get the "Login Failed" error message.
    Here is code snippets:
            CrystalDecisions.CrystalReports.Engine.ReportDocument oReport = new   CrystalDecisions.CrystalReports.Engine.ReportDocument();
            TableLogOnInfo LonOnInfo = new TableLogOnInfo();
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
            private Tables crTables;
            private Table crTable;
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
                crConnectionInfo.IntegratedSecurity = true;
                crConnectionInfo.ServerName = Properties.Settings.Default.InstanceName + "
    Instance";
                crConnectionInfo.DatabaseName = "DATABASE";
                crTables = oReport.Database.Tables;
                for (int i = 0; i < crTables.Count; i++)
                    crTable = crTables<i>;
                    crtableLogoninfo = crTable.LogOnInfo;
                    crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                    crTable.ApplyLogOnInfo(crtableLogoninfo);
                oReport.RecordSelectionFormula = xFormula;
                crystalReportViewer1.ReportSource = oReport;
    Has anyone had this problem? Any help would be appreciated.
    Terry

    CR 2008 does not support MS SQL 2008 yet, meaning we have not had time to test it completely and add it to our supported platforms.txt file.
    One thing I noticed is you are using trusted authenication:
    crConnectionInfo.IntegratedSecurity = true;
    Make sure you give access to all users, MS changed the security properties a lot since SQL 2005 and you can't simply log into any database now. If you have a DBA check with that person on how to configure NT Authentication or the Help file. You can also do a quick test and simply use MS SQL Server authentication to confirm if it's a user permission issue.
    Try creating a report that doesn't use Integrated Security, check the box off on your data logon prompt in the Designer.

  • IPad 3 freezes after upgrade to 8.0.  Never ever had a problem with 7, at all.  want to throw the stupid thing out.

    After upgrading from 7 to 8 my iPad 3 will freeze using email, safari, games.  I never ever had a problem before this upgrade.  Have done all the temporary suggestions but nothing is a permanent and will come right back.  I am so sorry that I upgraded, can not go back.  I really want to thank the IOS guys for screwing everything up.  Seems like old times with the Microsoft Tech guys.  I have no problem with my iPhone 6 Plus phone.

    It seems to be caused by roboform 7.5.1. I upgraded to the latest version of robo and it's working now. Sorry mozilla, not your fault.. very frustrated.

Maybe you are looking for