plz explain the code
views:
109answers:
4strSQL=strSQL & ",REQ_name as " & chr(34) & "REQUESTOR NAME" & chr(34) . what will this command do?
This seems to be part of code that puts together an SQL query. It adds the field REQ_name
to be included in the result and specifies the alias REQUESTOR NAME
to be used as name for the column in the result.
The code creates a new string to assign to the variable strSQL
that consists of the current content of the variable and this:
,REQ_name as "REQUESTOR NAME"
Instead of using the code chr(34) to get a quotation mark, you can put them inside a string as double quotation marks:
strSQL=strSQL & ",REQ_name as ""REQUESTOR NAME"""
strSQL = (previous value of strSQL) + ,REQ_name as “REQUESTOR NAME”
if previos value of strSQL = "SELECT some_fieds" then strlSQL value will be "SELECT some_fields, REQ_name as “REQUESTOR NAME”"
I would guess that the code is part of a SQL SELECT statement. The column retrieved would be psycically named REQ_name and aliased as REQUESTOR NAME.
The language used could be Visual Basic.