Using OPENROWSET

  • I am using a linked server to access unidata data files. I am having some syntaxal problems with OPENQUERY getting this error message:

    Server: Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near ','.

    My SELECT statement looks like this:

    SELECT L.[DATE],C.* FROM LOGS AS L INNER JOIN OPENROWSET('Ardent.UniOLEDB','PROVIDER=Ardent.UniOLEDB;DATA SOURCE=localud;LOCATION=/path;USER ID=user;PASSWORD=password;',/path','SELECT C.ID,C.NAME1,TERMNUM,A.FAX1 FROM CONTRACTOR_MASTER C JOIN AGENT_MASTER A ON C.TERMNUM = A.TERMINAL WHERE C.CANCEL_DATE = "" AND C.CONT_TYPE = 1 ORDER BY C.ID') As C

    I know the unidata SELECT portion is correct since I tried it using openquery. So if anyone could offer me any type of help that would be appeciated.

    Matt

  • Well I made some progress and got the OPENROWSET syntax correct and it is now looks as follows:

    SELECT L.[DATE],E.* FROM LOGS AS L INNER JOIN OPENROWSET('Ardent.UniOLEDB','localud;user;password;','LOGS') As E on L.contractornum = E.ID

    I converted the unidata select into a view and ran that. Now I am getting a unidata error stating: Invalid parameter length.

    I am guessing the providor does not support this method of grabbing the data but if anyone has any ideas whatsoever, fill free to let me know.

    Matt

  • I found a way to make it work. I used OPENQUERY and linked them together that way and it seems to be working. Don't ask why the other way does not work, I am still at a loss as well as IBM tech support on their buggy uniOLEDB driver.

    Matt

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply