Home > database >  Oracle how to judge whether a table is full
Oracle how to judge whether a table is full

Time:10-06

Have two tables, from the table to a second form to fill in the data according to certain conditions, only a limited list 2 line, double loop is to use two cursors, a data read from the first table, to determine the second table is written to meet the conditions, not just jumped out, and so on, until the next table to write a full stop, now I don't know how to write the end of the first cursor statement, strives for the great god!!!!!!!!!!

CodePudding user response:

refer to the original poster asddsa00x response:
there are two tables, from the table to a second form to fill in the data according to certain conditions, only a limited list 2 line, double loop is to use two cursors, a data read from the first table, to determine the second table is written to meet the conditions, not just jumped out, and so on, until the next table to write a full stop, now I don't know how to write the end of the first cursor statement, strives for the great god!!!!!!!!!!

Not very understand, why the second table is limited? If the limit, when more than limited line should be an error, whether all the EXCEPTION can be used to deal with

CodePudding user response:

Describe the specific situation to clear some ~

CodePudding user response:

reference 1st floor zlloct response:
Quote: refer to the original poster asddsa00x response:

Have two tables, from the table to a second form to fill in the data according to certain conditions, only a limited list 2 line, double loop is to use two cursors, a data read from the first table, to determine the second table is written to meet the conditions, not just jumped out, and so on, until the next table to write a full stop, now I don't know how to write the end of the first cursor statement, strives for the great god!!!!!!!!!!

Not very understand, why the second table is limited? If the limit, when more than limited line should be an error, are all can handle with the EXCEPTION?


Because it can be thought of as the second form is conditional, first the data in the table to meet this condition will be written to, for example, the first table is a lot of letters, the second table are different people, different people receive different letter, when everyone received the letter and looking at the letter, there is no need to put the letter a a judgment, because people are looking at the letter, so I don't continue to distribute, the end of the cycle, until someone watching the letter will continue to distribute, don't know this parable good understanding,

CodePudding user response:

refer to the second floor ghx287524027 response:
to describe clearly the specific situation ~

The upstairs

CodePudding user response:

reference asddsa00x reply: 3/f
Quote: refer to 1st floor zlloct response:

The
Quote: refer to the original poster asddsa00x response:

Have two tables, from the table to a second form to fill in the data according to certain conditions, only a limited list 2 line, double loop is to use two cursors, a data read from the first table, to determine the second table is written to meet the conditions, not just jumped out, and so on, until the next table to write a full stop, now I don't know how to write the end of the first cursor statement, strives for the great god!!!!!!!!!!

Not very understand, why the second table is limited? If the limit, when more than limited line should be an error, are all can handle with the EXCEPTION?


Because it can be thought of as the second form is conditional, first the data in the table to meet this condition will be written to, for example, the first table is a lot of letters, the second table are different people, different people receive different letter, when everyone received the letter and looking at the letter, there is no need to put the letter a a judgment, because people are looking at the letter, so I don't continue to distribute, the end of the cycle, until someone watching the letter will continue to distribute, don't know the metaphor is good understanding,

Then you should add a logo to illustrate whether the table is full is ok

CodePudding user response:

Don't have to define two cursor, it is ok to define a;

Circulation list 2;

CodePudding user response:

refer to 6th floor wmxcn2000 response:
don't have to define two cursor, it is ok to define a;

Circulation list 2;

But the first table is sequential, must start from the first data retrieval

CodePudding user response:

reference 5 floor ghx287524027 reply:
Quote: refer to the third floor asddsa00x response:

Quote: refer to 1st floor zlloct response:

The
Quote: refer to the original poster asddsa00x response:

Have two tables, from the table to a second form to fill in the data according to certain conditions, only a limited list 2 line, double loop is to use two cursors, a data read from the first table, to determine the second table is written to meet the conditions, not just jumped out, and so on, until the next table to write a full stop, now I don't know how to write the end of the first cursor statement, strives for the great god!!!!!!!!!!

Not very understand, why the second table is limited? If the limit, when more than limited line should be an error, are all can handle with the EXCEPTION?


Because it can be thought of as the second form is conditional, first the data in the table to meet this condition will be written to, for example, the first table is a lot of letters, the second table are different people, different people receive different letter, when everyone received the letter and looking at the letter, there is no need to put the letter a a judgment, because people are looking at the letter, so I don't continue to distribute, the end of the cycle, until someone watching the letter will continue to distribute, don't know the metaphor is good understanding,

Then you should add a logo to illustrate whether the table is full is ok ah

Can speak a little more specific? Because the last line is not necessarily the insert data ends, is likely to continue to retrieve guilds in the middle of the free

CodePudding user response:

refer to 7th floor asddsa00x response:
Quote: refer to the sixth floor wmxcn2000 response:

Don't have to define two cursor, it is ok to define a;

Circulation list 2;

But the first table is sequential, must start from the first data retrieval


You might as well give some sample data, and your expected results, maybe can solve your problem faster;

CodePudding user response:

As this figure now have eight letters, according to the letter arrived in time to sort, but the recipient list only three people  , because I had already sorted in the first table, so to take out the first data, first traversal in table 2, find out the recipient for a, inserting data, and then take out the second data in table 2, the traversal, insert the recipient s line, but when take out the third data traversal found that the recipient has been occupied, so is not inserted, continue down until the second table are all insert data or a piece of table data after traversal is over, just don't know now is inserted all jump out of the circle that how to write

CodePudding user response:

this is the result of end loop

CodePudding user response:

references 9 f wmxcn2000 response:
Quote: refer to 7th floor asddsa00x response:

Quote: refer to the sixth floor wmxcn2000 response:

Don't have to define two cursor, it is ok to define a;

Circulation list 2;

But the first table is sequential, must start from the first data retrieval


You might as well give some sample data, and your expected results, maybe can solve your problem faster;

Give a little simple data, seek counsel

CodePudding user response:

 
- there's no need to use a cursor, a subquery can

Connected to the Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0
Connected as test @ MSGDE

SQL>
SQL> A10 col id format;
SQL> A10 col name format;
SQL> Col rq a10 format;
SQL> Create table a (int id, name varchar (10), rq int);
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related