WITH query_name and ODBC

I'm playing around with the WITH query_name clause as in:
WITH FOO AS (SELECT 123 AS BAR FROM DUAL) SELECT * FROM FOO
I'm facing a curious issue. This query runs fine in SQL Developer and it runs fine from PHP if I use the OCI8 functions. However, it doesn't run from PHP using ODBC functions: odbc_exec() gives no error but all function calls that fetch rows, such as odbc_fetch_into(), generate a warning ("No tuples available at this result index") and no rows or columns.
But I face no problem if I enclose everything in a plain SELECT:
SELECT * FROM (
     WITH FOO AS (SELECT 123 AS BAR FROM DUAL) SELECT * FROM FOO
Does the WITH clause convert a query into something that needs special handling? Is it an issue with the ODBC driver?
I haven't been able to find anything relevant in Google, apart from learning that it seems to be an ODBC issue and not Oracle specific.
I connect to Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 from Windows Server 2003 using PHP/5.2.6. (No access to Metalink or
Oracle support, though, it's a customer site.)

Actually, Dominic Brooks helped me with that a while back. You don't want the enclosing parentheses because it can throw odd errors, even in SQL*Plus. It's in this old post of mine here:
http://blog.mclaughlinsoftware.com/2008/10/19/inline-views-table-fabrication-and-the-with-clause/
As to differences on the parser between ODBC and OCI8, I'm not certain but believe that they use the same parser. To the best of my knowledge there are only two parsers (actually three but the other is old and only used by the Applications Division for their adpatch utility). There's the SQL parser and the PL/SQL parser. However, if somebody knows more, please chime in with the details.

Similar Messages

  • Oracle9i with ASP and ODBC

    i am working in a web project with ASP connecting to Oacle 9i installed on windows 2000, Pentium 4 processor on an NTFS partition.
    After installing oracle 9i, to create a new user, i was unable to logon to oracle as SYSDBA using username: system , password: manager
    having an error massage stating "ORA-01031:insufficient privileges"
    i was only able to connect as Normal
    although i set full control NTFS permissions to the whole partition.
    after creating the new user (from system, manager as normal) and giving the new user ROLES as (DBA, Connect, Resource)
    i tried to connect to oracle using ASP with ADO but the
    connection failed although i tried using Visual basic and ODBC and it worked
    so the problem now is that i can't connect to oracle in ASP
    can anyone help me?

    I'm having a bit of difficulty understanding exactly what you're saying here, so I apologize if I misunderstand...
    Are you trying to use ASP to connect to the database with the SYSDBA privilege, or are you trying to use ASP to connect to the database with a normal user? I believe you are trying to do the latter, that it is working in VB, but not in ASP. Are you getting an error when you connect via an ASP page? What error are you getting?
    Frequently, the problem is that the IIS user(s) don't have read/execute access to the %ORACLE_HOME% directory and subdirectories. I am not sure if you're indicating that you granted yourself full access or the IIS user full access to the partition.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Beginners Assistance with StarOffice and ODBC connections

    Hello,
    I apologize before hand for this VERY newbie question.
    One of the last hurdles to overcome in our company to deploying StarOffice, is the use of MANY refreshable Excel files that pull data from SQL servers. How do I get StarOffice to use these ODBC connections? I have tried creating a new database file, but this does not point me to the correct database on the SQL server. I really could use some help, or handholding, through this process.
    Thank you

    Hi Paul
    I am trying to get the 32 bit drives to work connected to a SQL remote database and I get the following error
    GeneralError:Operation failed.......Index is out of bounds
    I am using a simple script to clone the datasource so a drop down can bring up the other row values
    The lines that it is failing on is
    while (xfa.sourceSet.nodes.item(nIndex).name != "DataConnection2"){ nIndex
    ++; }
    worked fine in Vista, but not windows 7 (using 32 bit drivers)
    Any suggestions?

  • Interactive Analysis Desktop in use with PostgreSQL DB and ODBC

    Hello, is it possible to use the Interactive Analysis Desktop with commercial databases? Specifically, PostgreSQL? But it would also be helpful to use with MySQL and MS SQL.
    If so, would it be possible to connect using ODBC or DSN? Please let me know.

    You need to use bind variables.
    Define a PHP variable for master key. Parse the following anonymous PL/SQL block:
    begin
      get_unique_master_key('DEMO','CMPL','SK','DWMT_TABLE', ? );
    end;Bind the PHP master key to the bind variable. Execute.
    Bind variables are input and/or output variables. In this case, you want to use it as an output variable in order to receive the master key value from the PL/SQL call.

  • Call stored procedure(with parameters) via odbc

    In my application I like to use the below statement to call a stored procedure with parameter and return a result set.
    {CALL PP.getPerson('daniel')}
    but this will just return errors to my application.
    If I change the statement to:
    {CALL PP.getPerson(?')}
    and bind a parameter and its value, it will work.
    My question is, is it possible to call a stored procedure via ODBC without binding parameters in application? I mean, what will be my SQL equivalent if I don't want to do parameter binding in my application?
    Thanks in advance. I appreciate any help :-)

    hi 
    Please see the e.g bellow
    create proc proc_test(@SchoolNumber int,@SchoolName
    varchar(100),@StudentNumber int, @StudnentName
    varchar(100)output ,
    @StudentAddress varchar(100) output,
    @Studentbirthdate datetime output,
    @StudentPhoneNumber varchar(100) output,
    @GuardianName varchar(100) output)
    as
    begin
    select @StudnentName varchar=StudnentName ,
    @StudentAddress =StudentAddress,
    @Studentbirthdate =Studentbirthdate ,
    @StudentPhoneNumber =StudentPhoneNumber,
    @GuardianName =GuardianName
    from table where schoolno=@SchoolNumber
    and SchoolName=@SchoolName
    and StudentNumber=@StudentNumber
    return
    end
    http://technet.microsoft.com/en-us/library/ms187004(v=sql.105).aspx
    http://www.lynda.com/SQL-Server-tutorials/Using-input-output-parameters/104964/113058-4.html
    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

  • Unable to connect to my Oracle Database with Microsoft's ODBC for Oracle driver

    I am unable to connect to my Oracle Database with Microsoft's ODBC for Oracle driver vers.2.573.4202.00 on a Win98 computer.
    First, I create a "Net Service Name" in order for the ODBC Driver to find the Oracle server. I then created a System DSN in the ODBC Data Source Administrator and assigned the "Net Server Name" as the server in the "Microsoft ODBC for Oracle Setup". But when I test this DSN with Oracle's provided "Oracle ODBC 32Bit Test vers.2.5.3.1.0" I get an error:
    SQLSTATE: NA000
    Native Error Code:0
    Driver Message:[Microsoft][ODBC driver for Oracle][Oracle]
    This error occurred on all three Win98 computers I have tried. It does however, seem to work fine on WinNT 4.0, and believe it or not, on the two Win95 computers I have tried.
    Does anyone have any fixes, recomendations, or advice?
    Thank you,
    Eric Edwards
    null

    Why are yu not using the Oracle ODBC driver - these can be downloaded from OTN.
    Have you set up a tnsnames.ora entry for the Oracle database you want to connect to? Does this name have a domain name added to it? Check %ORACLE_HOME%\network\admin\tnsnames.ora for the service name. If it is a name of the form :
    name.domain.subdomain
    then you should try using this full name when configuring the ODBC data source.
    null

  • Office 365 Pro Plus and ODBC issue

    Hi,
    ODBC connection works with Office 2013 standard but when Office 365 Pro Plus is loaded on the same machine after removing 2013 standard the odbc connection does not work.
    Microsoft query does show the database but when we try to connect the message comes up saying microsoft not working. When I did a odbc trace the log showed error fault 1000 in mso.dll
    Have tried the threads on 365 and odbc issues but none of these work.
    Grateful if could get some assistance on this.
    Kind regards,
    Tom  

    Hi George,
    We have tried in safe mode with no success.
    This is the log error message we get
    Event ID: 1000
    Log Name: Application
    Source: Application Error
    Faulting application name: MSQRY32.EXE, version: 15.0.4543.1000, time stamp: 0x5203294c
    Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
    Exception code: 0xc0000005
    Fault offset: 0x2073776f
    Faulting process id: 0x3e48
    Faulting application start time: 0x01cef5fa16b66049
    Faulting application path: C:\Program Files\Microsoft Office 15\root\office15\MSQRY32.EXE
    Faulting module path: unknown
    Report Id: 55964aa9-61ed-11e3-b442-91ada38bdb98
    Thanks,
    Tom

  • Bad perfomance with oo4o and vb 6.0

    i have start the same select question in odbc (with acccess) and vb with oo4o in odbc it took 2sec in vb 2 min!
    for example: this one (in vb) is fast
    select * from persons where tin=:tin
    but this one very slooow
    SELECT t.item_no_val FROM PERSONS PER_PAID,SUBM_TAX_FORMS SBF,TAX_ITEM_VALUES T WHERE PER_PAID.LPRN=SBF.LPRN_PAID AND sbf.drn = t.sbf_drn AND SBF.TF_FORM_CODE = 'PIT-37'AND sbf.dec_status = 'Z' AND sbf.tax_year = 2002 AND t.tfi_item_no = '101' AND sbf.complete_ind in ('W','S') AND T.SBF_DRN = SBF.DRn and per_paid.tin=:tin
    but in access (odbc) i have answer fast

    Try changing the optimiser goal for the session with
    db.ExecuteSQL "ALTER SESSION SET OPTIMIZER_GOAL = FIRST_ROWS"
    Try FIRST_ROWS and the other option(s).

  • When you change PC how to make connection with iphone and new PC

    when you change PC how to make connection with iphone and new PC

    Yes, you can do it the same as any other database. The code would be similar.
    I'd also suggest you not to use the JDBC ODBC bridge for connection. There are other drivers available for that.
    Regards
    xH4x0r

  • With query_name into ...

    Hello! 
    Can we use result of
    with query_name ...
    to insert dataset into some table ?
    Please kindly explain
    I'm usung 11.2.0.3
    Thanks and regards,
    Pavel

    A simple example:"
    SQL> create table t (n1 number, n2 number);
    Table created.
    SQL> insert into t
      2  with query_name as ( select level
      3                       ,      level*100
      4                       from   dual
      5                       connect by level <= 3
      6                     )
      7  select *
      8  from   query_name;
    3 rows created.
    SQL> select * from t;
            N1         N2
             1        100
             2        200
             3        300
    3 rows selected.

  • TNS and ODBC via ADO

    Hallo ,
    I'm trying to connect with VB 6.0 SP3 and SP4 on NT4.0/Win98 to an Oracle 8.1.5 on NT4.0 using client of 7.3.4 and 8.1.5 via TCP/IP.
    Establishing a connection is normally no problem. But after some transactions the connection is lost. The following errors occur:
    Fatal OSN connect error 12203, connecting to:
    (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle80)(ARGV0=oracle80ORCL)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')))(CONNECT_DATA=(SID=ORCL)(CID=(PR OGRAM=VB6.EXE)(HOST=BENNE_MOB)(USER=benne))))
    VERSION INFORMATION:
    TNS for 32-bit Windows: Version 2.3.4.0.0 - Production
    Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 2.3.4.0.0 - Production
    Time: 14-FEB-01 21:07:13
    Tracing not turned on.
    Tns error struct:
    nr err code: 12203
    TNS-12203: TNS: Ziel nicht erreichbar
    ns main err code: 12560
    TNS-12560: TNS: Protokolladapterfehler
    ns secondary err code: 0
    nt main err code: 102
    TNS-00102: Fehler beim Zusammenstellen der Schl|sselwort/Wert-Paare
    nt secondary err code: 0
    nt OS err code: 0
    Remember i tried to connect through TCP/IP and the error message is created by BEQ-protocol?! Thats the first thing. This happens which kind of connection I ever use (ODBC with DSN and without; MS or Oracle Driver; OLE DB).
    I think the problem is in the listener of the server or a client parameter for the connection (if I run the programm on the server the error are not there).
    Please help.
    Thanks.
    null

    The Net8 Administrator's Guide has a chapter on Troubleshooting that walks through different ways to resolve the particular errors you're encountering.
    It does appear that your problem may be with the server, so I'd double-check that the listner process isn't dying before I started trying to debug the client.
    Justin

  • Discussion Forum Portlet - Problems with JAVA and UTF8?

    Hi
    I installed the Discussion Forum Portlet successfully. It also seems that almost everything works fine. There's only a problem if I have new posts that include special German characters (Umlaute) like ä, ö, ü or special French characters like é, è or ç. They are saved correctly in the table but if you view the post the characters are not displayed correctly.
    Example
    input: ça va?
    result: ça va?
    I know that there are problems with Java and UTF8 Database. Is there a possibility to change this (bug)?
    Regards
    Mark

    Here's what I got. I don't see anything that helps but I'm kinda new to using SQL and java together.
    D:\javatemp\viddb>java videodb
    Problem with SQL java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver
    ] Syntax error in CREATE TABLE statement.
    Driver Error Number-3551
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in
    CREATE TABLE statement.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
    at videodb.main(videodb.java:31)
    D:\javatemp\viddb>

  • JRE and ODBC Support on Windows7 client enterprise

    Dear Friends
    Any idea wheteher JRE 1.6.1.34 and ODBC is supported using Windows7 Client enterprise.
    Any issue we might face.I know there are some concerns on the ODBC config.
    Regards
    Kam

    Any idea wheteher JRE 1.6.1.34 and ODBC is supported using Windows7 Client enterprise.
    Any issue we might face.I know there are some concerns on the ODBC config.Please see these docs.
    ODBC:
    Considerations Using The Oracle Client With Microsoft Products on 64 bit Windows Operating System [ID 781432.1]
    32-Bit ODBC Driver Not Listed in 64-Bit Microsoft ODBC Administrator [ID 308645.1]
    JRE:
    Recommended Browsers for Oracle E-Business Suite 11i [ID 285218.1]
    Recommended Browsers for Oracle E-Business Suite Release 12 [ID 389422.1]
    Thanks,
    Hussein

  • OLEDB and ODBC 8.1x Silent Installation

    Hi All,
    Wondering if you can help me - I have managed to install the Oracle 8.1x client silently using a response file. I'm having some problems installing OLEDB and ODBC drivers as i can't find an example response file nor do i know what some of the settings should be.
    Could someone provide me with an example rsp file to work with or perhaps help me find a list of settings i should use?
    Thanks
    David

    Does anyone have any idea about this one? - How does everyone else depony these products silently?
    Thanks
    David

  • Is there a way to create a year at a glance with detail and print?

    Is there a way to create a year at a glance with detail and print?

    To do what Dave indicated you need to do, it depends on what version of Acrobat you have:
    Acrobat 8: Advanced > Enable Usage Rights in Adobe Reader
    Acrobat 9: Advanced > Extend Features in Adobe Reader
    Acrobat 10: File > Save As > Reader Extended PDF > Enable Additional Features
    Acrobat 11: File > Save as Other > Reader Extended PDF > Enable More Tools (includes form fill-in & save)
    I wonder what it will be next time?

Maybe you are looking for

  • How to connect laptop to TV question.

    I have a dv6910 model and I want to hook it up to my tv to play movies.  I see the s-video port but what do I do for sound?  Do I use the headphone jack on the laptop?  Thanks.

  • Unusual problem with my order. Help.

    I have three lines on my plan.  On June 17th I ordered two HTC Incredible for my better half and I (Mom likes her flip phone). June 30th I found out about the Droid X coming soon, so I went to my local store and asked them to cancel the Incredible fo

  • System not listed in url iview property

    hi all, I am creating an URL iview. In property editor of the URL iview I cannot see not even one system listed. I checked the system, its permission, it does have end user permission. Can anyone help me to view the system in the url iview property.

  • I want to learn MDM, i have good knowledge in SAP BI.

    Hi All, Please answer my below questions 1 )  MDM has Coding or do we have only navigation. 2 )  Is programming knowledge is essential for MDM. 3 )  How is the future for MDM. Thanks in advance. Regards, Nithi.

  • Exporting video in Encoder from Premiere locks up at very end

    I'm new to Premiere and Media Encoder, but for the past two days, I've tried multiple times to edit a video in Premiere and export the trimmed video via the Encoder "Queue" option.  The big problem comes at the end of the process, where the status ba