Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Can any1 tell whrther this is an example of parameterized query.


C#
public string qry_UpdateGroupID_UserRightsMaster(int usermasterinternalid, int makerid)
      {
          StringBuilder strBuilder = new StringBuilder();
          strBuilder.Append(" UPDATE USER_RIGHTS_MASTER ");
          strBuilder.Append(" SET ");
          strBuilder.Append(" MAKER_ID =  " + makerid + ", ");
          strBuilder.Append(" MAKER_DATETIME = SYSDATE WHERE ID = " + usermasterinternalid + "; ");
          return strBuilder.ToString();
      }
Posted
Updated 28-Jul-13 22:42pm
v2
Comments
Thanks7872 29-Jul-13 4:41am    
Do you see any parameters in this query?

1 solution

Refer this link

Parameterized Queries (Oracle)[^]
string sql = "SELECT * FROM Customers WHERE CustomerId = :CustomerId";

OracleCommand command = new OracleCommand(sql);

command.Parameters.Add(new OracleParameter(":CustomerId", OracleType.Int32));//Parameter has

command.Parameters[":CustomerId"].Value = 1;//been provided

Regards..:laugh:
 
Share this answer
 
Comments
Member 9410081 29-Jul-13 4:51am    
Thanks..
So my above code cannot be considered as parameterized query?what is above query type?
Thanks7872 29-Jul-13 4:53am    
Yes you understand correctly.Whats your another question in comment?Pardon?
Member 9410081 29-Jul-13 6:23am    
The code u have written is parametrized and the code i have written is?
Thanks7872 29-Jul-13 6:39am    
Its not parameterized one. I have provided you a link. Refer to that to have better idea.
Member 9410081 29-Jul-13 7:04am    
thanksss..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900