Solved

SQLProcedure Function

Posted on 1998-05-15
8
630 Views
Last Modified: 2013-11-20
Hello:

I am using Visual C++ 5.0 and MS SQL Server 6.5.
When I use "SELECT  * FROM  sysobjects WHERE type = 'P'" ststement to list all of the procedure in
my database, I get following result:

dt_getobjwithprop              2815072         1      P   ....
dt_getpropertiesbyid         18815129       1      P  ....
dt_setpropertybyid             34815186       1      P  ....
delete_template                 1976394110   1      P   ....
delete_tables                      2020918271  1      P  ....

But When I use SQLProcedure(hstmt,NULL,0,NULL,0NULL,0) function to list all of the procedure in
my VC Application. only first three can be list out.

Why the result is differnet. How can I list all of the procedure in my database in VC?

Thanks for your help.

Jinsong Liu

E-Mail : Jinsongliu@usa.net

0
Comment
Question by:jinsong
  • 5
  • 3
8 Comments
 
LVL 3

Expert Comment

by:tma050898
Comment Utility
SQLProcedures will ONLY return rows for procedures that have at least one argument. ODBC considers procedures that take zero arguments to be views and not procedures.

HTH,
Tom

0
 

Author Comment

by:jinsong
Comment Utility
But when I run odbctest program that come with ODBC SDK. It can list all of the procedure. How they did it. Or do you have any suggestion?

Thanks

Jinsong Liu
0
 
LVL 3

Expert Comment

by:tma050898
Comment Utility
I see what you mean. However, with the documentations stating that procedures with 0 args are not returned when SQLProcedures is called and the odbc demo returning them all I would have to imagine that they are running an SQL query against directly against a catalog, or system table as you did when you originally were able to retrieve all of the procs.
0
 

Author Comment

by:jinsong
Comment Utility
tma:

I can not agree your imagination. I think your answer for why I can not list all of them is correct. But I am sure I can list all of them by just using ODBC call, I just do not know how to do it. So I reopen this question for everybody. If no body can point me out. I will come back to Grade your answer. If somebody can point me out, I will repost this question with 50 points for you then i can give the credit to you.

Thank you very much

Jinsong Liu
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 3

Expert Comment

by:tma050898
Comment Utility
No problem. I tested it with a couple of databases and basically got the same results as you did. Hopefully, someone can shed some light on this.
0
 

Author Comment

by:jinsong
Comment Utility
Tma:

I am going to give this 100 points to you please come in.

Jinsong

0
 
LVL 3

Expert Comment

by:tma050898
Comment Utility
I know you thought that the dox were wrong. Were you ever able to find out how the sample does it? Sorry. We've been in deadline hell here at work, so I haven't been able to do anything more on it.
0
 
LVL 3

Accepted Solution

by:
tma050898 earned 100 total points
Comment Utility
Hi Jinsong,

Here's my resubmittal of the answer that you requested...

According to the documentation, SQLProcedures will ONLY return rows for procedures that have at least one argument. ODBC considers procedures that take zero arguments to be views and not procedures.

Tom
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
repeatSeparator  java  challenge 13 56
maxBlock challenge 30 99
matchUp  challenge 6 48
noX challenge 17 75
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now