Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie odbc/oracle-procedure-questions
Thanks Rauf!
The user writes sth. like this: "select * from table1". I'll get this
as a string and then pass it via odbc to db, parse the results and send
them back to user. If he wants to call a procedure,
he does for e.g. "proc1(str1,str2,str3,int1)" as a string and forwards
it to me delivering also whether they are in,out or inout. The problem
is this, if I have to bind the parameters and to do this, I need the
information about the types, values, columnposition. I was hoping that
I could achieve these with these:
rc = SQLProcedureColumns(hstmt,NULL,0,(unsigned char
*)colSchemaNamePattern,len,(unsigned char *)"test",len,(char
*)colNamePattern,len); /* all columns */
//colSchemaNamePattern gives NULL. I can't figure out why
SQLSMALLINT numCols,colNameLen,coltype,scale; SQLCHAR colName[50];
rc = SQLNumResultCols(hstmt,&numCols);
//numCols gives 1 here, instead of 4
SQLUINTEGER collen[50] ;
SQLINTEGER displaysize ;
if(rc == SQL_SUCCESS){
for(int i = 1; i < numCols; i++){ //numCols gives 19 - I can't say why (num of columns should be 4 rc = SQLDescribeCol(hstmt, (SQLSMALLINT)i, colName,sizeof(colName), &colNameLen,&coltype, &collen[i], &scale,0);
rc = SQLColAttribute(hstmt, i, SQL_DESC_DISPLAY_SIZE, NULL, 0, NULL,&displaysize);
}
}
I suppose that this is suppose to work, otherwise I do not find other
options.
Are there any?
Must I have to parse the syntax? I only need the information which I
have to push via odbc.
Much regards,
Harp
Received on Fri Feb 18 2005 - 09:06:55 CST