Exception to cursor for no data found

Hello, i want to add exception to the following procedure. i tried its not trapping my no data found error.
here is my procedure:
can someone help me where to add my exception. i am trying to generate a weekly report to a clob field into the database and sends that as an email. when there is no data i wnat capture the no data found error. please help.
CREATE OR REPLACE PROCEDURE test.IWREPORT
AS
--DECLARE
    v_ReturnNumber1  NUMBER := 0;
    v_Text       VARCHAR2(135);
    Display_CLOB     clob;
    TAB constant     varchar2(1):= CHR(9);
    v_space constant varchar2(1):= CHR(13);
    v_heading        varchar2(135);
    err      varchar2(100);
    num      number;
BEGIN
--    DBMS_OUTPUT.ENABLE(100000);
    CLOB_PKG.Rep_Record.Report_Name := 'Weekly Report';
    CLOB_PKG.Rep_Record.Return_Message := 'OK';
    CLOB_PKG.Rep_Record.EMSG_Type := '22';
    CLOB_PKG.Report_Record.Report_Segment := 1;
    Display_CLOB := CLOB_PKG.Open_TempCLOB;
    v_heading := '                   WEEKLY REPORT||v_space;
    v_TextLine := 'UID                     NAME                          TOB                DATE IN';
    CLOB_PKG.Write_To_CLOB( Display_CLOB, V_HEADING||CHR(13)|| v_Text );
    v_Text := '------------------'|| TAB ||'-------------------------'|| TAB || '-----------'|| TAB ||TAB ||'--------------';
    CLOB_PKG.Write_To_CLOB( Display_CLOB,v_Text );
    FOR i_rec IN (select  V.uid, V.pn || ','||V.pgn as name,  C.ACode as TOB, TO_char(V.date_in,'mm/dd/yyyy') AS date_in
                    FROM test V, cost  C
                    WHERE V.uid like '%TES%'
                    and V.date_in >= trunc(SYSDATE,'IW') -8
                    and V.date_in < trunc(SYSDATE,'IW') -1
                    and V.TOB = C.aCode
                    ORDER BY 4,1,2,3)
    LOOP
        v_Text := i_rec.UID || TAB || i_rec.name|| TAB || TAB ||TAB ||i_rec.TOB|| TAB || TAB ||TAB                          ||I_REC.DATE_IN;
     CLOB_PKG.Write_To_CLOB( Display_CLOB, v_Text );
    END LOOP;
    clob_PKG.Write_To_CLOB( Display_CLOB, ' ' );
    clob_PKG.Report_Record.Report_TimeStamp := localtimestamp;
    dbms_output.put_line( 'REPORT_TIMESTAMP: ' || Report_CLOB_PKG.Report_Record.Report_TimeStamp );
     CLOB_PKG.Save_CLOB( Display_CLOB );
     CLOB_PKG.SMTP_CLOB( Report_Name => 'Weekly');
END;
/Thanks a lot...
Edited by: BluShadow on 18-Apr-2011 15:30
added {noformat}{noformat} tags. Please read the [url=SQL and PL/SQL FAQ and PL/SQL FAQ[/url] for details on posting on the forums                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

789287 wrote:
Yes, someoneelse. i read all the posts and try to implement the counter which is not working. that s why i posted again where exactly this counter should be... since i am writing to clob etc...Something like this should do it...
CREATE OR REPLACE PROCEDURE test.IWREPORT AS
  v_ReturnNumber1  NUMBER := 0;
  v_Text           VARCHAR2(135);
  Display_CLOB     clob;
  TAB constant     varchar2(1):= CHR(9);
  v_space constant varchar2(1):= CHR(13);
  v_heading        varchar2(135);
  err                 varchar2(100);
  num                 number;
  v_cnt            number := 0;
BEGIN
  CLOB_PKG.Rep_Record.Report_Name := 'Weekly Report';
  CLOB_PKG.Rep_Record.Return_Message := 'OK';
  CLOB_PKG.Rep_Record.EMSG_Type := '22';
  CLOB_PKG.Report_Record.Report_Segment := 1;
  Display_CLOB := CLOB_PKG.Open_TempCLOB;
  v_heading := '                   WEEKLY REPORT||v_space;
  v_TextLine := 'UID                     NAME                          TOB                DATE IN';
  CLOB_PKG.Write_To_CLOB( Display_CLOB, V_HEADING||CHR(13)|| v_Text );
  v_Text := '------------------'|| TAB ||'-------------------------'|| TAB || '-----------'|| TAB ||TAB ||'--------------';
  CLOB_PKG.Write_To_CLOB( Display_CLOB,v_Text );
  FOR i_rec IN (select V.uid, V.pn || ','||V.pgn as name,  C.ACode as TOB, TO_char(V.date_in,'mm/dd/yyyy') AS date_in
                FROM   test V, cost  C
                WHERE  V.uid like '%TES%'
                and    V.date_in >= trunc(SYSDATE,'IW') -8
                and    V.date_in < trunc(SYSDATE,'IW') -1
                and    V.TOB = C.aCode
                ORDER BY 4,1,2,3)
  LOOP
    v_Text := i_rec.UID || TAB || i_rec.name|| TAB || TAB ||TAB ||i_rec.TOB|| TAB || TAB ||TAB                          ||I_REC.DATE_IN;
    CLOB_PKG.Write_To_CLOB( Display_CLOB, v_Text );
    v_cnt := v_cnt + 1;
  END LOOP;
  IF v_cnt = 0 THEN
    RAISE NO_DATA_FOUND;
  END IF;
  clob_PKG.Write_To_CLOB( Display_CLOB, ' ' );
  clob_PKG.Report_Record.Report_TimeStamp := localtimestamp;
  dbms_output.put_line('REPORT_TIMESTAMP: ' || Report_CLOB_PKG.Report_Record.Report_TimeStamp );
  CLOB_PKG.Save_CLOB( Display_CLOB );
  CLOB_PKG.SMTP_CLOB( Report_Name => 'Weekly');
EXCEPTION
  WHEN NO_DATA_FOUND THEN
    -- do whatever needs doing
    RAISE;
END;

Similar Messages

  • Workaround for NO DATA FOUND in stacked bar chart?

    Hello, Ive got a stacked bar chart in the making, when one of the series doesnt have data, the whole chart show the no data found message but not the other series that do have data. Is there a workaround for this? can I catch the exception in the Series Query? Or is there any other workaround someone has tried with success???
    thanks for any help or suggestion!!!

    Ok, figured out a workaround based on my rusted SQL memories (its probably not the most efficient way to go), made a view like this:
    CREATE OR REPLACE FORCE VIEW "VISTA1" ("NOMBRE", "TIPO_LOCAL", "TIPO", "FECHA", "OPCIONAL") AS
    select USUARIO.NOMBRE, USUARIO.TIPO TIPO_LOCAL, CONSUMO.TIPO, CONSUMO.FECHA, CONSUMO.OPCIONAL
    FROM USUARIO
    LEFT JOIN CONSUMO
    ON USUARIO.ID_USUARIO = CONSUMO.USUARIO_ID_USUARIO
    on this view, i made individual selects and UNIONed them for a comeplete table, with null values being zero, just what was needed:
    select null link,
    LOCAL,
    total "CANTIDAD"
    FROM
    select
    count(A.TIPO) TOTAL, 'SIGO SAMBIL' LOCAL
    FROM VISTA1 A
    where A.tipo='3 PACK' AND A.NOMBRE = 'SIGO SAMBIL'
    UNION
    select
    count(A.TIPO) TOTAL, 'A GRANEL' LOCAL
    FROM VISTA1 A
    where A.tipo='3 PACK' AND A.NOMBRE = 'A GRANEL'
    etc.....
    for each series, i then had to change the A.tipo value to whatever the new series should be.
    regards,
    Mariano.

  • Writting exception within cursor for loop

    I have two cursor for loop as
    for rec1 in () loop --loop 1
    for rec2 in () loop --loop2
    <statements>
    end loop;
    end loop
    Now I want to handle exception within my second for loop so that after terminating the loop it will again go to the first loop...
    How to do it ? Please help......

    you may
    BEGIN
       FOR rec1 IN your_select1
       LOOP                                                              --loop 1
          BEGIN
             FOR rec2 IN your_select2
             LOOP                                                         --loop2
                statements;
             END LOOP;
          EXCEPTION
             WHEN OTHERS
             THEN
                log_error;
          END;
       END LOOP;
    END;or ...depending on your exact needs:
    BEGIN
       FOR rec1 IN your_select1
       LOOP                                                              --loop 1
          FOR rec2 IN your_select2
          LOOP
             BEGIN                                                        --loop2
                statements;
             EXCEPTION
                WHEN OTHERS
                THEN
                   log_error;
             END;
          END LOOP;
       END LOOP;
    END;

  • The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. InnerException: Requested registry access is not allowed.

    I have read some of the other posts for people that got this error, but none seem to apply to me.
    My program has been working for weeks.  I made some minor changes, and started getting the error (full details below).
    I did a TFS "undo pending changes" and still getting the same error, even after logging off.  The one odd thing is that I did change my Windows password this week. The connection string is using a SQL user id and password that has no issues.
    I'm an Admin own my own box (running WIn XP SP3).  I even tried "Run as Admin" on Visual Studio.
    I'm doing a Debug-Start, running a Console-Test-Program that calls a WCF service, which on local machine is hosted by "ASP.NET Development Server".
    We have two other developers, one has the same problem, one does not.  In theory, we have all done "get latest" and are running the same code.
    The SQL Connection is related to a trace database; we are using this library http://ukadcdiagnostics.codeplex.com which has worked fine for months.
    When I do "Start Run" in Visual Studio, I get this error:
    {"The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. "}
    with InnerException: {"The type initializer for 'System.Data.SqlClient.SqlConnectionFactory' threw an exception."}
    and it has InnerException: {"Requested registry access is not allowed. "}
    Outmost StackTrace:
       at System.Data.SqlClient.SqlConnection..ctor()
       at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
       at FRB.Diagnostics.Listeners.SqlDataAccessCommand..ctor(String connectionString, String commandText, CommandType commandType)
       at FRB.Diagnostics.Listeners.SqlDataAccessAdapter.CreateCommand()
       at FRB.Diagnostics.Listeners.SqlTraceListener.TraceEventCore(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String message)
       at FRB.Diagnostics.Listeners.CustomTraceListener.FilterTraceEventCore(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String message)
       at FRB.Diagnostics.Listeners.CustomTraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String format, Object[] args)
       at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
       at System.Diagnostics.TraceSource.TraceInformation(String message)
       at FRB.EC.AdminService.AdminService.TestHelloWorldWithTrace(String name)
       at SyncInvokeTestHelloWorldWithTrace(Object , Object[] , Object[] )
       at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
    Second Inner StackTrace:
       at System.Data.SqlClient.SqlConnection..cctor()
    Third Inner StackTrace:
          at System.Data.SqlClient.SqlConnectionFactory..cctor()
    When I do "Run as Admin", I get this error:
    {"Could not load file or assembly 'FRB.EFDataAccess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied. "}
    Server stack trace:
       at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at FRB.EC.AdminService.ConsoleTester.svcRef.IAdminService.GetDispositionStatusTypeList()
       at FRB.EC.AdminService.ConsoleTester.svcRef.AdminServiceClient.GetDispositionStatusTypeList() in C:\SourceEagleConnect\EagleConnect\Dev\WCFServices\FRB.EC.AdminService.ConsoleTester\Service References\svcRef\Reference.cs:line 2459
       at FRB.EC.AdminService.ConsoleTester.ConsoleProgram.GetDispositionStatusTypeList() in C:\SourceEagleConnect\EagleConnect\Dev\WCFServices\FRB.EC.AdminService.ConsoleTester\ConsoleProgram.cs:line 565
       at FRB.EC.AdminService.ConsoleTester.ConsoleProgram.ExecuteNewRelease103QueryMethods() in C:\SourceEagleConnect\EagleConnect\Dev\WCFServices\FRB.EC.AdminService.ConsoleTester\ConsoleProgram.cs:line 189
       at FRB.EC.AdminService.ConsoleTester.ConsoleProgram.Main(String[] args) in C:\SourceEagleConnect\EagleConnect\Dev\WCFServices\FRB.EC.AdminService.ConsoleTester\ConsoleProgram.cs:line 76
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
    I am also posting the web.config/app.config, but I would rather not focus on that since there were absolutely no changes to it between the time it was working and the time it began failing. 
    Client app.config
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <connectionStrings>
      </connectionStrings>
      <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="false"/>
              <serviceAuthorization impersonateCallerForAllOperations="true"/>
            </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
            <behavior name="FRB.AllowImpersonate">
              <clientCredentials>
                <windows allowedImpersonationLevel="Impersonation"/>
              </clientCredentials>
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <bindings>
          <wsHttpBinding>
            <binding name="WSHttpBinding_IAdminService" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
              bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="524288" maxReceivedMessageSize="5565536"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
              <security mode="Message">
                <transport clientCredentialType="Windows" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" />
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
            <client>
                  <endpoint address="http://localhost:3588/AdminService.svc" binding="wsHttpBinding"
                        bindingConfiguration="WSHttpBinding_IAdminService" contract="svcRef.IAdminService"
                        name="WSHttpBinding_IAdminService">
                        <identity>
                              <dns value="localhost" />
                        </identity>
                  </endpoint>
            </client>
        </system.serviceModel>
    </configuration>
    web.config of WCF service:
      <?xml version="1.0"?>
    <configuration>
        <configSections>
        <section name="FRB.Diagnostics" type="FRB.Diagnostics.Configuration.UkadcDiagnosticsSection, FRB.Diagnostics"/>
      </configSections>
        <appSettings>
           <!-- whatever goes here -->
        </appSettings>
        <!-- connection string section -->
      <connectionStrings>
        <add name="log" connectionString="Data Source=myserver;Initial Catalog=ECWCFLOG_SharedDev;User ID=myuser;Password=mypass;MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/>
        <add name="DBConn" connectionString="Data Source=myserver;Initial Catalog=ECData_SharedDev;User ID=myuser;Password=mypass;MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/>
        <add name="EagleConnectEntities" connectionString="metadata=res://*/EagleConnect.csdl|res://*/EagleConnect.ssdl|res://*/EagleConnect.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=myserver;Initial
    Catalog=ECData_SharedDev;User ID=myuser;Password=mypass;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
      </connectionStrings>
        <!-- FRB.Diagnostics logging section -->
        <FRB.Diagnostics>
            <sqlTraceListeners>
                <sqlTraceListener name="sqlTraceListenerSettings"
                            connectionStringName="log"
                            commandText="INSERT INTO LogStore VALUES(@Source, @ActivityId, @ProcessId, @ThreadId, @EventType, @Message, @Timestamp)"
                            commandType="Text">
                    <parameters>
                        <parameter name="@Source" propertyToken="{Source}"/>
                        <parameter name="@ActivityId" propertyToken="{ActivityId}"/>
                        <parameter name="@ProcessId" propertyToken="{ProcessId}"/>
                        <parameter name="@ThreadId" propertyToken="{ThreadId}"/>
                        <parameter name="@EventType" propertyToken="{EventType}" callToString="true"/>
                        <parameter name="@Message" propertyToken="{Message}"/>
                        <parameter name="@Timestamp" propertyToken="{DateTime}"/>
              <!-- <parameter name="@UserId" propertyToken="{WindowsIdentity}"/> -->
            </parameters>
                </sqlTraceListener>
            </sqlTraceListeners>
            <smtpTraceListeners>
                <smtpTraceListener name="smtpTraceListenerSettings"
                             host="vssmtp"
                             port="25"
                             from="[email protected]"
                             to="[email protected]"
                             subject="AdminService Logging Event: {EventType}, {MachineName}"
                             body="{Message}&#xA;=======&#xA;Process={ProcessId},&#xA;Thread={ThreadId},&#xA;ActivityId={ActivityId}"/>
            </smtpTraceListeners>
        </FRB.Diagnostics>
        <!-- System.Diagnostics logging section -->
        <system.diagnostics>
            <sources>
                <source name="FRB.EC.AdminService" switchValue="All">
                    <listeners>
                        <clear/>
                        <add name="ods"/>
                        <add name="smtp"/>
                        <add name="sql"/>
                    </listeners>
                </source>
                <source name="System.ServiceModel" switchValue="Off" propagateActivity="true">
                    <listeners>
                        <add name="ignored" type="System.Diagnostics.ConsoleTraceListener"/>
                    </listeners>
                </source>
            </sources>
            <sharedListeners>
                <!-- OutputDebugStringTraceListener -->
                <add name="ods"
               type="FRB.Diagnostics.Listeners.OutputDebugStringTraceListener, FRB.Diagnostics"
               initializeData="{ActivityId}|{EventType}: {Message} - {DateTime}, Process={ProcessId}, Thread={ThreadId}"/>
                <!-- SqlTraceListener -->
                <add name="sql"
               type="FRB.Diagnostics.Listeners.SqlTraceListener, FRB.Diagnostics"
               initializeData="sqlTraceListenerSettings"
               traceOutputOptions="Timestamp"/>
                <!-- SmtpTraceListener -->
                <add name="smtp"
               type="FRB.Diagnostics.Listeners.SmtpTraceListener, FRB.Diagnostics"
               initializeData="smtpTraceListenerSettings">
                       <filter type="System.Diagnostics.EventTypeFilter"
                       initializeData="Error"/>
                </add>
            </sharedListeners>
            <trace autoflush="true"/>
        </system.diagnostics>
        <system.web>
        <compilation debug="true" targetFramework="4.0">
        </compilation>
            <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider"/>
        </system.web>
        <system.serviceModel>
            <services>
                <service name="FRB.EC.AdminService.AdminService"
                   behaviorConfiguration="FRB.EC.AdminService.AdminServiceBehavior">
                    <!-- Service Endpoints -->
                    <endpoint address="" binding="wsHttpBinding"
                      bindingConfiguration="wsHttpEndpointBinding"
                      contract="FRB.EC.AdminService.IAdminService">
                        <!--
                  Upon deployment, the following identity element should be removed or replaced to reflect the
                  identity under which the deployed service runs. 
                  If removed, WCF will infer an appropriate identity automatically.
              -->
                        <identity>
                            <dns value="localhost"/>
                        </identity>
                    </endpoint>
                    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
                </service>
            </services>
            <bindings>
                <wsHttpBinding>
                    <binding name="wsHttpEndpointBinding"
                     maxBufferPoolSize="2147483647"
                     maxReceivedMessageSize="500000000">
                        <readerQuotas maxDepth="2147483647"
                            maxStringContentLength="2147483647"
                            maxArrayLength="2147483647"
                            maxBytesPerRead="2147483647"
                            maxNameTableCharCount="2147483647"/>
                        <security>
                            <message clientCredentialType="Windows"/>
                        </security>
                    </binding>
                </wsHttpBinding>
            </bindings>
            <behaviors>
                <serviceBehaviors>
                    <behavior name="FRB.EC.AdminService.AdminServiceBehavior">
                        <!-- To avoid disclosing metadata information, set the value below to false and
                   remove the metadata endpoint above before deployment -->
                        <serviceMetadata httpGetEnabled="true"/>
                        <!-- To receive exception details in faults for debugging purposes, set the value below to true. 
                   Set to false before deployment to avoid disclosing exception information -->
                        <serviceDebug includeExceptionDetailInFaults="true"/>
                        <serviceCredentials>
                        </serviceCredentials>
                        <!--<serviceAuthorization principalPermissionMode="UseAspNetRoles"
                    roleProviderName="AspNetWindowsTokenRoleProvider"/>-->
                        <serviceAuthorization principalPermissionMode="UseWindowsGroups"
                                    impersonateCallerForAllOperations="true"/>
                    </behavior>
                    <behavior name="FRB.EC.AdminService.IAdminServiceTransportBehavior">
                        <!-- To avoid disclosing metadata information, set the value below to false and
                   remove the metadata endpoint above before deployment -->
                        <serviceMetadata httpGetEnabled="true"/>
                        <!-- To receive exception details in faults for debugging purposes, set the value below to true. 
                   Set to false before deployment to avoid disclosing exception information -->
                        <serviceDebug includeExceptionDetailInFaults="false"/>
                        <serviceCredentials>
                            <clientCertificate>
                                <authentication certificateValidationMode="PeerTrust"/>
                                <!--<authentication certificateValidationMode="Custom" customCertificateValidatorType="DataFactionServices.FRBX509CertificateValidator"/>-->
                            </clientCertificate>
                            <serviceCertificate findValue="WCfServer"
                                    storeLocation="LocalMachine"
                                    storeName="My" x509FindType="FindBySubjectName"/>
                        </serviceCredentials>
                    </behavior>
                </serviceBehaviors>
            </behaviors>
            <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
        </system.serviceModel>
        <system.webServer>
            <modules runAllManagedModulesForAllRequests="true"/>
        </system.webServer>
    </configuration>
    Thanks for any help.
    Neal

    I think I found it... this is sure a strange error for what is really happening.
    Apparently it had happened to me before, and fortuantely, I actually added the following comment:
                // Above is related to the WCFLOG SQL Diagnostics Trace 
                // If you get error here an inner exception "requested registry access is not allowed"
                // inside exception "type initializer for System.Data.SqlClient.SqlConnection"
                // then make sure you have impersonation enabled in your client.
                // See AdminConsole web.config or FRB.EC.AdminService.ConsoleTester.app.config for examples
    Now I think I will do a try catch and spit out the same text.
    Still testing to assure that this really was the issue.
          <endpointBehaviors>
            <behavior name="FRB.AllowImpersonate ">
              <clientCredentials>
                <windows allowedImpersonationLevel="Impersonation"/>
              </clientCredentials>
            </behavior>
          </endpointBehaviors>
    The line below in BOLD below is what somehow seemed to disappear from my app.config - probably due to a TFS human error - still checking that also:
            <client>
                  <endpoint address="http://localhost:4998/AdminService.svc"
                                  behaviorConfiguration="FRB.AllowImpersonate"
                                  binding="wsHttpBinding"
                                  bindingConfiguration="WSHttpBinding_IAdminService"
                                 contract="svcRef.IAdminService"
                            name="WSHttpBinding_IAdminService">
                        <identity>
                              <dns value="localhost" />
                        </identity>
                  </endpoint>
            </client>
    Here's how I "idiot-proofed" this error for now, to give an error that actually at least points to a solution:
            public SqlDataAccessCommand(string connectionString, string commandText, CommandType commandType)
                try
                    _connection = new SqlConnection(connectionString);
                    // Above is related to the WCFLOG SQL Diagnostics Trace  
                    // If you get error here an inner exception "requested registry access is not allowed"
                    // inside exception "type initializer for System.Data.SqlClient.SqlConnection"
                    // then make sure you have impersonation enabled in your client.
                    // See AdminConsole web.config or FRB.EC.AdminService.ConsoleTester.app.config for examples
                catch (Exception ex)
                    if (ex.ToString().Contains("The type initializer for"))
                    throw new System.ApplicationException(@"
                    Your client app <endpoint> must be cofigured have a
                  'behaviorConfiguration' attribute like this:
                    behaviorConfiguration='FRB.AllowImpersonate'
                   that points back to a behavior that has this syntax:         
              <behavior name='FRB.AllowImpersonate'>
                 <clientCredentials>
                     <windows allowedImpersonationLevel='Impersonation'/>
                 </clientCredentials>
              </behavior>
              ", ex);
                   else
                        throw ex;
                _command = _connection.CreateCommand();
                _command.CommandText = commandText;
                _command.CommandType = commandType;
                // TODO _command.CommandTimeout = ;
    Neal

  • SSRS Database Configuration Manager Error - Could not connect to server: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception

    I'm Getting the "Could not connect to server: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception" Error on an existing Instance of SSRS that had been working previously (lots of installs/patches since).
    Any time I try to hit the "Test Connection" button on existing connections or create new ones from the SSRS Config Mgr., it throws that error.
    I know the SQL Server connectivity works (I have SSMS installed on there and can cut and paste server Login to connect). The problem is I can't really get any more details on the error...Event Viewer isn't logging anything, I have upped the trace level
    to 4 in the reportingservicesservice.config file, I have even watched it with procmon and nothing obvious pops up.
    Let me know if anyone else has been down this path and what they have tried.

    Hi BillOlive,
    Based on my research, the issue may be related to user access permission. You can refer to the following method to troubleshooting the issue:
    Open C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG folder | right click on the machine.config file | Properties | Security | make sure your domain account has FULL CONTROL permission on this file.
    If above steps still do not work, please backup your machine.config file to somewhere else and replace with the attached one from my Windows Server 2008 environment.
    Alternatively, app.config file also may cause the same issue. There is a similar issue, you can refer to it.
    http://stackoverflow.com/questions/6922879/exception-type-initializer-for-system-data-sqlclient-sqlconnection
    Hope this helps.
    Regards,
    Alisa Tang
    If you have any feedback on our support, please click
    here.
    Alisa Tang
    TechNet Community Support

  • Cursor for loop in PlSql

    while i was studying about cursor for loop i found this statement in the web
    "A cursor FOR loop implicitly declares its loop index as a %ROWTYPE record"
    for example an emp table contain following columns empno,ename,sal,hiredate,deptno
    and let us consider an cursor for loop as
    for rec in select empno,sal from emp loop
    if cursor for loop declare loop index as a %rowtype our cursor statement should include all the columns and follow the data type compatabulity.
    But here our cursor statement includes only few columns,if we use %rowtype we have to select all columns but here we are not doing this.
    Can anyone please explain what is happening in cursor for loop?

    for loop cursor is also like the simple explicite cursor..
    the cursor variable will hold only the columns that are given in select statement of the cursor..
    if u declare a cursor as %rowtype, then it should include all the columns of that particular table..
    otherwise u should use only %type for each and every column seperately only...

  • No Data Found Option in BI Publisher Report

    Hi All,
    Could you please help me.
    I am looking for NO DATA FOUND OPTION in BIP Report.
    Ex -
    In the body of the report, I will write simple select statement
    Select * from emp;
    If the table do not contain data the out put should display " NO DATA FOUND IN THE DATA BASE"
    Can some one help me on this....This is a sample query actually my sql query contains 100+ lines.
    Please help me,

    Take a look at these:
    http://winrichman.blogspot.com/2009/05/no-data-found.html
    http://blogs.oracle.com/xmlpublisher/2007/06/no_data_found.html
    Also, search the forum. This has been covered before.
    Thanks,
    BIPuser

  • Open cursor for PLSQL table of records

    Is it possible to open a cursor for all data in a PLSQL table of records?
    something like
    cursor c (p1 number) is select * from <plsqltab>
    where <plsqltab>.col = p1

    There is no such thing as a PL/SQL table. Yes, I know that many calls this structure in PL/SQL a table. And that is exactly where all this confusion stems from.. and trying to treat such a "table" as an Oracle table using SQL.
    The correct terms are dynamic array (indexed by integer) or dynamic associative array (indexed by varchar). And an array is nothing like a table ito RDBMS processing.
    Yes, you can run SQLs against arrays. But it is "expensive". Why? Because the data sits inside PL/SQL Engine. Not in the SQL Engine. The data is in a PL/SQL defined structure. Not a SQL defined structure.
    So.. the data needs to be shipped from the PL/SQL Engine to the SQL Engine and converted into a format that the SQL Engine can understand and use.
    Also, once shipped and converted the SQL structure is not indexed. Which means that the only option is a full table scan of that structure.
    So you need to ask yourself why do you want to use SQL against a PL/SQL array? As soon as you do that, you are saying "Hey, this PL/SQL table ain't good enough and I need to process it using SQL".
    So why then does that data sit inside a PL/SQL array and not in a SQL table?
    Oracle provides you with the ability to create temporary session tables. These can be indexed. SQL can be run against them without all the "expenses" that are associated with running SQL against a PL/SQL array.
    PL/SQL arrays is a great tool. But only when it is the right tool to use. When someone says he/she needs SQL to use this tool, then I question the choice of the tool. Make sure you use the right tool for the job.

  • How to fetch NO DATA FOUND exception in Ref Cursor.

    In my procedure ref cursor is out parameter with returns dataset. in my proceudre
    its like...
    OPEN pPymtCur FOR
    select.....
    when I call this procedure from report to get dataset it causes NO DATA FOUND exception.
    How to fetch this exception in my oracle procedure so I can get some other data.
    Any Idea to do this?
    Edited by: Meghna on 17-Jun-2009 22:28

    Mass25 wrote:
    Correct me if I am wrong.
    So if I do something as follows in my stored proc, I do not have to check for NO_DATA_FOUND?
    OPEN my_CuRSR FOR
          SELECT DISTINCT blah blah blahmy_cursr is what I am returning as OUT param in my SP.Correct. At the point you open the cursor, oracle has not attempted any 'fetch' against the data so it won't know if there is any data or no data. that only occurs when a fetch is attempted.
    Take a read of this:
    [PL/SQL 101 : Understanding Ref Cursors|http://forums.oracle.com/forums/thread.jspa?threadID=886365&tstart=0]

  • No Data Found Exception in bulk updates

    I am trying to catch no data found exception in bulk updates when it does not find a record to update in the forall loop.
    OPEN casualty;
    LOOP
    FETCH casulaty
    BULK COLLECT INTO v_cas,v_adj,v_nbr
    LIMIT 10000;
    FORALL i IN 1..v_cas.count
    UPDATE tpl_casualty
         set casualty_amt = (select amt from tpl_adjustment where cas_adj = v_adj(i))
         where cas_nbr = v_nbr(i);
    EXCEPTION WHEN NO_DATA_FOUND THEN dbms_output.put_line('exception')
    I get this error at the line where i have exception:
    PLS-00103: Encountered the symbol "EXCEPTION" when expecting one of the following:
    begin case declare end exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    Can someone pls direct me on how to get around this?
    If I do not handle this exception, the script fails when it attempts to update a record that does not exist and the error says : no data found exception.
    Thanks for your help.
    Edited by: user8848256 on Nov 13, 2009 6:15 PM

    No Data Found isn't an exception raised when an UPDATE cannot find any records to process.
    SQL%ROWCOUNT can be used to determine the number of rows affected by an update statement, but if 0 rows are updated then no exception will be raised (it's just not how things work).
    If you post your actual CURSOR (casualty) declaration, it's quite possible we can help you create a single SQL statement to meet your requirement (a single SQL will be faster than your current implementation).
    Have you looked in to using the MERGE command?

  • No Data Found: Exception in SQL inside PL/SQL block

    Hi Friends
    I am trying to execute an SQL SELECT stmt inside a PL/SQL block. But when i execute the procedure, it gives me No Data Found Exception.
    I know it is because no row is fetched in the query, but the condition of the SELECT query i have specified is being satisfied, i have checked it by running it on the SQL prompt.
    But somehow, it is not running from inside the PL/SQL procedure.Can anybody help me out on this as to why is this happening?? I am giving my code for reference and have Highlighted the Query inside it:
    CREATE OR REPLACE procedure insert_sfdc_account
    as
    --DECLARE
    CURSOR C1 IS
    SELECT customer_code, name1, name2, name3, name4, phone_number, fax, web_address, industry_sector, customer_profile, customer_type,
    address, city, postal_code, country_key, zzcust_type, vat_code
    FROM load_cust_general
    WHERE account_group = 'ZSIT';
    v_cust_cur c1%ROWTYPE;
    -- type sales_tab is table of load_cust_sales_area%rowtype;
    v_sales_area load_cust_sales_area%ROWTYPE;
    -- v_sales_area sales_tab;
         v_salesorg varchar2(10);
         v_sales_district varchar2(10);
         v_salesoff varchar2(10);
         v_custgrp varchar2(10);
         v_salesgrp varchar2(10);
    v_type varchar2(20);
    v_nature varchar2(10);
    v_partner_code varchar2(10);
    v_parent_cust varchar2(20);
    v_credit_blk varchar2(20);
    BEGIN
    open c1;
    loop
    fetch c1 into v_cust_cur;
    exit when c1%NOTFOUND;
    for i in (SELECT customer_code, salesorg from load_cust_partner
    where customer_code = v_cust_cur.customer_code ) LOOP
    dbms_output.put_line(v_cust_cur.customer_code );
                        SELECT partner_code into v_partner_code from load_cust_partner
    where customer_code = i.customer_code and salesorg = i.salesorg and partner_function = 'Z1';
    dbms_output.put_line(v_partner_code||i.customer_code);
    SELECT salesorg, sales_district, salesoff, salesgrp, custgrp INTO v_salesorg, v_sales_district, v_salesoff, v_salesgrp, v_custgrp FROM load_cust_sales_area
              WHERE customer_code = i.customer_code and salesorg = i.salesorg;
                   dbms_output.put_line(v_salesorg||i.salesorg);
                        SELECT parent_customer INTO v_parent_cust from load_cust_hierarchy
    WHERE customer_code = i.customer_code and salesorg = i.salesorg and hierarchy_type = 'G'; dbms_output.put_line(v_parent_cust);
                        SELECT credit_block INTO v_credit_blk from load_cust_company_cod
              WHERE customer_code = i.customer_code;
    dbms_output.put_line(v_credit_blk);
    for j in (SELECT account_group, customer_type from load_cust_general
    where customer_code IN (select customer_code from load_cust_partner
                                  where partner_code = i.customer_code and salesorg = i.salesorg and partner_function = 'ZS'))
                                                      LOOP
    -- exit when j%NOTFOUND;
         dbms_output.put_line(j.account_group);
    if (j.account_group = 'ZDIS') THEN
    v_type := 'DISAC';
              v_nature := '06';
         --     EXIT ;
    else
    v_type := 'SPACC';
    v_nature := '01';
    END IF;
    dbms_output.put_line(v_type||' '||v_nature);
    END LOOP;
    INSERT INTO sfdc_account
              (SAP_ACCOUNT_ID__C, NAME, TYPE, RECORDTYPEID, PARENTID, PHONE, FAX, WEBSITE, OWNERID, MARKETING_DOMAIN__C,
    INDUSTRIAL_SECTOR__C, ABC_CLASSIFICATION__C, NAME_1__C, NAME_2__C, NAME_3__C, NAME_4__C, PAYMENT_STATUS__C,
    CUSTOMER_GROUP__C, ADDRESS_STREET__C, CITY__C, POSTAL_CODE__C, COUNTRY__C, SALES_OFFICE__C, SALESORG__C,
    SALESDISTRICT__C, SALESGROUP__C, NATURE__C, VATCODE__C)
    VALUES((i.customer_code||i.salesorg), (v_cust_cur.Name1||' '||v_cust_cur.name2), ' ', v_type, v_parent_cust,
    v_cust_cur.phone_number, v_cust_cur.fax, v_cust_cur.web_address, v_partner_code, SUBSTR(v_cust_cur.industry_sector,1,2),
    v_cust_cur.industry_sector, v_cust_cur.customer_profile, v_cust_cur.name1, v_cust_cur.name2, v_cust_cur.name3,
    v_cust_cur.name4, v_credit_blk, v_custgrp, v_cust_cur.address, v_cust_cur.city, v_cust_cur.postal_code,
    v_cust_cur.country_key, v_salesoff, v_salesorg, v_sales_district,
    v_salesgrp, v_nature, v_cust_cur.vat_code);
    end loop;
    end loop;
    CLOSE c1;
    -- Delete data from Load Table
    -- EXECUTE IMMEDIATE 'TRUNCATE TABLE load_cust_general';
    /* truncate table load_cust_partner;
    truncate table load_cust_hierarhy;
    truncate table load_cust_sales_area;
    truncate table load_cust_company_cod;
    commit;
    exception
    when others then
    raise_application_error( -20001, substr( sqlerrm, 1, 150 ) );
    END;
    Kindly Help.....
    Thanks and Regards

    Create the procedure again and execute it in SQL*Plus environment and paste the output:
    CREATE OR REPLACE procedure insert_sfdc_account
    as
    --DECLARE
    CURSOR C1 IS
    SELECT customer_code, name1, name2, name3, name4, phone_number, fax, web_address, industry_sector, customer_profile, customer_type,
    address, city, postal_code, country_key, zzcust_type, vat_code
    FROM load_cust_general
    WHERE account_group = 'ZSIT';
    v_cust_cur c1%ROWTYPE;
    -- type sales_tab is table of load_cust_sales_area%rowtype;
    v_sales_area load_cust_sales_area%ROWTYPE;
    -- v_sales_area sales_tab;
    v_salesorg varchar2(10);
    v_sales_district varchar2(10);
    v_salesoff varchar2(10);
    v_custgrp varchar2(10);
    v_salesgrp varchar2(10);
    v_type varchar2(20);
    v_nature varchar2(10);
    v_partner_code varchar2(10);
    v_parent_cust varchar2(20);
    v_credit_blk varchar2(20);
    BEGIN
    open c1;
    loop
    fetch c1 into v_cust_cur;
    exit when c1%NOTFOUND;
    for i in (SELECT customer_code, salesorg from load_cust_partner
    where customer_code = v_cust_cur.customer_code ) LOOP
    SELECT partner_code into v_partner_code from load_cust_partner
    where customer_code = i.customer_code and salesorg = i.salesorg and partner_function = 'Z1';
    SELECT salesorg, sales_district, salesoff, salesgrp, custgrp INTO v_salesorg, v_sales_district, v_salesoff, v_salesgrp, v_custgrp FROM load_cust_sales_area
    WHERE customer_code = i.customer_code and salesorg = i.salesorg;
    dbms_output.put_line('Customer_Code : '|| i.customer_code);
    dbms_output.put_line('SalesOrg : '|| i.salesorg);
    SELECT parent_customer INTO v_parent_cust from load_cust_hierarchy
    WHERE customer_code = i.customer_code and salesorg = i.salesorg and hierarchy_type = 'G';
    dbms_output.put_line('Successfully Executed SQL st. Error is somewhere else');
    SELECT credit_block INTO v_credit_blk from load_cust_company_cod
    WHERE customer_code = i.customer_code;
    for j in (SELECT account_group, customer_type from load_cust_general
    where customer_code IN (select customer_code from load_cust_partner
    where partner_code = i.customer_code and salesorg = i.salesorg and partner_function = 'ZS'))
    LOOP
    -- exit when j%NOTFOUND;
    if (j.account_group = 'ZDIS') THEN
    v_type := 'DISAC';
    v_nature := '06';
    -- EXIT ;
    else
    v_type := 'SPACC';
    v_nature := '01';
    END IF;
    END LOOP;
    INSERT INTO sfdc_account
    (SAP_ACCOUNT_ID__C, NAME, TYPE, RECORDTYPEID, PARENTID, PHONE, FAX, WEBSITE, OWNERID, MARKETING_DOMAIN__C,
    INDUSTRIAL_SECTOR__C, ABC_CLASSIFICATION__C, NAME_1__C, NAME_2__C, NAME_3__C, NAME_4__C, PAYMENT_STATUS__C,
    CUSTOMER_GROUP__C, ADDRESS_STREET__C, CITY__C, POSTAL_CODE__C, COUNTRY__C, SALES_OFFICE__C, SALESORG__C,
    SALESDISTRICT__C, SALESGROUP__C, NATURE__C, VATCODE__C)
    VALUES((i.customer_code||i.salesorg), (v_cust_cur.Name1||' '||v_cust_cur.name2), ' ', v_type, v_parent_cust,
    v_cust_cur.phone_number, v_cust_cur.fax, v_cust_cur.web_address, v_partner_code, SUBSTR(v_cust_cur.industry_sector,1,2),
    v_cust_cur.industry_sector, v_cust_cur.customer_profile, v_cust_cur.name1, v_cust_cur.name2, v_cust_cur.name3,
    v_cust_cur.name4, v_credit_blk, v_custgrp, v_cust_cur.address, v_cust_cur.city, v_cust_cur.postal_code,
    v_cust_cur.country_key, v_salesoff, v_salesorg, v_sales_district,
    v_salesgrp, v_nature, v_cust_cur.vat_code);
    end loop;
    end loop;
    CLOSE c1;
    -- Delete data from Load Table
    -- EXECUTE IMMEDIATE 'TRUNCATE TABLE load_cust_general';
    /* truncate table load_cust_partner;
    truncate table load_cust_hierarhy;
    truncate table load_cust_sales_area;
    truncate table load_cust_company_cod;
    commit;
    exception
    when others then
    raise_application_error( -20001, substr( sqlerrm, 1, 150 ) );
    END;
    SQL> set serveroutput on
    SQL> exec insert_sfdc_account;

  • Ora-01403 no data found cursor error - Please help.

    DECLARE
    name1 talent.candidate_name%TYPE; -- Declare variables
    name2 long; -- Declare variables
    emp_id talent_id.emplid%TYPE;
    NO_DATA_FOUND EXCEPTION;
    CURSOR c1 IS
    select candidate_name,(''''||trim(upper(candidate_name))||'''') as tst from talent ;
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1 INTO name1, name2;
    EXIT WHEN c1%NOTFOUND; -- TRUE when FETCH finds no more rows
    select distinct emplid
    INTO emp_id
    from names a
    where a.name_type = 'PRI'
    and upper(a.last_name)||', '||upper(a.first_name) = name2;
    INSERT INTO talent_id VALUES (emp_id, name1);
    END LOOP;
    CLOSE c1;
    COMMIT;
    Question: Above queries prompt me error msg ora-01403 no data found for emplid. I try but fail to solve it. Please help me. Thank you
    Edited by: user12051088 on Mar 4, 2010 1:38 AM
    Edited by: user12051088 on Mar 4, 2010 1:40 AM

    Yes, this is very helpful :-)
    My testing to insert table where emplid is null but still having error ora-01403 no data found when i remove on dbms_output.put_line as shown below:
    Anyway, if i dint remove the dbms_output.put_line. It is working to insert emp_id is not null. How do I include record which emp_id is null? Thank you.
    begin
    select distinct emplid
    INTO emp_id
    from gdw_names a
    where a.name_type = 'PRI'
    and upper(a.last_name)||', '||upper(a.first_name) = name1;
    IF emp_id is null THEN
    RAISE no_data_found;
    else
    INSERT INTO gdw_talent_id VALUES (emp_id, name1);
    end if;
    exception
    when no_data_found then
    INSERT INTO gdw_talent_id VALUES (null, name1);
    --when too_many_rows then
    -- dbms_output.put_line('too many rows for ' || name1);
    -- when others then
    -- dbms_output.put_line('Unknown error for ' || name1);
    end;
    Edited by: user12051088 on Mar 4, 2010 9:11 PM

  • Regarding "select into" query and "no data found" exception

    So i have included the following into my procedure:
    select div_cd into c_div_cd
                   from division_tab d, emp_tab y
                   where d.div_name=y.div_text and y.emp_code=d.emp_code;
    and also an exception
    exception
    when no data found
    -- print something
    The above select query results into "no data found" and the control passes directly to the exception and prints something.
    How do I do the following?
    select div_cd into c_div_cd
                   from division_tab d, emp_tab y
                   where d.div_name=y.div_text and y.emp_code=d.emp_code;
    if c_div_cd is null then
    --enter this employee into some other table without raising an exception
    No need to write a code for an answer. Please just guide me with something I can incorporate or do.

    use explicit cursors
    DECLARE
    c_div_cd division_tab.div_cd%type;
    cursor c_div is
    select div_cd
    from division_tab d, emp_tab y
    where d.div_name=y.div_text and y.emp_code=d.emp_code;
    BEGIN
    open c_div;
    fetch c_div into c_div_cd;
    --You can either use c_div%NOTFOUND or c_div_cd is null in the below if condition to check the data
    -- Note if your select query returns multiple records then you have to do mutiple fetches for getting all records, so in that case your FETCH
    -- should be inside the LOOP statement
    if c_div_cd is null then
    --enter this employee into some other table without raising an exception
    end if;
    close c_div;
    EXCEPTION
    IF c_div%ISOPEN then
    close c_div;
    END IF;
    END;
    Regards
    JJ

  • No Data Found Exception

    I'm getting No Data found exception while selecting a query.
    I'm trying to insert into a table by selecting records from a table.
    I'm doing this inside a loop. So I need to continue with insertion even though i get this error( NO DATA FOUND). How can this be done?
    Any help?
    Eg.
    FOR id IN (select Emp_ID from Table A)
    Begin
    LOOP
    BEGIN
    Select COL_B INTO Var_X from Table B where COL_C = id.EMPID;
    EXCEPTION
    NO DATA FOUND ---- I need to go for insertion even though i get this error
    END
    ---- Insertion Goes here to TABLE_C
    ----- Inserting VAR_X into the TABLE_C along with other Columns
    END LOOP
    END
    Thanks
    Harshini

    What you have should work. Are you saying thet the exception handler doesn't catch the exception? If that is the case then it must be another exception. You could change the exceptiuon handler to be a when others (which will catch everything) or you could just decalre a cursor which you open, fetch from, and then close. If no data is found you won't get an exception, but your variables won't be null unless you reset them every time you go round the loop.
    Obviously the no data found exception is actually no_data_found (i.e. with underscores) but your code wouldn't compile if you missed out the underscores so you must have that right.

  • Forms application returns "ORA-01403 no data found" exception on Windows 7

    Hi everyone,
    I am currently involved in an application compatibility project for an O/S migration from Windows XP to Windows 7.
    We have a legacy Oracle Dev6i P18 Forms application that has been working perfectly on Windows XP for the last decade or so. When we installed the same application on Windows 7, it returned a pop-up error message with the text: "ORA-01403 no data found" when performing a certain operation (clicking on a Submit button in a specific form). The same operation works successfully on Windows XP displaying the message "Submit has been successful".
    This error is well documented and the solution involves adding an exception handler to the faulting SQL statement(s) in order to handle the ORA-01403 exception. Unfortunately, the application is composed of compiled forms (.FMX) and we no longer have the source code so I can't implement this solution.
    I ran a file comparison utility (WinDiff from the Windows SDK) and confirmed that all the files in the application folder and the Oracle Dev6i P18 folder are identical on both the Windows XP and Windows 7 systems.
    I enabled tracing in SQLNet.ORA by configuring TRACE_LEVEL_CLIENT=SUPPORT (I know, too verbose) and other related settings on both systems and have uploaded the traces to my SkyDrive for public viewing:
    http://sdrv.ms/10BNYtI
    The traces show that the "ORA-01403" exception occurs many times on both Windows XP and Windows 7 systems as a result of various SQL statements being executed, for instance:
    SELECT TASK_ID,TASK_DETAIL_STATUS,ASSIGNED_DATE FROM TASK_DETAILS WHERE TASK_ID = :b1 AND TASK_DETAIL_STATUS = (SELECT ID FROM V_TASK_STATUS WHERE ABBREVIATION = 'PLANNED' ) FOR UPDATE OF TASK_DETAIL_STATUS,ASSIGNED_DATE
    UPDATE TASK_DETAILS SET ASSIGNED_DATE=NTMS_UTIL.GET_SERVER_DATE,TASK_DETAIL_STATUS=(SELECT ID FROM V_TASK_STATUS WHERE ABBREVIATION = 'ASSIGNED' ) WHERE ROWID = :b1
    ORA-01403: no data found.
    So the same error happens on both Windows XP and Windows 7.
    On Windows XP, the error is somehow handled, and does not cause the "Submit" operation to fail.
    On Windows 7, however, the error bubbles to the surface and is displayed to the user, thus halting the "Submit" operation.

    Thank you. I'm well aware that adding an exception handler is the classic solution to the ORA-01403 error. However, like I mentioned in my original post, I don't have the source code. All I have are the compiled .FMX forms so I can't implement such a solution:
    From my original post:
    This error is well documented and the solution involves adding an exception handler to the faulting SQL statement(s) in order to handle the ORA-01403 exception. Unfortunately, the application is composed of compiled forms (.FMX) and we no longer have the source code so I can't implement this solution.

Maybe you are looking for

  • Charged for free movie

    Verizon sent me an email saying I could view a movie free.  I couldn't access the movie and called Verizon tech support.  The agent told me to pick "buy the movie" and then I could view it and I shouldn't be charged for it because it was a free offer

  • Hi,  I am trying to find out if i can download a movie to my Ipad.

    I have a movie that i have downloaded using Itunes on my IMac at home.  But I forgot to sync the Ipad to the Mac. Now i would like to watch the movie BUT i am away for a period of time and need to down load it to my IPad direct. When i have tried to

  • Addt validation problem

    Hi addt url validation will not let the address pass if it have variable such as http://www.xxx.com?a=1 but it's should be a normal web address isn't it?

  • Tracking user changes in LMS 4.1

    Hi, I was wondering if it is possible to track and or log the changes that users make in in LMS 4.1. For an example if someone changed a configuration I want that being logged. I want to see what the person changed, when it's changed and who changed

  • How to check if 3750 switch is using sslv3

    Hi Everyone, i an trying to https to 3750 switch using firefox below is error message Firefox cannot guarantee the safety of your data on 10.0.0.4 because it uses SSLv3, a broken security protocol. Advanced info: ssl_error_no_cypher_overlap Learn Mor