OleDbSchema Guid

  • Thread starter Thread starter Trainee
  • Start date Start date
T

Trainee

hi

i am using OleDbSchemaGuid to display the schema information of a database
when i use OleDbSchemaGuid.Procecdures method it returns a data table
containing all procedures as well as functions..

but i am not able to separately get the list of procedures and the list of
functions....i need those details separately...

how do we do it using OleDbSchemaGuid??????

Avinash
 
Hi,

You can create a dataview by applying filter on the resultant datatable
to seperate functions & proedures

eg.

myTable.DefaultView.RowFilter = "PROCEDURE_TYPE = " & DB_PT_PROCEDURE;

DB_PT_UNKNOWN = 1
DB_PT_PROCEDURE = 2
DB_PT_FUNCTION = 3

HTH
Kalpesh
 
can't we specify this procedure_type value in the restriction array.
eg
OleDbGuid.Procedures,new object[]{null,null,null,2}

where 2 is the procedure_type value for procedures

but if i put it this way it throws error saying parameter incorrect

why?????
 
Its lame, but the fourth parameter is expecting a Int16 not an Int32.

OleDbGuid.Procedures,new object[]{null,null,null,(short)2}

http://msdn.microsoft.com/library/d...ry/en-us/oledb/htm/oledbprocedures_rowset.asp

--
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

Trainee said:
can't we specify this procedure_type value in the restriction array.
eg
OleDbGuid.Procedures,new object[]{null,null,null,2}

where 2 is the procedure_type value for procedures

but if i put it this way it throws error saying parameter incorrect

why?????


Kalpesh said:
Hi,

You can create a dataview by applying filter on the resultant datatable
to seperate functions & proedures

eg.

myTable.DefaultView.RowFilter = "PROCEDURE_TYPE = " & DB_PT_PROCEDURE;

DB_PT_UNKNOWN = 1
DB_PT_PROCEDURE = 2
DB_PT_FUNCTION = 3

HTH
Kalpesh
 
hi ashton i am using an oledb provider to connect to any database such as
sql server or oracle so i need a generic way to list the procedures and
functions but what u suggested works well for oracle alone sql does not
support this method????

Mark Ashton said:
Its lame, but the fourth parameter is expecting a Int16 not an Int32.

OleDbGuid.Procedures,new object[]{null,null,null,(short)2}

http://msdn.microsoft.com/library/d...ry/en-us/oledb/htm/oledbprocedures_rowset.asp

--
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

Trainee said:
can't we specify this procedure_type value in the restriction array.
eg
OleDbGuid.Procedures,new object[]{null,null,null,2}

where 2 is the procedure_type value for procedures

but if i put it this way it throws error saying parameter incorrect

why?????


Kalpesh said:
Hi,

You can create a dataview by applying filter on the resultant datatable
to seperate functions & proedures

eg.

myTable.DefaultView.RowFilter = "PROCEDURE_TYPE = " & DB_PT_PROCEDURE;

DB_PT_UNKNOWN = 1
DB_PT_PROCEDURE = 2
DB_PT_FUNCTION = 3

HTH
Kalpesh
 
Hi Mark,

Great work !!
I tried UInt16 for the last parameter & it threw exception related to
Parameters

I didnt dig deep into it further. I thought filtering the datatable
would be simple to do
Anyways, good work Mark

Kalpesh
 
The support of the individual schemas is native OLE DB provider dependent.
The SQLOLEDB provider does support the Procedures schema table.

--
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

Trainee said:
hi ashton i am using an oledb provider to connect to any database such as
sql server or oracle so i need a generic way to list the procedures and
functions but what u suggested works well for oracle alone sql does not
support this method????

Mark Ashton said:
Its lame, but the fourth parameter is expecting a Int16 not an Int32.

OleDbGuid.Procedures,new object[]{null,null,null,(short)2}

http://msdn.microsoft.com/library/d...ry/en-us/oledb/htm/oledbprocedures_rowset.asp

--
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

Trainee said:
can't we specify this procedure_type value in the restriction array.
eg
OleDbGuid.Procedures,new object[]{null,null,null,2}

where 2 is the procedure_type value for procedures

but if i put it this way it throws error saying parameter incorrect

why?????



Hi,

You can create a dataview by applying filter on the resultant
datatable
to seperate functions & proedures

eg.

myTable.DefaultView.RowFilter = "PROCEDURE_TYPE = " & DB_PT_PROCEDURE;

DB_PT_UNKNOWN = 1
DB_PT_PROCEDURE = 2
DB_PT_FUNCTION = 3

HTH
Kalpesh
 
Back
Top