Sql query

Hi,

Can someone explain to me what this SQL statement doing here?

"select sysdba.GNL_POT('" + contactID.Trim() + "') as ts_pot";

As I found this in my C# project for the sqlcommand sql statement with the connection object as the second parameter. Im bit confused with GNL_POT is that a table or function or view or what?

Any help very grately appreciated.

Thanks!
ube100Asked:
Who is Participating?
 
dqmqConnect With a Mentor Commented:
Looks like a function to me.  Given the argument contact_Id.trim(), which is a variable in the c# program
0
 
HainKurtConnect With a Mentor Sr. System AnalystCommented:
it is running a user defined function and passing contact id from your app

you should find the code for GNL_POT and check what it returns...
0
 
databoksCommented:
Look under the Tables, functions, views until you find it.

0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
iI could say that also.

note though that this is ad-hoc build sql, you should consider changing that into parameterized code to avoid sql injection ...
0
 
HainKurtSr. System AnalystCommented:
what it returns? you can check it on your app, maybe it will help you understand it without checking the code
0
 
ube100Author Commented:
Yes,

That is a function so how do I execute in the Management studio and get the return value?
0
 
dj_alikCommented:
this is the user defined  function only function can be used in select  with parameter.
you can execute tgis  sql to see all your functions in  selected database:
USE YOUR_DATABASE;
 GO
 SELECT name AS function_name
 ,SCHEMA_NAME(schema_id) AS schema_name
 ,type_desc
 FROM sys.objects
 WHERE type_desc LIKE '%FUNCTION%';
 GO
 


 
0
 
databoksCommented:
Please provide the code of the function.  It will help alot.

We can also explain what it does.
0
 
DBAduck - Ben MillerConnect With a Mentor Principal ConsultantCommented:
You would go into Management Studio in the database that you are going to execute it against.  Then execute:

select sysdba.GNL_POT('1') as ts_pot
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.