Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Unanswered: Problem in calling sql file from MFC sqlExecdirect for oracle

    Hi,
    I am getting problem while calling the sql file through MFC API SQLExecDirect .

    For example the code is

    RtCode = SQLExecDirect(hstmt, (UCHAR*)"@@update.sql;", SQL_NTS)

    After executing the function it is throwing exceptions
    "[Oracle][ODBC][Ora]ORA-00900: invalid SQL statement"

    pls help me out to solve the problem.

    Thanks



    Thanks,
    Raji.

  2. #2
    Join Date
    Mar 2004
    Posts
    5
    You are actually supposed to specify a SQL statement while using SQLExecDirect. It does not to my knowledge read from a .sql file and then execute the statement.

  3. #3
    Join Date
    Mar 2004
    Posts
    4
    Originally posted by mkmit
    You are actually supposed to specify a SQL statement while using SQLExecDirect. It does not to my knowledge read from a .sql file and then execute the statement.

    If we give @@Update.sql in SQLPLUS, It will run properly without any problem . Is it won't work with SQLExecDirect ??

  4. #4
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas, USA
    Posts
    68
    The @@ syntax is native to SQL*Plus. MFC doesn't understand it. You'll have to find a way to read the SQL statement in the file into a string variable, which you then put in your SQLExec statement.

  5. #5
    Join Date
    Mar 2004
    Posts
    4
    Thanks for the sugesstions !!!! . i'll try in this way .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •