question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dapper OracleDynamicParameters, multipleQquery and clause 'in'

See original GitHub issue

Hi, I am struggling with something not sure why not able to execute.

I have a clause in that I would like to execute in a second query… for simplicity let’s say something like :

`

begin

  open :c_query1 for
    select * from T1;

  open :c_query2 for
  select * from T2 t_t2 where t_t2.name in :pNames;

end;

`

where I would have my parameters as `

            var dynParams = new OracleDynamicParameters();
            dynParams.Add(":c_query1", direction: ParameterDirection.Output, dbType: OracleMappingType.RefCursor);
            dynParams.Add(":c_query2", direction: ParameterDirection.Output, dbType: OracleMappingType.RefCursor);
            dynParams.Add(":pNames", new[] {"AA", "BB"});

`

when I execute this my “in clause” comes empty… any idea? thanks

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
figueiredorjcommented, Oct 14, 2021

Hi @ut786 , that is what I already doing (string concatenation) and was trying to avoid… as for that is always risk of sql injection, I would say… and actually using “Aggregate” - cleaner…

0reactions
ut786commented, Oct 14, 2021

Hi @ut786 , that is what I already doing (string concatenation) and was trying to avoid… as for that is always risk of sql injection, I would say… and actually using “Aggregate” - cleaner…

Try to use DataTable in instead of string array.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Dapper QueryMultiple in Oracle
Dapper seems to just pass the SQL command straight along to ADO.NET and whatever db provider is executing the command. In the syntax...
Read more >
Issues · DIPSAS/Dapper.Oracle
Contribute to DIPSAS/Dapper.Oracle development by creating an account on GitHub. ... Dapper OracleDynamicParameters, multipleQquery and clause 'in'.
Read more >
Dapper QueryMultiple, QueryMultipleAsync
The Dapper QueryMultiple method allows you to select multiple results from a database in a single query and then, after reading those results...
Read more >
Multiple Executions. A nice feature that is NOT as cool as…
In Dapper .NET, Multiple execution is a convenient (or maybe not? make sure you read the article until the end!) way to execute...
Read more >
Dapper Avoid parentheses in SQL statement when using ...
Approach 1 - Dynamic query construction using string manipulation classes. Weird. You don't need to do this. Dapper helps you to convert a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found