GVKun编程网logo

Oracle PL/SQL 未找到数据 - 非连续的 Id 值(oracle 未找到任何数据)

2

本文将介绍OraclePL/SQL未找到数据-非连续的Id值的详细情况,特别是关于oracle未找到任何数据的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了解这个主题,同时也将涉及

本文将介绍Oracle PL/SQL 未找到数据 - 非连续的 Id 值的详细情况,特别是关于oracle 未找到任何数据的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了解这个主题,同时也将涉及一些关于angular api 数据表:未找到数据、For oracle databases, if the top showing the oracle database, then oracle process is using the top c、NodeJS-Oracle DB - NJS-040 连接超时,在 ICP 中使用带有 Lopback 的 oracle 驱动程序(loopback-connector-oracle)、ORA-01403:找不到数据ORA-06512:在第8行0140300000-“未找到数据”的知识。

本文目录一览:

Oracle PL/SQL 未找到数据 - 非连续的 Id 值(oracle 未找到任何数据)

Oracle PL/SQL 未找到数据 - 非连续的 Id 值(oracle 未找到任何数据)

如何解决Oracle PL/SQL 未找到数据 - 非连续的 Id 值

我有一份具有以下结构的报告:

列 1 ID、列 2 Approved_Rejected_Status、列 3 Rep_Id

我在运行以下命令时收到未找到数据的错误:

DECLARE 

V_REP_ID VARCHAR2(100);
V_ROWS_APPROVED_min NUMBER;
V_ROWS_APPROVED_max NUMBER;
V_STAT VARCHAR2(100);


BEGIN
    SELECT min(id) INTO V_ROWS_APPROVED_min FROM MY_TABLE; 
    SELECT max(id) INTO V_ROWS_APPROVED_max FROM MY_TABLE; 
    
    FOR i IN V_ROWS_APPROVED_min..V_ROWS_APPROVED_max LOOP
    
        SELECT APPROVED_REJECTED_STATUS INTO V_STAT    
        FROM MY_TABLE  WHERE MY_TABLE.ID =i;
        
        SELECT REP_ID         INTO V_REP_ID 
        FROM MY_TABLE  
        WHERE MY_TABLE.ID = i;
    END LOOP;
END;

我认为这可能与具有非连续值的 ID 有关? (我不能在报告上有连续的功能值,也不包括我需要根据 type_of_change 执行操作的异常原因)

谢谢

编辑: 感谢 MT0 的评论/建议! 我尝试使用游标 for 循环,但发生了一些非常奇怪的事情:

for cur_m in (select id,approved_rejected_status 
            from bdc_bench_watchlist_t
            order by id) 
loop

    if cur_m.approved_rejected_status = ''Approved'' then 
        --Inserting into a test table:
        insert into index_test (ID_copY,MY_APPROVED_STATUS)
        values (cur_m.id,cur_m.approved_rejected_status);
    end if;
end loop;

结果带来了所有 ID 范围(从最小值到最大值),但是! allowed_rejected_status 列是空的(只有标题在行上显示为空数据)。我不知道为什么。 如果我从源表中选择一个基本的选择 id、approved_rejected_status,它会带来一切正常(id 和状态信息正常)。

谢谢

解决方法

假设您需要遍历每个数字并执行某些操作,即使那里没有行,那么只需处理 NO_DATA_FOUND 异常:

DECLARE 
  V_REP_ID            MY_TABLE.REP_ID%TYPE;
  V_ROWS_APPROVED_min MY_TABLE.ID%TYPE;
  V_ROWS_APPROVED_max MY_TABLE.ID%TYPE;
  V_STAT              MY_TABLE.APPROVED_REJECTED_STATUS%TYPE;
BEGIN
  SELECT min(id),max(id)
  INTO   V_ROWS_APPROVED_min,V_ROWS_APPROVED_max
  FROM   MY_TABLE; 
    
  FOR i IN V_ROWS_APPROVED_min..V_ROWS_APPROVED_max LOOP
    BEGIN
      SELECT APPROVED_REJECTED_STATUS,REP_ID
      INTO   V_STAT,V_REP_ID   
      FROM MY_TABLE 
      WHERE MY_TABLE.ID =i;
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        V_STAT := NULL;  -- Or put default values here.
        V_REP_ID := NULL;
    END;
    -- Do stuff with the stat/rep_id
  END LOOP;
END;

如果您不想遍历每一行并想跳过缺少的 id 值,那么您可以使用游标并按 id 排序。

angular api 数据表:未找到数据

angular api 数据表:未找到数据

如何解决angular api 数据表:未找到数据

我正在尝试使用此 API 制作表格: https://run.mocky.io/v3/70e5b0ad-7112-41c5-853e-b382a39e65b7/people 我的表的 html 结构出现了,但没有出现我的 API 的数据,我在控制台中没有错误

你有解决方案吗?

这是我的休息组件的结构(我的表的代码):

people.ts

  1. export class people {
  2. id: string;
  3. firstname: string;
  4. lastname: string;
  5. email: string;
  6. mobile: string;
  7. city: string;
  8. country: string;
  9. constructor(id,firstName,lastName,email,mobile,city,country){
  10. this.id=id;
  11. this.firstname=firstName;
  12. this.lastname=lastName;
  13. this.email=email;
  14. this.mobile=mobile;
  15. this.city=city;
  16. this.country=country;
  17. }
  18. }

rest.component.html

  1. <h1>Employee Dashboard</h1>
  2. <table class="table table-bordered">
  3. <thead>
  4. <tr>
  5. <th>Id</th>
  6. <th>First Name</th>
  7. <th>Last Name</th>
  8. <th>Email</th>
  9. <th>Address</th>
  10. <th>City</th>
  11. <th>Country</th>
  12. </tr>
  13. </thead>
  14. <tbody>
  15. <tr *ngFor= "let user of users">
  16. <td>{{people.id}}</td>
  17. <td>{{people.firstname}}</td>
  18. <td>{{people.lastname}}</td>
  19. <td>{{people.email}}</td>
  20. <td>{{people.address}}</td>
  21. <td>{{people.city}}</td>
  22. <td>{{people.country}}</td>
  23. </tr>
  24. </tbody>
  25. </table>

rest.component.spec.ts

  1. import { Testbed,async } from ''@angular/core/testing'';
  2. import { RouterTestingModule } from ''@angular/router/testing'';
  3. import { AppComponent } from ''./rest.component'';
  4. describe(''AppComponent'',() => {
  5. beforeEach(async(() => {
  6. Testbed.configureTestingModule({
  7. imports: [
  8. RouterTestingModule
  9. ],declarations: [
  10. AppComponent
  11. ],}).compileComponents();
  12. }));
  13. it(''should create the app'',() => {
  14. const fixture = Testbed.createComponent(AppComponent);
  15. const app = fixture.debugElement.componentInstance;
  16. expect(app).toBeTruthy();
  17. });
  18. it(`should have as title ''project''`,() => {
  19. const fixture = Testbed.createComponent(AppComponent);
  20. const app = fixture.debugElement.componentInstance;
  21. expect(app.title).toEqual(''project'');
  22. });
  23. it(''should render title in a h1 tag'',() => {
  24. const fixture = Testbed.createComponent(AppComponent);
  25. fixture.detectChanges();
  26. const compiled = fixture.debugElement.nativeElement;
  27. expect(compiled.querySelector(''h1'').textContent).toContain(''Welcome to project!'');
  28. });
  29. });

rest.component.ts

  1. import { Component,OnInit } from ''@angular/core'';
  2. import { people } from ''./people'';
  3. import { RestService } from ''./rest.service'';
  4. @Component({
  5. selector: ''app-root'',templateUrl: ''./rest.component.html'',styleUrls: [''./rest.component.css'']
  6. })
  7. export class RestComponent implements OnInit {
  8. people: people[] = [];
  9. constructor(public rs: RestService){
  10. }
  11. ngOnInit():void {
  12. this.rs.getUsers().subscribe((response) => {
  13. this.people=response;
  14. })
  15. }
  16. title = ''project'';
  17. }

rest.service.ts

  1. import { Injectable } from ''@angular/core'';
  2. import { HttpClient } from ''@angular/common/http'';
  3. import { people } from ''./people''
  4. @Injectable({
  5. providedIn: ''root''
  6. })
  7. export class RestService {
  8. constructor(private http:HttpClient){}
  9. url:string= "https://run.mocky.io/v3/70e5b0ad-7112-41c5-853e-b382a39e65b7/people";
  10. getUsers(){
  11. return this.http.get<people[]>(this.url);
  12. }
  13. }

解决方法

实际的 People 对象数组位于 API 响应中名为“people”的属性下。所以,修改服务代码:

  1. getUsers(){
  2. return this.http.get<any>(this.url).pipe(
  3. map(response) => {
  4. return response[''people''];
  5. })
  6. );
  7. }
,

您需要更改的代码将在两个文件中

  1. rest.component.html

    替换这个

    1. <tr *ngFor= "let user of users">
    2. <td>{{people.id}}</td>
    3. <td>{{people.firstname}}</td>
    4. <td>{{people.lastname}}</td>
    5. <td>{{people.email}}</td>
    6. <td>{{people.address}}</td>
    7. <td>{{people.city}}</td>
    8. <td>{{people.country}}</td>
    9. </tr>

    有了这个

    1. <tr *ngFor= "let user of users">
    2. <td>{{user.id}}</td>
    3. <td>{{user.firstname}}</td>
    4. <td>{{user.lastname}}</td>
    5. <td>{{user.email}}</td>
    6. <td>{{user.address}}</td>
    7. <td>{{user.city}}</td>
    8. <td>{{user.country}}</td>
    9. </tr>
  2. 在 rest.component.ts 中

    替换

    1. ngOnInit():void {
    2. this.rs.getUsers().subscribe((response) => {
    3. this.people=response;
    4. })

    有了这个

    1. ngOnInit():void {
    2. this.rs.getUsers().subscribe((response) => {
    3. this.users=response.people;
    4. })
,

应该是 user.id 而不是 people.id

  1. <tr *ngFor= "let user of users">
  2. <td>{{user.id}}</td>
  3. <td>{{user.firstname}}</td>
  4. <td>{{user.lastname}}</td>
  5. <td>{{user.email}}</td>
  6. <td>{{user.address}}</td>
  7. <td>{{user.city}}</td>
  8. <td>{{user.country}}</td>
  9. </tr>
,

代码的问题在于您将数据保存在人员中,而在前端您使用的是未定义的 user

  1. <tbody>
  2. <tr *ngFor= "let p of people">
  3. <td>{{p.id}}</td>
  4. <td>{{p.firstname}}</td>
  5. <td>{{p.lastname}}</td>
  6. <td>{{p.email}}</td>
  7. <td>{{p.address}}</td>
  8. <td>{{p.city}}</td>
  9. <td>{{p.country}}</td>
  10. </tr>
  11. </tbody>

For oracle databases, if the top showing the oracle database, then oracle process is using the top c

For oracle databases, if the top showing the oracle database, then oracle process is using the top c

Note 805586.1 Troubleshooting Session Administration (Doc ID 805586.1) Note 822527.1 How To Find Where The Memory Is Growing For A Process (Doc ID 822527.1) Note 273646.1 How to diagnose the high cpu utilization of ORACLE.EXE in Windows environment Note 728539.1 Find Blocking Sessions In sqlPLUS Note 61552.1 Troubleshooting Oracle Database Hanging Issues for versions from 7 to 9--Exhaustive Note 164760.1 Detecting and Resolving Locking Conflicts using TopSessions

NodeJS-Oracle DB - NJS-040 连接超时,在 ICP 中使用带有 Lopback 的 oracle 驱动程序(loopback-connector-oracle)

NodeJS-Oracle DB - NJS-040 连接超时,在 ICP 中使用带有 Lopback 的 oracle 驱动程序(loopback-connector-oracle)

如何解决NodeJS-Oracle DB - NJS-040 连接超时,在 ICP 中使用带有 Lopback 的 oracle 驱动程序(loopback-connector-oracle)?

我正在使用 loopback-connector-oracle 4.1.1 版寻求有关我面临的问题的一些信息。分析如下: 我们有 DB 连接配置,可以使用 json 文件格式的 oracle 连接器使用属性连接到 oracle DB 数据源。 "maxConn": 20,“主机”:DB_HOST, “端口”:DB_PORT, “数据库”:DB_NAME, “密码”:DB_PASSWORD, “用户”:DB_USER, "connector": "oracle",

有两个进程/pod 正在运行,每个进程/pod 都有自己的池供oracle 连接器使用。发生的情况是,在一个实例中,oracle 能够连接并处理请求,但在第二个 pod/进程中,我注意到 njs-040 错误连接超时。由于两者都运行在同一个环境中,所以连接性不会成为问题。我正在寻求您的帮助或意见以了解连接池耗尽的原因?正如我所看到的,DB 上的连接/会话数量配置的数量较少。 当我重新启动 pod/进程时,一切都会恢复正常。在我的流程中遇到的一些问题,如果您可以指导并提供宝贵的意见,我正在寻求您的帮助。

  • 如果使用连接池(oracle 连接器),它也应该释放对象,耗尽的机会会减少吗?
  • 在进程/pod 启动并通过连接器 (oracle) 获取数据源中的连接对象后,发生网络问题并且进程和数据库之间的连接丢失,连接器是否恢复?根据我的观察,我在其他进程中注意到的似乎应该被恢复,当它与范围一起运行时,在一个进程中可能会导致什么?

我非常感谢您的回复。 提前致谢 桑吉夫

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

ORA-01403:找不到数据ORA-06512:在第8行0140300000-“未找到数据”

ORA-01403:找不到数据ORA-06512:在第8行0140300000-“未找到数据”

如何解决ORA-01403:找不到数据ORA-06512:在第8行0140300000-“未找到数据”

通常,这个基本的If语句应该返回数据,但是我不明白,我在哪里弄错了。 (CustNo是char(8)。)我认为问题是由于V_Id而发生的。在一个通常的带有Custno =''C2388597''的select语句中,我可以得到数据。但是当它在If语句中时,它将给出ORA-01403错误代码。

提前感谢您的支持...

Declare 

  V_Id Deneme_Customer.Custno%type;
  V_Custbal Deneme_Customer.Custbal%Type;
  v_situation Deneme_Customer.Custbal_Situation%type;

Begin
  Select Custno,Custbal,Custbal_Situation Into V_Id,V_Custbal,V_Situation
    From Deneme_Customer Where V_Id =''&no'';
  
  If (V_Custbal>=20 And V_Custbal<=100) Then 
    V_Situation:=''Es tut mir sehr leid'';
  Elsif (V_Custbal>=101 And V_Custbal<=1000) Then 
    V_Situation:=''Guuuut'';
  Elsif (V_Custbal>1000) Then 
    V_Situation:=''Sehr Guuuut'';
  Else Dbms_Output.Put_Line(''Falsche Eingabe'');

  End If;
  
  update Deneme_Customer set Custbal_Situation=v_situation where Custno=V_Id;

end;`

解决方法

我想v_id是局部变量,是Custno,它是表的第8行。

对于Custno''&no''之类的不匹配值,例如

,可能仍需要异常处理
Begin
  Select Custno,Custbal,Custbal_Situation Into V_Id,V_Custbal,V_Situation
    From Deneme_Customer 
   Where Custno = ''&no'';
  Exception When no_data_found then null;
 End;
,

您无需使用PL / SQL来确定应将 custbal_situation 设置为什么,您可以通过以下简单的更新语句轻松完成此操作:

UPDATE deneme_customer
   SET custbal_situation =
           CASE
               WHEN custbal >= 20 AND custbal <= 100 THEN ''Es tut mir sehr leid''
               WHEN custbal >= 101 AND custbal <= 1000 THEN ''Guuuut''
               WHEN custbal > 1000 THEN ''Sehr Guuuut''
           END
 WHERE custbal >= 20;

如果您想对其进行修改以仅影响一位客户,只需将其添加到where子句中即可。

然后要查看没有设置其值的任何客户,可以使用类似这样的查询找到他们

SELECT custno,custbal,custbal_situation
  FROM deneme_customer
 WHERE custbal < 20;
,

看起来您可能没有任何匹配V_Id =''&no''的行,只是为了对其进行测试,请从其中V_Id =''&no''的表中进行选择计数并检查该计数。

AL_也是V_Id的唯一列,如果不是,那么您需要在错误处理程序中处理对匹配where子句的多行进行罚款的情况。

exception 
  when no_data_found then
    <handle apppropriately>
  when TOO_MANY_ROWS then
    <handle apppropriately>
 WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE
      (''Unknown error'');
end

今天关于Oracle PL/SQL 未找到数据 - 非连续的 Id 值oracle 未找到任何数据的讲解已经结束,谢谢您的阅读,如果想了解更多关于angular api 数据表:未找到数据、For oracle databases, if the top showing the oracle database, then oracle process is using the top c、NodeJS-Oracle DB - NJS-040 连接超时,在 ICP 中使用带有 Lopback 的 oracle 驱动程序(loopback-connector-oracle)、ORA-01403:找不到数据ORA-06512:在第8行0140300000-“未找到数据”的相关知识,请在本站搜索。

本文标签: