The maximum number of expressions in a list in Oracle is 1000

Updated on technology 2024-03-14
17 answers
  1. Anonymous users2024-02-06

    is a limitation of oracle, and there are many ways to solve it.

    For example, the ** of c below.

    1. Write a method first and receive 2 parameters.

    Parameter 1: Receive data in in, such as:'a1','a2',..'a2000' ;

    Parameter 2: the name of the column that needs to be in;

    public string getsqlin( string sqlparam, string columnname )

    int width = "'", 1 ) 1;

    string temp = ;

    for( int i = 0; i < i += 1000 * width + 3 )

    if( i + 1000 * width + 3 ) 1 <

    temp = temp + i, 1000 * width + 3 ) 1 )

    or " + columnname + " in (";

    elsetemp = temp + i, -i );

    return temp;

    2. The return value of using this method, ** is as follows:

    sql = new "");

    select " );

    from test t" );

    where 1=1 " );

    if( >0 )

    string sqlstr = getsqlin( col, "colname" );

    and in ( " + sqlstr + " )" );

    order by " );

    3. The format of the SQL string obtained after running is as follows:

    select t.* from test t where in (59,60) or in (61,62)

    This solves the problem that in is greater than 1000.

  2. Anonymous users2024-02-05

    What if there are 10 tens of thousands of data?

  3. Anonymous users2024-02-04

    Frightened, amazing, so far I haven't encountered a table with so many columns, so many column characters don't meet the requirements of the three normals of database design

  4. Anonymous users2024-02-03

    1000 columns is not enough, what a big project you have.

  5. Anonymous users2024-02-02

    The maximum length of the field name is 30 characters, and the maximum number of columns is 1000, so there seems to be no way to solve it.

  6. Anonymous users2024-02-01

    It is 1000, please see oracle9i's virtual lead sql reference:

    the absolute maximum number of columns in a table is 1000. however, when you

    create an object table (or a relational table with columns of object, nested table,varray, or ref type), oracle maps the columns of the user-defined types to

    relational columns, creating in effect "hidden columns" that count toward the

    1000-column limit.

  7. Anonymous users2024-01-31

    Is this a tip?

    ora-01795: The maximum number of expressions in the list is 1000, what's your case?

    Too many lists when writing in?

    If so, you can split the value in and put it in the database table (temporary table), and then associate it.

  8. Anonymous users2024-01-30

    In SQL, in is followed by a query statement, as long as it is a result set, for whether there is a number limit, but I really haven't encountered it, it is recommended that you write your parameters in the form of a select statement, and actually test it.

  9. Anonymous users2024-01-29

    declare

    i number;

    r number;

    str long := '';

    beginfor i in 1 ..1000 loopstr := str ||i ||',';

    r:=i;end loop;

    execute immediate 'select 1 from dual where 1 in (' ||str||to_char(r+1) |')';

    end;The maximum number of expressions in the list is 1000, otherwise the error message is displayed in oracle 10g: The maximum number of expressions in the list is 1000

  10. Anonymous users2024-01-28

    The maximum number should not exceed 1,000, otherwise an error message is reported when the Oracle 10 GB message is generated.

    ORA-01795: The maximum number of expressions in a list is 1000

  11. Anonymous users2024-01-27

    How many hundreds of in() parameters? Are you sure you want to write out these hundreds of parameters one by one?

    You should work around.

    in(), which can also receive select query statements, such as select * from emp where deptno in (select deptno from dept).

  12. Anonymous users2024-01-26

    There is a limit to the length of a SQL statement.

  13. Anonymous users2024-01-25

    1. When constraining the table structure, the constraints generally established are system-defined constraints.

    2. However, the constraints created in this way are not intuitive when viewing the constraint definition. And its constraint naming is also defined according to the system.

    3. If there are multiple constraints in a table, it is difficult to distinguish which field the constraints are specified to. This is especially true when there are two identical constraints on a table.

    4. Therefore, it is recommended to use the constraint keyword to create custom constraints when creating constraints. The constraints created in this way make it clear which field the constraints are acting on when you look at them.

    5. But when customizing the constraint alias through constraint, keep in mind that the constraint constrains the alias; It should be followed by the field type, and cannot be written in other places, otherwise an error will be reported as shown in the following figure.

  14. Anonymous users2024-01-24

    A in (1,2,.. can be solved simply like this999) or a in (1000,1001,..1999) or ..

    Or store the in in a temporary table, and then associate the query! Such as:

    with t as (

    select 1 id from dualunion all

    .select 199999 id from dual)select ..from table where a in (select * from t).

  15. Anonymous users2024-01-23

    You write it one by one, then it's better to organize a table, write in the table, and use in (select table) to get affordable!

  16. Anonymous users2024-01-22

    Give you a copy of a paragraph:

    The project was used in oracle where

    The in condition query statement in the statement. in(,, the number of data in parentheses is relatively large (here is the situation of regional query), and there are more than 7,000 districts, streets, and communities under Beijing. There are several ways to solve this problem.

    1. Write a method to replace the condition with in(,,or in (,or in,)

    Ensure that the number of data in each IN does not exceed 1,000. The problem is that the execution is inefficient when dealing with this. First of all, the query comes up with so many conditional values, and then there is that or in the query

    Condition... 2. Establish an intermediate temp table with query conditions, and perform direct query in the database.

    select * from table_1 where column_1 in ( select column_2 from

    table_2_temp )

    ps: I didn't use this way...

    3. Abandon the kind of SQL statement that first finds out the query conditions, and then puts the conditions in the SQL statement of the query target result set, and writes SQL statements directly.

    select * from table_1 ,。

    where column_1 in ( select column_2 from table_2 ,。

    While achieving business results, it also improves execution efficiency.

    Think about what it would be like to execute an SQL statement for a few minutes...

  17. Anonymous users2024-01-21

    sql> create table test3(name varchar2(4001));

    create table test3(name varchar2(4001))

    Error on line 1:

    ora-00910: specified length is too long for data type sql> create table test3(name varchar2(4000));

    A table has been created.

Related questions
4 answers2024-03-14

The solution is as follows: 1. The create global temporary table t temp statement is to create a temporary table, there are two kinds of temporary tables created in oracle, one is transaction-level and the other is session-level, when the creation of temporary table statement is followed by on commit delete rows, it means that the temporary table is transaction-level, and when on commit preserve rows it means that the temporary table is session-level. >>>More

1 answers2024-03-14

In oracle, the sequence is the sequence number, which is automatically incremented each time it is retrieved. Sequence has nothing to do with tables. >>>More

14 answers2024-03-14

UY is the largest star in the known universe today. It is 5 billion times the size of the Sun and only 32 times the mass of the Sun. The most massive star known is R136A1, which is about 265 times the mass of the Sun.

10 answers2024-03-14

select top(1)* from table_name order by update_time desc

My idea is to find the result of the first place in descending order of modification time, isn't it? >>>More

6 answers2024-03-14

When you have a job interview, the recruiting company will ask you: What are your strengths? When we encounter this problem, we can teach you a way to give you extra points in interviews and increase the company's praise for you!