Oracle SQL Query from EXCEL 2007 with prompt

Hello,
I have many excel reports where I am pulling information from our Oracle 9 db through Excel using the following method:
http://blog.mclaughlinsoftware.com/microsoft-excel/how-to-query-oracle-from-excel-2007/
http://blog.mclaughlinsoftware.com/2009/11/30/sql-query-in-excel-2007/
However, I am having trouble when I try the following query due to the prompt:
SELECT
IM.ITEM_GROUP,
IM.ITEM,
IM.DESCRIPTION
FROM
LAWSON.ITEMMAST IM
WHERE
IM.ITEM = '&ITEM';
Does any one know how I can connect a prompt to an excel cell and then pass the query on to Oracle, or have a PL SQL prompt work from Excel?
Thanks,
Ben

The 'prompt' as you call it is a sqlplus feature, so does not belong to the SQL language
You would need to write a stored procedure returning a resultset.
create or replace procedure foo(rc in out sys_refcursor, p_item) as
begin
open rc for
'SELECT
IM.ITEM_GROUP,
IM.ITEM,
IM.DESCRIPTION
FROM
LAWSON.ITEMMAST IM
WHERE
IM.ITEM = '||p_item;
end;
and call that using ODBC or asp.net
Obviously this is profusely documented.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Help with translating SQL query from SQL Server syntax to Oracle syntax

    Hi,
    is it someone that can help me translate following SQL query from SQL Server syntax to Oracle syntax.
    SELECT ID,
    [LMT(MTR)] = MAX(case when TYPE = 'LMT' then VALUE end),
    [AAD(KGM)] = MAX(case when TYPE = 'AAD' then VALUE end),
    [VOL(MTQ)] = MAX(case when TYPE = 'VOL' then VALUE end)
    FROM yourtable
    GROUP BY ID
    Your help is highly appreciated, thanks in advance.

    Like this,
    SELECT ID,
    MAX(case when TYPE = 'LMT' then VALUE end) LMT_MTR,
    MAX(case when TYPE = 'AAD' then VALUE end) AAD_KGM ,
    MAX(case when TYPE = 'VOL' then VALUE end) VOL_MTQ
    FROM yourtable
    GROUP BY ID-Arun

  • Copying SQL Script from Oracle SQL Developer into Excel with formatting

    I need to copy a SQL Script into Excel in order to develop some VBA code. Is there any nice way that I can copy SQL Script from Oracle SQL Developer into Excel and retain its formatting? I am a stickler for having legible, readable SQL and like to have all my columns lined up and aliases lined up. When we used to use SQL Navigator, the tab formatting seemed to copy and paste just fine. Now that we have migrated to Oracle SQL Developer, the formatting seems to get all messed up.
    And suggestions are greatly appreciated and Thanks in advance for your review and am hopeful for an answer.
    Thanks.
    PSULionRP

    I suppose you want a real tabulator instead of spaces. You can configure this in the preferences (SQL Formatter - Oracle). You have to apply it then to your existing code (e.g. CTRL-F7), but new code should get it right from the start.
    Hope that helps,
    K.

  • API to retrieve SQL query from a Webi Document

    Hi,
    Which API can be used to retrieve the Oracle SQL query for a webi report using BO XI web services SDK? The report is connected to a Oracle database in the backend.
    A sample code is greatly appreciated.
    Thanks a lot!
    Liz

    Hi Liz,
    The libraries for the Enterprise and Report Engine SDKs are included with your Enterprise installation and the location will vary with each version:
    XI Release 1 and Release 2
    XI Release 1 (assuming it's installed on C:\):
    - Windows: C:\Program Files\Common\3.0\java\lib
    - Linux/UNIX: (INSTALL_DIR)/java/lib
    XI Release 2:
    - Windows: (INSTALL_DIR)\Business Objects\Common\3.5\java\lib
    - Linux/UNIX: (INSTALL_DIR)/java/lib
    There are quite a few JAR files in this location, but you should only need the following set for Enterprise & REBean with XI Release 1 or XI Release 2:
    From the java\lib directory
    - boconfig.jar
    - cecore.jar
    - celib.jar
    - ceplugins.jar
    - cereports.jar
    - cesession.jar
    - ceutils.jar
    - cexsd.jar
    - corbaidl.jar
    - ebus405.jar
    - jtools.jar
    - keycodeDecoder.jar
    - rebean.common.jar
    - rebean.fc.jar
    - rebean.jar
    - rebean.wi.jar
    - rpoifs.jar
    - Serialization.jar
    - URIUtil.jar
    - wilog.jar     
    From the java\lib\external directory:
    - Concurrent.jar
    - freessl201.jar
    - icu4j.jar
    - jaxrpc.jar
    - jsafe.jar
    - log4j.jar
    - pullparser.jar
    - saaj.jar
    - sslj.jar
    - xbean.jar
    - xercesImpl.jar
    - xml-apis.jar
    BusinessObjects Enterprise XI 3.0
    - Windows: (INSTALL_DIR)\Business Objects\Common\4.0\java\lib
    - Linux/UNIX: (INSTALL_DIR)/java/lib
    You can find a list of required JAR files in the [XI 3.0 Enterprise SDK Developer Guide|https://boc.sdn.sap.com/node/7298].
    Cheers,
    Parin
    Edited by: Parin Patel on Jun 25, 2008 11:03 AM

  • Cannot Save New Document to SP2010 from Excel 2007

    I have two users who cannot save a new file from Excel 2007 to Sharepoint 2010 using the network share path. They receive the following error:
    You cannot save the file you selected. The folder you selected is not an actual file system location. 
    However, other users can save this way with not trouble at all. 
    When they have the Excel file open, they go to Save As... and the window opens. Then they type in the path to the Sharepoint library where they want to save the file: \\intranet\DavWWWRoot\site\library\
    At this point, they should be able to click the Save button and the window will refresh to the Sharepoint library. They would then be able to enter the name of the file and click the Save button again. However, when they click the Save button the first time
    to refresh the window, nothing updates and the path they just typed goes away.
    My first thought was an issue with permissions, but I've checked and double checked that they are in the correct group.
    Then I decided to go even more basic and have them use Windows Explorer to browse to the location. They were able to.
    I then had them right click within Windows Explorer, select New, and click Text Document. Not only were they able to create the new text file, but I confirmed it updated
    the Sharepoint library successfully. So, that obviously rules out any issues with permissions.
    Out of sheer frustration, I even tried mapping a network drive to the Sharepoint library and having them save to the mapped drive location, which of course yielded the exact same error.
    I have also double checked that the Webclient service is running on the machines. 
    One more piece to note is that these two users are still running XP. They'll be upgraded to Win7 later this year, but this needs to work before then.
    Any help or suggestions would be greatly appreciated.

    Hi,
    Did the issue only occur in Excel? What about the other Office suits?
    Please copy the site URL to the File name Text Box in the Save as window. Like:
    http://intranet\site\library
    Regards,
    George Zhao
    TechNet Community Support

  • How to create sql query for item master with operator LIKE with variables?

    hi all,
    How to create sql query for item master with
    operator LIKE(Contains,Start With,End With) with variables using query generator in SAP B1 ?
    Jeyakanthan

    Hi Jeyakanthan,
    here is an example (put the like statement into the where field)
    SELECT T0.CardCode, T0.CardName FROM OITM T0 WHERE T0.CardName Like '%%test%%'
    The %% sign is a wildcard. If you need start with write 'test%%' and otherwise ends with '%%test'. For contains you need '%%test%%'. You also could combinate this statements like 'test%%abc%%'. This means starts with test and contains abc.
    Regards Steffen

  • How to transport SQL Query from SQVI Tcode?

    Dear Friends,
    Can any one tell me how to transport SQL Query from <b>SQVI</b> Tcode.
    Full Points will be rewarded.
    Thanks & Reagrds
    Ravi

    go to sqvi tool .....
    select u r query name ......in the menubar ....quickview....> additianal functions.......>generate program
    after doing generate program ....go to again same menu path as i have mentioned above [quickview....> additianal functions.......>display report name it will give the report name of the select query ..........copy the report name and give it abap editor[se38] u will get u r query program......with all authority checks.....
    in start of selection event of u r program u will find u r select query.
    reward points if helpful

  • Retrieve SQL Query from report without RAS.

    We have a fat client application which uses Crystal Reports.  We upgraded from the RDC/ActiveX viewer to the .Net SDK/.Net Viewer.  One feature that we miss is that we used to read the SQL Query that a report used and wrote it to our log file.  This helped with debugging and with troubleshooting problems in the field.
    Since we only deploy the freely distributable Crystal Reports model and I don't think that RAS falls into this category is there a way which we can read the SQL Query from a report?  If not, could you add this to a list of requested features for future versions.
    I understand why you removed the ability to set the SQL query, but simply reading it does add value.  Maybe it is difficult for you to return this before the report is run in which case giving us the ability to read the value after the report has been run would also be fine.
    Alternatively some sort of event that is fired each time a query is executed would also be helpful as this would allow Crystal Reports clients to monitor SQL from sub-reports.  You could even build a robust logging mechanism which could report additional information (i.e. number of rows returned, formula evaluations, or anything related to report execution).  All of this would make troubleshooting report issues easier for those of us who use Crystal Reports.

    Need to know what version of CR you are using?
    You can use InProc RAS, it comes with CR and is distributed with the runtime files.
    If you are using CR Basic or the version that comes with Visual Studio .NET then no this will not be added to that product line. It is basic functionality only. You will need to upgrade to a Developer version of Crystal reports to take advantage of the the RCAPI features as well as more general API's.
    There is logging for our DB drivers but the log files get very large. If you use ODBC then you have the option to turn on tracing also. Using RAS you don't need to turn on logging as you can get the SQL. This won't be added either.
    Thank you
    Don

  • See sql query from crystal report without crystal report

    see sql query from crystal report without crystal report 

    Hi,
    Depends on datasource type but you could have a look at ODBC trace or if you have access to the SQL Server you could use profiler to monitor the session.
    Regards,
    Craig
    And this will only be of use if you know which Server/Insstance/Database the Report is connecting to...
    Please click "Mark As Answer" if my post helped. Tony C.

  • Office 2013 cannot open documents from SharePoint 2007 with IE 11.

    Hei 
    One of my client cannot open word documents (office 2013) from SharePoint 2007 with IE11.
    Are there any compatibility issues among Office 2013/SharePoint 2007/Internet Explorer 11?
    Thanks in advance.  

    Hi
    Did you receive any error message when you try to open the documents?
    We recommend you start your Internet Explorer in compatibality mode, and follow the advice in the article below:
    http://blogs.technet.com/b/asiasupp/archive/2011/06/13/error-message-quot-your-client-does-not-support-opening-this-list-with-windows-explorer-quot-when-you-try-to-quot-open-with-explorer-quot-on-a-sharepoint-document-library-in-office-365-site.aspx
    In addition here's a thread for your reference:
    http://social.technet.microsoft.com/Forums/en-US/3cbe6b22-e307-485b-a1af-1699cdf5ba86/office-2013-applications-are-not-able-to-open-sharepoint-2007
    Thanks,
    Tylor Wang
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here
     

  • How to Use SQL Query having IN Clause With DB Adapter

    Hi,
    I am using 11.1.1.5 want to find out how to Use SQL Query having IN Clause With DB Adapter. I want to pass the IN values dynamically. Any ideas.
    Thanks

    invoke a stored procedure, it's safer than trying to put together an arbitrary SQL statement in the JCA adapter

  • Is there any known problem using Oracle SQL Developer 3.0.04 with Java 1.7?

    I'm new to Oracle. I have installed Oracle SQL Developer 3.0.04 and Java 1.7. When I run Oracle SQL Developer, I will get the window Running this product is supported with minimum Java version of 1.6.0_04 and a maximum version less than 1.7. This product will not be supported....
    Is there any known problem using Oracle SQL Developer 3.0.04 with Java 1.7?
    I have already downloaded Java 1.6 but don't know whether I need to uninstall Java 1.7 first. If don't need to uninstall Java 1.7, how can I set Oracle SQL Developer to run with Java 1.6?
    Thanks for any help.
    Edited by: 881656 on Aug 25, 2011 11:22 AM

    Hi,
    One prior post discussing the use of Java 7 is:
    SQL Developer 3.0  and Java SE 7?
    There is no need to uninstall any Java version (except if you have disk space constraints) and no problem switching between Java versions. This may be controlled in the sqldeveloper.conf file in your ...\sqldeveloper\sqldeveloper\bin directory via the SetJavaHome line. For example:
    #SetJavaHome ../../jdk
    SetJavaHome C:/Program Files/Java/jdk1.6.0_26
    #SetJavaHome C:/Program Files/Java/jdk1.7.0Regards,
    Gary Graham
    SQL Developer Team

  • How to connect to BO from Excel 2007

    Hi everyone,
    as I am new to BO I need help how to establish connection to a BO Universe from Excel 2007 - what components I need to install to be able to make the connection, and steps for creating the connection
    Thanks in advance,
    Maria

    Hello Mario,
    It looks like what you are looking for is the "live office" plugin/toolbar that is added to excel that allows you to import WEBI reports based on universes into excel.
    Check this link for more info:
    [http://www.sap.com/usa/solutions/sapbusinessobjects/large/business-intelligence/information-infrastructure/enterprise/live-office/index.epx]
    Regards,
    Duncan

  • Convert a Mac Pro Server from January 2007 with OS 10.4 Server to Snow Leopard 6.0 (NON SERVER)

    I have a Mac Pro Server from January 2007 with OS 10.4 Server installed. I want to convert from OS 10 Server OS to just using Snow Leopard 6.0 (NON SERVER). I have two hard drives installed. What is the best way to do this?
    Can I just install Snow Leopard NON-SERVER on the second drive, then switch it into the place of the original main drive?
    Can I switch the drives, then install the Snow Leopard on the replacement drive?

    Not sure how you configured the server, though you can install snow leopard on second HDD and select boot drive with pressing "option" key during startup.

  • Sync mail from Outloock 2007 with phone by PC Suit...

    It is posible to sync my mail from Outloock 2007 with my phone Nokia 6300 by PC Suite? At the moment I can only sync notes, contacts and tsks.

    iTunes does not support syncing email account mailboxes and messages with an email client on your computer. The option under the Info tab for your iPhone sync preferences with iTunes for email accounts is for transferring the email account settings from a supported application on your computer to the iPhone's Mail client only so you don't have to manually create the account.
    If you want to keep mailboxes synchronized with the server automatically with each email client used to access the account, you need an IMAP account which is specifically designed for this.

Maybe you are looking for