parameterized

Parameterized Queries with LIKE and IN conditions

心不动则不痛 提交于 2020-01-08 16:02:10
问题 Parameterized Queries in .Net always look like this in the examples: SqlCommand comm = new SqlCommand(@" SELECT * FROM Products WHERE Category_ID = @categoryid ", conn); comm.Parameters.Add("@categoryid", SqlDbType.Int); comm.Parameters["@categoryid"].Value = CategoryID; But I'm running into a brick wall trying to do the following: SqlCommand comm = new SqlCommand(@" SELECT * FROM Products WHERE Category_ID IN (@categoryids) OR name LIKE '%@name%' ", conn); comm.Parameters.Add("@categoryids",

Ambiguous type using parameterized types Haskell

谁说我不能喝 提交于 2020-01-07 02:04:29
问题 I have a pretty straightforward function that takes a parameterized data type and returns the same type: {-# LANGUAGE ScopedTypeVariables #-} class IntegerAsType a where value :: a -> Integer newtype (Num a, IntegerAsType n) => PolyRing a n = PolyRing [a] deriving (Eq) normalize :: (Num a, IntegerAsType n) => (PolyRing a n) -> (PolyRing a n) normalize r@(PolyRing xs) | (genericLength xs) == len = r | ... [other cases] where len = (value (undefined :: n)) The idea is that normalize will take a

Ambiguous type using parameterized types Haskell

别等时光非礼了梦想. 提交于 2020-01-07 02:04:23
问题 I have a pretty straightforward function that takes a parameterized data type and returns the same type: {-# LANGUAGE ScopedTypeVariables #-} class IntegerAsType a where value :: a -> Integer newtype (Num a, IntegerAsType n) => PolyRing a n = PolyRing [a] deriving (Eq) normalize :: (Num a, IntegerAsType n) => (PolyRing a n) -> (PolyRing a n) normalize r@(PolyRing xs) | (genericLength xs) == len = r | ... [other cases] where len = (value (undefined :: n)) The idea is that normalize will take a

DataSet query with Parameters does not work in Report Builder

筅森魡賤 提交于 2020-01-02 08:28:34
问题 The following picture shows the query and its result with no variables: The next one shows the same query with a variable and a different result: This how the parameter was set just before the query execution: I have also tried setting the parameter without '' but it produces the same result. Any clue about what's going on? Any help would be greatly appreciated. NOTE: The DBMS is MySql 回答1: This weird issue is due to the fact that SSRS is connected to MySQL by ODBC connector; therefore, the

Specific Builder for Parameterized Type

柔情痞子 提交于 2020-01-01 06:12:45
问题 I'm trying to write a class in scala that wraps a (parameterized) collection and overrides it's foreach method. What it does with the foreach method is unimportant for the purpose of this question, so lets say it just prints each element out as it's visited. So ideally, we'd be able to use the wrapper as follows: scala> val a = List(1,2,3,4,5) scala> val b = MyWrapper(a) scala> b.foreach{ x => x } 1 2 3 4 5 The key is that I want this to work with any iterable; not just a list. So my first

Specific Builder for Parameterized Type

大兔子大兔子 提交于 2020-01-01 06:12:30
问题 I'm trying to write a class in scala that wraps a (parameterized) collection and overrides it's foreach method. What it does with the foreach method is unimportant for the purpose of this question, so lets say it just prints each element out as it's visited. So ideally, we'd be able to use the wrapper as follows: scala> val a = List(1,2,3,4,5) scala> val b = MyWrapper(a) scala> b.foreach{ x => x } 1 2 3 4 5 The key is that I want this to work with any iterable; not just a list. So my first

Is it possible to replace the entire Repository Url with a parameterized string in Hudson/Jenkins?

强颜欢笑 提交于 2019-12-31 22:23:58
问题 In Hudson/Jenkins, is it possible to replace the entire string in the Subversion Module Repository URL with a String parameter? I don't want to just replace just the version or anything like that, I want to replace the entire url. So, when I run the build, I'd get a prompt for the URL and I'd put something like "http://scm.work.corp/svn/com.work.package/tags/project-4.0.0.RELEASE" and it would check that out and build it. Being able to substitute the "com.work.package" and "project-4.0.0

Parameterized table name

醉酒当歌 提交于 2019-12-31 03:58:10
问题 this is my problem: I want to check rows in a table which name is parameterized, something like table_X . The value of X comes from another table, so for example in my main table I have a column c_id and a column X, the table to join has name table_X, it EXISTS with no doubt, and it has the same column c_id , which I shall join on, to check if there are values of c_id in that table. I've tried a view, but without success, because I can't put a parameterized table name in a view. I can

parameterized sql query - asp.net / c#

房东的猫 提交于 2019-12-29 08:41:11
问题 So I recently learned that I should absolutely be using parametrized query's to avoid security issues such as SQL injection. That's all fine and all, I got it working. This code shows some of the code how I do it: param1 = new SqlParameter(); param1.ParameterName = "@username"; param1.Value = username.Text; cmd = new SqlCommand(str, sqlConn); cmd.Parameters.Add(param1); //and so on But the problem is, I have over 14 variables that needs to be saved to the db, it's like a registration form.

Parameterised Modules in Erlang

南笙酒味 提交于 2019-12-29 05:30:31
问题 I was going through mochiweb source code and got to see something i never used before. The module declaration especially in mochiweb_request and mochiweb_response modules found in the mochiweb http library. Here is how the module begins: -module(mochiweb_request,[Socket, Method, RawPath, Version, Headers]). -author(...). Then in the module you see get(socket) -> Socket;get(method)-> Method; .... This has confused me. When i tried getting the module info of one of these such module, the