DG4ODBC MSSQL query works in sql, but won't compile in PL/SQL.

I'm using DG4ODBC from 11g to query a SQL Server database. The query I'm using works in a SQL DEveloper SQL worksheet and sqlplus, but won't compile in a PL/SQL procedure.
The query is
  INSERT
  INTO crm_labels
      accountid,
      label_name,
      cir_labelcode,
      cir_knownasname,
      cir_countryidname,
      parentaccountidname,
      cir_customertypecode1,
      cir_customertypecode2,
      cir_dealstatus
  SELECT "AccountId",
    REPLACE("Name",chr(0)) label_name,
    REPLACE("Cir_labelcode",chr(0)) ,
    REPLACE("Cir_knownasname",chr(0)),
    REPLACE("cir_countryidName",chr(0)),
    REPLACE("ParentAccountIdName",chr(0)),
    "Cir_customertypecode1",
    "Cir_customertypecode2",
    "Cir_dealstatus"
  FROM "dbo"."Account"@crmsvc
  WHERE "Cir_labelcode" IS NOT NULL;The error message is
Error(1): ORA-04052: error occurred when looking up remote object dbo.Account@CRMSVC ORA-01948: identifier's name length (34) exceeds maximum (30)I'm guessing that it is attempting to describe additional columns in the Account table.
If I remove the dbo,
  FROM "Account"@crmsvcI get
Error(1): ORA-04052: error occurred when looking up remote object PUBLIC.Account@CRMSVC ORA-00604: error occurred at recursive SQL level 1 ORA-28500: connection from ORACLE to a non-Oracle system returned this message: [Microsoft][ODBC SQL Server Driver][SQL Serve which is less than helpful. However, if I try to use the same query to create a materialized view, I get.
SQL Error: ORA-04052: error occurred when looking up remote object PUBLIC.Account@CRMSVC
ORA-00604: error occurred at recursive SQL level 1
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Address1_TimeZoneRuleVersionNu'. {42S22,NativeErr = 207}[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Address1_UTCConversionTimeZone'. {42S22,NativeErr = 207}[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Address2_TimeZoneRuleVersionNu'. {42S22,NativeErr = 207}[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Address2_UTCConversionTimeZone'. {42S22,NativeErr = 207}[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Pias_NewLabelInDealNotificatio'. {42S22,NativeErr = 207}
ORA-02063: preceding 2 lines from CRMSVCwhich seems to confim that in some circumstance, oracle will attempt to parse more than was asked for.
Any work arounds?
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
DG4ODBC is also 11.2.0.3

The gateway claims about this column "Address1_TimeZoneRuleVersionNu" which is not listed in your select list.
When a gateway connection is established it first checks out all columns of the table you want to select to determine the data types and then it fetches the data for the columns you want to select. But there's also an exception - when you use functions the gateway is not able to translate into the syntax of the foreign database. in this case ALL columns will be fetched into the Oracle database and the result is processed locally (post processing).
You're using replace function which won't be mapped to the foreign database equivalent using DG4ODBC so it will post process the result and fetch from all columns all the data into the Oracle database. Your table contains a column which exceeds the 30 character limitation of Oracle, hence the select will fail.
The only work around is to create a view on the foreign database side which reduces the column name length to 30 characters or less.

Similar Messages

  • Drives stopped mounting with FW800, but FW400 is OK. Worked OK before, but won't now. Tried new cables, zapping pram, Disk Repair Utility. Any suggestions? Thanks.

    Drives stopped mounting with FW800, but FW400 is OK. Worked OK before, but won't now. Tried new cables, zapping pram, Disk Repair Utility. Any suggestions? Thanks.

    If your external drive does not have an independent power supply, you may wish to consider a couple of lower-cost options before tossing the drive. Bus-powered drives have no external power source and must get all their power from the computer. They can exceed the computer's USB energy budget.
    Cheapest option:
    1 Meter USB 2.0 A to 5 Pin Mini B Cable - Auxiliary USB "Y" Power Design for external hard drives.
    This gets power from two of the computers USB porst sna can provide enough power to wake up an under-performaing bus-powered drive.
    If you don't have enough ports to use this, try the next cheapest option:
    Newer Technology 7 Port Hi-Speed USB 2.0 Hub with Power Adapter for Mac & PC
    Such a hub has a an independent power supply to make up for wahat the comptuer fails to provide.

  • My external hard drive works on PC but won't even show up on my mac?

    My external hard drive works on pc but won't even show up on my mac? What can I do?

    If it is in the wrong format it must probably still show up though, if your mac does detect it, go to disk utilities> choose the device from the left hand side > go to the "erase" tab and change format to "Mac OS extended (Journaled) then hit "erase".
    IMPRTANT! : this will erase ALL of the files on your external hard drive
    If this dosent work, make sure your external hard drive's USB port is compatibe with both USB 2.0 and 3.0 and also make sure your mac USB socket isnt damaged either.
    Hope this helped

  • Just hooked up airport extreme. works on mac but won't allow phone or iPad on. how do i get them to connect?

    just hooked up airport extreme. works on mac but won't allow phone or iPad on. how do i get them to connect?

    How old are the various devices? It could be possible for you to have configured a very new AirPort Extreme in a way that older iPhones and iPads could not access. For example, could you have set up the Extreme to use only 801.11n and 5GHz?

  • SQL query works for Access but not mySQL

    *I'm using the Database Connectivity VIs* Can anyone give me a clue as to why the following query works with an MS Access File DSN but not a mySQL File DSN:
    SELECT * FROM (SELECT * FROM WP100598 WHERE SerialNum LIKE '311022-05%' OR SerialNum LIKE '311022-07%') WHERE UTCTime > 1090882800 AND UTCTime < 1092870000 ORDER BY SerialNum desc
    Thank you, your help is much appreciated

    Hi,
    I don't think MySQL supports nested queries.
    Regards,
    Wiebe.
    "optobionics" wrote in message
    news:[email protected]..
    > *I'm using the Database Connectivity VIs* Can anyone give me a clue
    > as to why the following query works with an MS Access File DSN but not
    > a mySQL File DSN:
    > SELECT * FROM (SELECT * FROM WP100598 WHERE SerialNum LIKE
    > '311022-05%' OR SerialNum LIKE '311022-07%') WHERE UTCTime >
    > 1090882800 AND UTCTime < 1092870000 ORDER BY SerialNum desc
    > Thank you, your help is much appreciated

  • Query works in Report but not during Edit session

    I have a report based on an SQL query, and it works perfectly from the menu in Development. It's also in Test and Production, and it works there, too. I want to change the template it's on, so I went in through the Navigator to open up and change the report. The Edit session opens up to the query, but I cannot move to any of the other tags, because it says the query is "not valid".
    It won't allow me to save the query 'as is', because it supposedly isn't valid. The report isn't locked, and prior versions (I went back to view five of them) have the same trouble. How can the query work off the menu, but not be 'valid'? We installed a patch recently, but even so, why would the query work in one spot and not another?
    Anyone have any ideas on what I can do?
    Pat Murray

    Hi,
    Please give me the query and the error the error you are getting.
    Thanks,
    Sharmila

  • Query works in preview, but not when added under a Query Group

    Hello Experts-
    I'm trying to use this query as one of the options under the drop down on the Supplier Search under the Supplier Management.
    Error message:
    while trying to invoke the method com.sap.odp.comp.query.QueryParamValue.getPromptParamDef() of a null
    object loaded from local variable 'paramValue' while trying to invoke the method
    com.sap.odp.comp.query.QueryParamValue.getPromptParamDef() of a null object
    loaded from local variable 'paramValue'
    The query itself is complicated, but it works fine when executed under preview.
    Wondering if any one has ever seen this behavior and knows of any typical causes?
    Thanks,
    Mike

    Thanks for the offer, Vignesh.
    Sorry, I'm currently having trouble duplicating it, but next time it happens I'll try to get some screenshots.
    I have narrowed it down to blank values in optional string fields when the query loads. I fixed (kind of) the ones I was having trouble with by rearranging the filter parameters so there would not be blanks.
    Thanks again,
    Mike

  • Query works in Access but not CF

    I wrote this query initially in access to extract the data I
    wanted out of my table. In MS Access, the query works fine, returns
    the desired data. When I run the query from my CF page, i get the
    following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Too few
    parameters. Expected 2.
    Can anyone tell me why? Below is my query

    As the IIF function is a valid CF function, it may not be
    getting passed as 'plain text' to Access, instead CF
    may be attempting to compile the function and pass the
    result. If you can turn on debugging and for a short time set it to
    include the SQL being passed in error messages, you can see what is
    really going on.
    Another option is to create/save the query in the Access
    database and reference that instead of a table in your CFQUERY
    call. Since you are just running a staright query and not passing
    anything from CF (unless I am mistaken), calling the Access query
    for your results would work fine.
    <CFQUERY ...>
    SELECT * FROM myQueryName
    </CFQUERY>
    HTH,
    CR

  • XPath query works with CLOB but not with object relational

    hi all
    i have the following queries,the XQuery work with all, but XPath queries work with XMLType CLOB and Binary XML, but they do not work with XMLType as Object relational,
    select extract (object_value,'movies/directorfilms/films/film [studios/studio = "Gaumont"]')
    from xorm;
    select extract (object_value,'movies/directorfilms[director/dirname = "L.Cohen"]/films/film[position()=2]/t')
    from xorm;
    they shows this message
    ORA-00932: inconsistent datatypes: expectd SYSTEM.name683_COLL got CHAR
    thanks

    Hi Marco
    fisrt here is my RO
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL=>'http://......../ORMovies.xsd',
    SCHEMADOC=>bfilename('DB','Movies.xsd'),
    LOCAL =>false,
    GENTYPES=>true,
    GENTABLES=>FALSE,
    CSID=>nls_charset_id('AL32UTF8'));
    END;
    create table XORM of xmltype
    xmltype store as object relational
    XMLSCHEMA "http://......../ORMovies.xsd"
    ELEMENT "movies";
    INSERT INTO XORM
    VALUES(XMLType(BFILENAME('DB','ORMovies.xml'),nls_charset_id('AL32UTF8')));
    here the XQuery format that work fine with the OR
    A/D
    select XMLQuery ('for $a in movies/directorfilms/films/film
              where $a/studios/studio = "Gaumont"
              return $a'
         passing object_value
         returning CONTENT)"TitleX"
    from xorm;
    child element query
    select XMLQuery ('for $a in movies/directorfilms/director[dirname = "Feyder"]
              let $b:=$a/../films/film[position()=2]
              return $b/t'
         passing object_value
         returning CONTENT)"TitleX"
    from xorm;
    here is the XPath format which doesn't work
    select extract (object_value,'movies/directorfilms/films/film [studios/studio = "Gaumont"]')
    from xorm;
    select extract (object_value,'movies/directorfilms[director/dirname = "Feyder"]/films/film[position()=2]/t')
    from xorm;
    by the way all queries work fine with the CLOB or Binary XML
    many thanx Marco

  • Query working from sqldeveloper but not from aspx

    Hello,
    Well Im working on an application that has different queries that involve characters such as áéíóú // ÁÉÍÓÚ // ñÑ. Now the problem is that the query works just fine coming from sqldeveloper or toad but when it's called from an aspx file it returns no rows. Any idea why this might be? It only happens when the query has at least one of the above mentioned characters.
    Here you can see an example:
    SELECT DISTINCT N_DOCUMENTO FROM PROCESOS_METODOLOGIAS WHERE "LINEA DE NEGOCIO" = 'PRODUCCIÓN' AND N_DOCUMENTO IS NOT NULL ORDER BY N_DOCUMENTO ASC;I managed to "bypass" it by using LIKE for the time being
    SELECT DISTINCT N_DOCUMENTO FROM PROCESOS_METODOLOGIAS WHERE "LINEA DE NEGOCIO" LIKE '%PRODUCCI%' AND N_DOCUMENTO IS NOT NULL ORDER BY N_DOCUMENTO ASC;But I'm sure there's a solution for that. Any hints would be greatly appreciated.
    PS: Query from aspx is made with reference 10g to version 11g on server.

    Just as I finished osting this, I found out that the problem was ust that, working with the 10g reference on the 11g server version. in case anyone needs that...

  • Safari won't work (bookmarks select but won't unselect)

    My problem is that when I click on any bookmark in Safari, such as those in my Bookmarks Bar, the page stays blank/white, and the bookmark stays with a permanent grey oval around it, as thought it was selected, but won't unselect when you let go of the click. I can go through the menus and select any command, and can bring up the Downloads window for instance. So it is not completely unresponsive, but it won't actually browse the web. I can try to open a file, but when I get to the open dialog, it won't let me select anything. This happens in all users accounts, and was not corrected by resetting Safari, or by trashing the Safari cache, or trashing prefs, or repairing permissions, or even running single use mode to repair the directory. Firefox works fine, so it is not as network problem. Any ideas?

    Since this happens to all user accounts, there are two paths you can try.
    Path one - reapply the 10.4.8 combo update. "Repair permissions" using Disk Utility in your Utilities folder after the install/restart. I suggest not using the computer during the Install phase.
    Sometimes the reinstall corrects system files which may be corrupted and affecting Safari.
    If no go, then
    Path two - Reinstall Safari. Have a look at this Apple article for installing other software, including Safari, from the Tiger DVD - see the section titled More custom reinstallation options with Mac OS X 10.4.
    You'll need to move Safari.app in your applications folder to the trash. Also, in your HD>Library>Receipts folder, move the Safari.pkg file to the trash.
    As a precaution, prior to reinstalling Safari, move your Safari Folder, found in your User Library to the Desktop. It has your bookmarks, history etc. Once the reinstall is completed, move the folder back to its original location writing over the newly created folder.
    Remember too, the version of Safari you install will be specific to the Version on your installer DVD. Therefore, either run Software Update and see if Safari is updated. If not, you can reapply once again the 10.4.8 combined update. Repair permissions when you are finished.
    Post back.

  • Popups work in preview but not in compiled help

    Hello,
    I am using Robohelp 8 and have been having problems displaying popups in my compiled help. When I view a topic that contains popup links in the WYSIWYG, I can preview the popup topics with no problem, but when I compile and click on a link that contains a popup, nothing happens. I get a warning in the bottom of the browser window that says "Error on page" with no further details. Is there a setting somewhere that I need to adjust. I have never had this problem before.
    Thank you in advance for any input.
    Adrienne

    Hi there
    The popup functionality depends on the ehlpdhtm.js file. Years ago I had a large project where popups broke in topics that were heavily buried in a deep folder structure. I managed to make them work by amending the path to the js file so it was shorter. This also meant I had to copy the js file to the folder where the popups were broken.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Internet won't connect. Works on iPhone but won't open on MacBook

    The internet won't connect, I get an exclamation point on my icon. My two iPhones connect ok but I can't get my Mac book to connect.
    How do I check, my diagnostics say I should call my provider but the other devices work great.

    The IP address starting with 169 is self-assigned and means that your router is not giving your iPod Touch an IP address via DHCP. In this condition you will not be able to access the Internet.
    You might try powering down and restarting your router and see if the problem is corrected (your IP address should be something like 192.168.1.x and you should see an address for the router, DNS, etc.). Reset the network settings on your iPod before attempting to connect.
    If this doesn't solve your problem test your iPod on another network (Starbucks, Borders, etc.). If it works there then you may need a new router. If it does not work on other networks your iPod may need repair.
    By the way, your problem is different from the OP.

  • Coldfusion query works in cfm but not cfc

    I have the following query that works just fine in cfm file but cannot seem to get to work in a coldfusion cfc. Any ideas.
    Select distinct include.value from xxxxx.authorprofile,
    table(authorprofile.uidinclude) include where profilename='#selectedProfile#'

    No Oracle version
    No Cold Fusion version
    No explanation of what either CFM or CFC means
    My recommendation would be that you ask the people that sold you the tool. It is, after all, their product that is the issue.

  • Multi Value PS Query Works in v2, but not v3 or 4

    I have been using the query below (and others like it) for a few years, but it didn't work on v3, and now it doesn't work on v4--which is supposed to be backwards compatible.
    Get-ADUser test01 –properties memberof, DisplayName, employeeID | Select-Object SamAccountName, DisplayName, employeeID, @{label="Groups";Expression={[string]::join(";", ($_.memberof))}} | export-csv -notype -force c:\filepath\filename.csv
    I must invoke PS with the -version 2 suffix to run it.  Any ideas?
    Thanks!

    Hi,
    Here's the adjustment I'd make:
    Get-ADUser testac1 -Properties memberOf, DisplayName, employeeID |
    Select-Object SamAccountName, DisplayName, employeeID, @{label="Groups";Expression={ ($_.memberOf | % { Get-ADGroup $_ }).Name -join ';' }} |
    Export-Csv -NoTypeInformation -Force c:\filepath\filename.csv
    EDIT: Another option:
    Get-ADUser testac1 -Properties DisplayName, employeeID |
    Select-Object SamAccountName, DisplayName, employeeID, @{N='Groups';E={(Get-ADPrincipalGroupMembership -Identity $_.SamAccountName).Name -join ';'}} |
    Export-Csv -NoTypeInformation -Force c:\filepath\filename.csv
    http://ss64.com/ps/get-adprincipalgroupmembership.html
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

Maybe you are looking for