Home > database >  Consult a stored procedure, the value problem of in
Consult a stored procedure, the value problem of in

Time:09-23

My side in hard to compile SQL code, met the needs to be set in the parameter, the volunteers had strings, arrays, collections, cannot use,
Need to be consulted in the value side how to set up his parameter
Using the collection value transfer code below
SQL. Append (" AND a.R equest_No in (: requestNos) ");
List the List=new ArrayList (a);
List. The add (" 012050304374 ");
List. The add (" 011120608114 ");
The map. The put (" requestNos ", a list);

CodePudding user response:

- directly joining together to come in, pay attention to deal with the SQL injection,
SQL. Append (" AND a.R equest_No in (' 012050304374 ', '011120608114') ");

CodePudding user response:

Originally is the joining together of, want to change is not a patchwork

CodePudding user response:

String is in single quotes, to write the single dominant in,

CodePudding user response:

 
The select object_id, object_type
The from user_objects
Where object_id in (select regexp_substr (' 91219912 34 ', '[^,] +' 1, level)
The from dual
Connect by rownum & lt;
=2)
- '91219912 34' to you together good string, use commas between data project
-- <=2, 2 is the number of data items here
  • Related