I am successfully using BCI connect from Unidata 6. See code example : Note - when I compile I need to use the -I option.
029: * use Unidata Connect to get data from Siebel 030: $INCLUDE DEMOINCLUDE ODBC.H 031: 032: * setup connect parameters 033: datasource="SIEBELTEST" 034: username="SIEBEL_READ_ONLY" 035: passwd="PASSWORD" 036: STATUS = SQLAllocEnv(database.env) 037: * 038: MODULE = "ESTABLISH.BCI" 039: ENVTYPE = "Database" 040: Fn = "SQLAllocEnv" 041: GOSUB CHECK.STATUS 042: * 043: * Step 2 - Allocate Connection Environment 044: * 045: * 046: STATUS = SQLAllocConnect(database.env,connection.env) 047: * 048: ENVTYPE = "Connection" 049: fn = "SQLAllocConnect" 050: GOSUB CHECK.STATUS 051: * 052: * 053: * ---------------------------------------------------------------- 054: 055: * Step 3 - Connecting to Database 056: * 057: * 058: STATUS = SQLConnect(connection.env, datasource, username, passwd) 059: * 060: ENVTYPE = "Connection" 061: GOSUB CHECK.STATUS 062: * 063: ALLOC.STATEMENT.ENV: 064: * 065: * --------------------------------------------------------------- 066: 067: * Step 4 - Allocate Statement Environment 068: * The Statement Environment is used when executing SQL 069: * statement functions 070: * 071: * 072: STATUS = SQLAllocStmt(connection.env,statement.env) 073: * 074: MODULE = "ALLOC.statement.env" 075: Fn = "SQLAllocStmt" 076: ENVTYPE = "Connection" 077: GOSUB CHECK.STATUS 078: 079: SQLSTATEMENT="SELECT ROW_ID AS ACCNT_ROW_ID, NAME AS ACCOUNT_NAME, LOC AS ACCOUNT_LOC FROM SIEBEL.S_ORG_EXT WHERE X_BTS_BUSINESS_UNIT = 'Financial Servic es' AND X_BTS_SECTOR = 'Trading Systems'" 080: 081: STATUS = SQLExecDirect(statement.env, SQLSTATEMENT) 082: 083: STATUS = SQLNumResultCols (statement.env, cols) 084: 085: DIM SQLDATA(cols) 086: FOR NUMCOL=1 TO cols 087: SQL.STATUS = SQLBindCol(statement.env,NUMCOL,SQL.B.DEFAULT, SQLDATA(NUMCO L)) 088: NEXT NUMCOL 089: 090: STATUS = 0 091: Fn = "SQLFetch" 092: ENVTYPE = "Statement" 093: 094: LOOP *--: P 095: WHILE STATUS <> SQL.NO.DATA.FOUND DO 096: * 097: * 098: STATUS = SQLFetch(statement.env) 099: * 100: GOSUB CHECK.STATUS 101: IF STATUS <> SQL.NO.DATA.FOUND THEN 102: FOR NUMCOL=1 TO cols 103: CRT SQLDATA(NUMCOL):" ": 104: NEXT NUMCOL 105: CRT 106: END 107: REPEAT 108: * 109: ENVTYPE = "Statement" 110: GOSUB CHECK.STATUS 111: 112: 113: * that it, discount from the server 114: STATUS = SQLFreeStmt(statement.env, SQL.UNBIND) 115: STATUS = SQLFreeStmt(statement.env, SQL.DROP) 116: STATUS = SQLDisconnect(connection.env) 117: STATUS = SQLFreeConnect(connection.env) 118: STATUS = SQLFreeEnv(database.env) 119: CRT "Finished" 120: STOP Graham Forbes Trading Systems BT Consulting & Systems Integration tel: (+44) (0)20 7777 7176 mob: (+44) (0)77407 38550 web: www.bt.com/consulting -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 15 January 2005 20:16 To: [email protected] Subject: RE: [U2] unidata bci commands not compiling There's never any harm in stating the obvious. People should do it more often. My problem is on unidata, not universe, so there is no UNIVERSE.INCLUDE or BCI.H (mentioned in another response). There's an ODBC.H in INCLUDE though, and unfortunately I've already included it and successfully used equates from it in other bci functions. No help there. The compiler still seems to think I'm referencing an unDIMed array with too many dimensions. There's a sample program in the back of the unidata bci manual (available at http://publibfi.boulder.ibm.com/epubs/pdf/25124330.pdf), and on page B-8 they demonstrate the SQLBindParameter function. Apparently the code printed in the manual was never entered into a real computer and tested, because there is no closing parenthesis on the function call (on any one of the four examples). I also get the same result using the unidata PE on redhat. I think that's version 6.0 as well. Is there anyone out there who has ever used SQLBindParameter on unidata 6.0, or on any version of unidata? > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of David Jordan > Sent: Friday, January 14, 2005 11:47 PM > To: [email protected] > Subject: RE: [U2] unidata bci commands not compiling > > > Hi > > It might be stating the obvious, but it has caught me once or > twice, did you include $INCLUDE UNIVERSE.INCLUDE ODBC.H at > the beginning of the program. > > I have used this in UniVerse for years, the problem maybe > using a wrong parameter code. The following is from some of my code > > ST=SQLBindParameter(STMTENV,1,SQL.B.BASIC,SQL.CHAR,0,0,CLIENT. > NO,SQL.PARAM.I > NPUT) > > Hope it gives you some ideas to try. > > Regards > > David Jordan > > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Ed Clark > Sent: Saturday, 15 January 2005 8:58 AM > To: [email protected] > Subject: [U2] unidata bci commands not compiling > > I'm attempting to use BCI on unidata 6.0 under hpux on a > pa-risc box. The simple commands work--I can open and close > connections and statement handles and execute statements that > affect remote databases. However, when I attempt to do > something more complicated and efficient--use > SQLBindParameters--the statement will simply not compile. I > can make a call to SQLPrepare, but the SQLBindParameters > function apparently doesn't exist in my version of unidata. I > have also tried the documented synonym SQLSetParam with the > same result. The compiler thinks I'm referencing an array > with too many dimensions, as the following compiler output shows: > > main program: syntax error at or before > <line 19> ST=SQLBindParameter(STMT.HANDLE,1,0,SQL.NUMERIC,0,0,0) > -----------------------------------^ > Expecting: > array,string,number,function,variable,OR,AND,!,>,>=,<,<=,=,<>, MATCH,CAT,:,+, > - > > Has anyone else experienced this? > ------- > u2-users mailing list > [email protected] > To unsubscribe please visit http://listserver.u2ug.org/ > ------- > u2-users mailing list > [email protected] > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ******************************************************************** This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.bt.com/consulting ******************************************************************** ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
