AbelSurace
AbelSurace

Reputation: 2273

What is the purpose of "#*" hash and star symbols before the parameters passed to a query?

I have the following query which gets called from ASP.NET application and creates a subset of rows within the same table "DETAILS" and the subset is defined by parameters $f2 and $f3 used for paging purposes.

INSERT INTO DETAILS (ID, UIN, ACTIVE_IND, UGUID, CREATED_BY, CREATED_DATE)
SELECT AF.ID, AF.UIN, AF.ACTIVE, AF.UGUID, AF.CREATED_BY, AF.CREATED_DATE FROM 
(SELECT #*$f0 ID, DET.UIN, DET.ACTIVE_IND, DET.UGUID, DET.CREATED_BY, DET.CREATED_DATE, 
        DENSE_RANK() OVER (ORDER BY P.PRODUCT_ID) FG 
        FROM DETAILS DET 
        JOIN PRODUCTS P ON P.UIN = DET.UIN 
        WHERE ID = #*$f1 ) AF 
    WHERE AF.FG BETWEEN #*$f2 AND #*$f3

The ASP.NET c# code that calls this query looks like this

 new SqlDataSource().ExecuteSql("InsertDetails",
                new List<object>() {_subSetId, _mainSetId, start, end});

"InsertDetails" is the name of the above query and "start" "end" are the paging range.

My question is: What function or purpose have the "#*" before the parameters in this query??. I need to replicate this query for other tables but would like to know why are the parameters passed like this "#*$f0", "#*$f1", "#*$f2" and "#*$f3".

Upvotes: 0

Views: 296

Answers (1)

Gottfried Lesigang
Gottfried Lesigang

Reputation: 67311

You asked me to put my comment as answer. It seems that I had the correct guess:

Sometimes such weird characters are used as place holders which are replaced on string level before the call (kind of dynamic command generation)... Neither beautifull nor clean, but sometimes - well - you know...

You might use the profiler to monitor the statement which is processed acutally

Happy Coding!

Upvotes: 1

Related Questions