Code to run a query in SQL from Access with pass through query

I have a query in SQL Server 2008:
 [Auto Null Up Date].sql. I want to run this query from Access 2007 using a Pass Through Query. What is the command/code to run this query from Access? I have used Pass Through Queries but never in this capacity so I am somewhat lost. I have
already established the OBDC link and tested.

Naomi,
Here are a few lines of the SQLCMD code in the [Auto Null Update].sql query:
USE [Archive Master]
Go
:r "\\10.200.1.60\c$\Users\bkreft\My Documents\SQL Server Management Studio\Projects\Null BackPress 2 update.sql"
GO
:r "\\10.200.1.60\c$\Users\bkreft\My Documents\SQL Server Management Studio\Projects\Null CHWR 3 update.sql"
GO
:r "\\10.200.1.60\c$\Users\bkreft\My Documents\SQL Server Management Studio\Projects\Null CHWR 4 update.sql"
When this code is pasted into a Create Procedure, (the USE [Archive Master] is not used), the procedure will run, but once saved here is what is left of the procedure once I attempt to modify:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:                         
<Author,,Name>
-- Create date: <Create Date,,>
-- Description:              
<Description,,>
-- =============================================
Create PROCEDURE [dbo].[NullTest2]
AS

Similar Messages

  • Migration Error from Access to Oracle through SQL Developer.

    Hi,
    Actually I am trying to migrate data from MS Access 2002 to Oracle 9i database through the SQL Developer. But Whenever I go to Capture Database from Access it will show me an error.... Invalid procedure Call and then it shows an error message... >>>>>>
    ShowSplashScreen("_OracleSplashScreen",3)
    after that i wont be able to do this task anymore..... So please help me get out of it... How Cam I Maigrate data from Access to Oracle 9i...
    Is any other tool i use or you can help me for this tool to migrate date...
    Please tell me..
    If yu can send me a mail then mail me on [email protected]
    regards,
    Vishal

    Hi Vishal,
    I have responded to your related thread on the Migration Workbench forum - Migration Error from Access to Oracle through SQL Developer.
    Regards,
    Hilary

  • Pass SQL from Access 2000 to Acrobat

    I have the need to pass dynamic SQL statements (including the use of variables) from Access 2000 to an Adobe form.  The Adobe form will then display the data that is gathered by the SQL.  While I am fairly good at Access and SQL, I am just beginning with Acrobat.  The forms are developed and coded in LiveCycle Designer.  The SQL code has the ability to directly access either the linked tables in the Access DB or the data tables on the SQL server.  Thank you for your help and time.

    I did not find the 1.30 plugin. I finally got it to work by fooling oracle into thinking that I had a 9i database installed by manually creating the \oracle\ora91 directory.
    Thanks for your help though!

  • Migration from Access to Oracle through SQL developer

    Hi,
    I want to migrate an mdb file which contains a set of tables to oracle. During this process, i have created schema and all the tables in Oracle using DDL scripts. I would like to transfer only the data to Oracle from access through SQL developer. How can I do that?
    Regards,
    Meena

    Hi Meena,
    You mention that you have created the schema and tables in Oracle using DDL scripts. Did you use the Oracle SQL Developer Migration Workbench, creating a Migration Repository, to carry out this process? I see from your other postings that you are experiencing issues using the Exporter tool, which would lead me to believe that you haven't used the Migration Workbench to migrate your database. Obviously you will need to resolve your Exporter issues before you can proceed to the next phase of the migration process. I will aim to assist you with those issues on the seperate thread - ShowSplashScreen("_OracleSplashScreen",3) error The XML file generated by the Exporter tool forms the basis of your MS Access migration.
    In order to migrate your data from MS Access to Oracle using the Migrate Data option in Oracle SQL Developer, you will need to have access to the Migration Repository used for the migration of the MS Access database. The information contained in the Converted Model, in the Migration Repository, is used during the data migration process. The data migration requires the following connections:
    1. a source database connection i.e. a database connection to the MS Access MDB file
    2. a target database connection i.e. a database connection to the migration Oracle schema
    3. a Converted Model connection
    For further information on the creation of a Migration Repository, and the migration process, please refer to the accompanying documentation available via the online Help within Oracle SQL Developer, and also from OTN - http://download.oracle.com/docs/cd/E10405_01/doc/nav/portal_booklist.htm.
    I hope this helps.
    Regards,
    Hilary

  • Data sync to external SQL from Access Web App

    Hi all
    Am I dreaming or does creating a table in an Access Web app based on an external SQL Azure database table (not the intrinsic one) end up being an import not a sync?  It doesn't even seem to update when i open the external table and refresh it?
    I am adding new records at the external SQL source and they are not updating in the table in the WebApp
    Is anyone having similar problems?
    Cheers
    Sally

    Hi Sally,
    >> I am adding new records at the external SQL source and they are not updating in the table in the WebApp
    Do you mean that you import a table from an external SQL Azure database into Access Web app, the data in Access Web app did not update after you change the an external SQL Azure database data? In my option, this is expected behavior if you are using import
    table. Importing from another database would not achieve that, and it only achieves copying data from another database. I am afraid that you could not achieve your requirement from Access Web app.
    As far as I know, the database of Access web app is Azure DB, I think you could sync the Access web app Azure DB and External Azure DB, you could refer the link below for more information.
    Reference:
    http://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started-sql-data-sync/
    I am not familiar with Azure DB, and if you have issues about Azure DB, I will recommend you go to the link below for help.
    Reference:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=ssdsgetstarted
    Thanks for your understanding.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Query builder by microsoft access with CF basics

    does anyone if
    query builder by microsoft access can work with with CF mx
    how can i use it with cf and oracle queries?
    also, is it free.
    does anyone know how i can get it.
    and install it with my db (oracle 9i)????
    thanks

    You can build your query in Access, switch to sql view and
    copy and paste the code anywhere you want. However, ITWILL((((BE
    very hard)))TO READ BECAUSE IT IS all one LINE and has [[[[[TOO
    MANY]]]]]((BRACKETS))) and random CAPITALIZATION.
    Also remember that the s in sql stands for structured, not
    standard. Oracle and Access have different syntax in some cases and
    they definetly have different functions.
    A better approach would be to learn sql.

  • Open a crystal report from WAD with passing  the variables values

    Hi,
    I need to know is there any way to link SAP WAD to crystal reports (open a crystal report from WAD)and pass the values of the variables which are entered in the Web App. (e.g. Customer id,year) should be passed to the Crystal Report.
    Maybe we need to pass parameter by WAD URL but this is just my assumption and have no idea how to do this with passing variable values.
    right now I know the method of how Bex queries which are used as data source for crystal reports but in my current scenario we have the structure like this that bex queries link with WAD and then WAD is linked with crystal reports.
    No doubt that Crystal report is target option in RRI but there the source is Bex Query only but in current scenario we are looking  WAD (web template) as a source to crystal report or crystal report called in WAD.
    Please suggest something on same.
    Thanks
    Take care
    Vishal sharma

    Hello Vishal.
    Did you find a solution for this problem?
    I'm facing right now the same problem, I need a way to link SAP WAD to crystal reports (open a crystal report from WAD) and pass the values of the variables which are entered in the Web App. (e.g. Customer id,year) should be passed to the Crystal Report.
    Have found an answer to this issue? If yes, please kindly inform how have you solved this.
    Best Regars
    Armando Santos

  • Calling a PL/SQL from VB with IN argument of object type

    I need to call a PL/SQL function in Oracle 8.1.6 from VB. One of the IN arguments is an object type (TYPE). How would I instantiate the variable of Oracle object type on VB side so that it can be passed to the Oracle?
    Thank you

    You have some flaws in your code.
    First - don't use same identifier for pl sql variables ( including parameters) and column names. In your case oracle will evaluate the where clause as where column_name=column_name which is probably not what you want. The next one - you should ensure that select into yields one row , not more, not less, otherwise you 'll run into exception.
    To actually print the desired values, you have to use dbms_output aware client ( sqlplus is such one) and for sqlplus in particular you have to issue set serveroutput on
    Here is a very basic example how can you get it to work:
    SQL> SELECT * FROM V$VERSION;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> CREATE OR REPLACE PROCEDURE FIND_EMPLOYEES
      2  (p_first_name IN VARCHAR2)
      3  IS
      4  LAST varchar2(10);
      5  BEGIN
      6          SELECT LAST_NAME INTO LAST FROM EMPLOYEES WHERE FIRST_NAME = p_first_name;
      7          dbms_output.put_line(LAST);
      8  EXCEPTION
      9    WHEN no_data_found THEN
    10    dbms_output.put_line('There is no one employee with such first name!');
    11    WHEN too_many_rows THEN
    12    dbms_output.put_line('There are many employees with such first name, try with another one!');
    13  END FIND_EMPLOYEES;
    14  /
    Procedure created.
    SQL> SET SERVEROUTPUT ON
    SQL> EXEC FIND_EMPLOYEES('Julia')
    There are many employees with such first name, try with another one!
    PL/SQL procedure successfully completed.
    SQL> EXEC FIND_EMPLOYEES('Eugenia')
    There is no one employee with such first name!
    PL/SQL procedure successfully completed.
    SQL> EXEC FIND_EMPLOYEES('Adam')
    Fripp
    PL/SQL procedure successfully completed.Best regards
    Maxim

  • How to add a dynamic where clause for a sql based VO with group by query?

    Hi,
    Here is my case, I have a sql query based VO with the query like "select status, count(*) StatusCount from my_table group by status". Now I used the following java code trying to dynamically add the where clause to my VO to filter the rows based the type attribute in my DB table.
    vo.setWhereClause("type='MyType1' ");
    vo.executeQuery();
    Then I got the sql syntax error. Looks like the ADF has added the where clause to the end of my sql so my sql becomes "select status, count(*) StatusCount from my_table group by status where type='MyType1' ". But what I expected was the correct syntax "select status, count(*) StatusCount from my_table where type='MyType1' group by status".
    Does anyone know if this is an ADF bug? Or is there any other way to achieve my goal?
    Thanks,
    Chunyang
    Edited by: Chunyang on Dec 13, 2012 9:09 PM

    Hi,
    When you use setWhereClause on the VO, it is applied on top of the VO query. I.e, assume your VO has the following query.
    select empno, ename from empNow, if you apply the where clause programatically, only the two attributes that you are using in the select statement could be used. I.e
    select * from (select empno, ename from emp) where ename='KING' - VALID
    select * from (select empno, ename from emp) where deptno=10  - INVALID (because the inner query - the one you've defined as query for your vo does not have deptno attribute selected)If you would need to set a dynamic where clause, you need to make them available in your select statement / use bind variables.
    -Arun

  • Executing sql from table with in plsql procedure

    I wonder if anyone can help.
    I have a table that stores sql statements. They are actually a set of rules that I want to apply to my application. My intention is to execute the statement in plsql.
    EG a sql statment held in the table might be:
    'select count(id) from item where item_id = ' || constants_pkg.c_test_item || ' and client_id = ' || client_id_in
    I am trying to call this from a plsql procedure, I’ve CUT OUT some of the procedure task_rec.rule holds the statement above. The procedure is failing “invalid SQL statement”, I think the client_id_in may not be evaluating as the variable, passed into the procedure and constants_pkg.c_test_item not being taken from the constants pkg.
    EG.
    PROCEDURE create_additional_info_list(
    client_id_in IN client.id%TYPE,
    IS
    result VARCHAR2(100);
    BEGIN
    EXECUTE IMMEDIATE
    task_rec.rule
    INTO result;
    END;
    If I was to do below the code would work ok. However I require the rule to come from the table.
    EXECUTE IMMEDIATE
    'select count(id) from item where item_id = ' || constants_pkg.c_test_item || ' and client_id = ' || client_id_in
    INTO result;
    Is there anyway constants_pkg.c_test_item and client_id_in can be evaluated as variables?

    Not that I've tried this but, if possible, change the SQL in the table to have bind variable; e.g.,
    'select count(id) from item where item_id = :1 and client_id = :2 ';
    Then in the procedure
    execute immediate task
    INTO result
    USING constants_pkg.c_test_item ,
    client_id_in ;

  • Calling PL/SQL from Javascript with htmldb_Get

    Dear all,
    I'm trying to call a PL/SQL procedure from JS and return a value to JS code. I'm using the htmldb_Get method but I cannot succeed doing this.
    My PL/SQL :
    BEGIN
    htp.prn('Hello World');
    END;
    My JS :
    function test() {
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=HelloWorld',0);
    var myobj = get.get();
    alert(myobj);
    I guess I'm doing something wrong here ... Your help is appreciated.
    Best regards,
    Othman.

    Hi Gregory,
    Thanks for the reply.
    Is there a way to pass parameters from PL/SQL to JS? I just need to print an alert message with the value 'HelloWorld'. Maybe the htmldb_Get is not the better way for doing that.
    I tried also to set the item and then print the alert message based on this value but it doesn't work ... I think I'm not calling well the process 'HelloWorld'. Basically, I created an OnSubmit process with no condition associated to it. I tried with :
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=HelloWorld',0);
    and
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=HelloWorld',0);
    Regards,
    Othman.

  • Query multiple values from tables with multiple conditions

    I'm trying to display the addresses from an employee record. There are two tables: employees and emp_addresses. There can be any number of addresses which is defined by the address type.
    What I want to do is get all the employees and all of the addresses for that employee in the same result.
    Addresses table:
    emp_id
    address1
    address2
    address3
    city
    state
    zip
    type (either H for 'home' or W for 'work')
    I would like the result set to be:
    emp_id | home_address1 | home_city | work_address1 | work_city
    Do I have to use a join? I'm not sure how to go about it.

    Hi,
    user9179751 wrote:
    I'm trying to display the addresses from an employee record. There are two tables: employees and emp_addresses. There can be any number of addresses which is defined by the address typeIf there can be any number of addresses, and you want to show all of them, then you probably need String Aggregation . See this page for different ways to do it:
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
    A related topic, that usually works better with a known number of columns, is Pivoting . See these links:
    SQL and PL/SQL FAQ
    There are ways to make pivoting work with a variable number of columns. See this thread:
    Re: Report count and sum from many rows into many columns
    What exactly are your requirements? Do you rally need separate columns for each address, or is it okay to have one big VARCHAR2 column that's formatted so it looks like separate columns? If you really need separate columns, do you know an upper limit to how many (e.g., there will never be more than 5)?
    What I want to do is get all the employees and all of the addresses for that employee in the same result.
    Addresses table:
    emp_id
    address1
    address2
    address3
    city
    state
    zip
    type (either H for 'home' or W for 'work')
    I would like the result set to be:
    emp_id | home_address1 | home_city | work_address1 | work_cityWhenever yo have a question, post CREATE TABLE and INSERT statements for some sample data, and the exact results you want from that data. Showing the column names for the sample data isn;t nearly as helpful as shoiwing some actual data (with column names). Showing the header line that goes over the results isn't nearly as helpful as showing the actual results (with the header line).
    Always say which version of Oracle you're using. Sting aggreagation and pivoting techiniques have changed significantly in every version since Oracle 7.
    Do I have to use a join? I'm not sure how to go about it.Using a join, you could get one more address for every join, but since there could be any number of addresses, you'd need any number of joins, and that means dynamic SQL. Join probably isn't the best approach in this case.

  • SQL from Access to Oracle

    Hi,
    I've been developing queries in Access, using pivot tables. Oracle SQL*Plus does not recognize either TRANSFORM or PIVOT keywords from Jet SQL.
    Can anyone help me find the necessary equivalents for SQL*Plus?
    Thanks,
    Joe

    Hi Meena,
    You mention that you have created the schema and tables in Oracle using DDL scripts. Did you use the Oracle SQL Developer Migration Workbench, creating a Migration Repository, to carry out this process? I see from your other postings that you are experiencing issues using the Exporter tool, which would lead me to believe that you haven't used the Migration Workbench to migrate your database. Obviously you will need to resolve your Exporter issues before you can proceed to the next phase of the migration process. I will aim to assist you with those issues on the seperate thread - ShowSplashScreen("_OracleSplashScreen",3) error The XML file generated by the Exporter tool forms the basis of your MS Access migration.
    In order to migrate your data from MS Access to Oracle using the Migrate Data option in Oracle SQL Developer, you will need to have access to the Migration Repository used for the migration of the MS Access database. The information contained in the Converted Model, in the Migration Repository, is used during the data migration process. The data migration requires the following connections:
    1. a source database connection i.e. a database connection to the MS Access MDB file
    2. a target database connection i.e. a database connection to the migration Oracle schema
    3. a Converted Model connection
    For further information on the creation of a Migration Repository, and the migration process, please refer to the accompanying documentation available via the online Help within Oracle SQL Developer, and also from OTN - http://download.oracle.com/docs/cd/E10405_01/doc/nav/portal_booklist.htm.
    I hope this helps.
    Regards,
    Hilary

  • OLE object Migration from Access to Oracle through SQL developer

    Hello,
    I used sql developer 3.1.07(oracle 11g) to perform data migration from MS ACESS.
    the MS access data has a column with data type as "OLE object" ---there
    saved a lot of pdf files .
    Then I performed "copy to oracle" from MS access connection, the OLE data
    changed to BLOB from oracle database, and data seems to be copied to
    database as binary . However none of the data in the column can be opened. I
    download the blob data to a file from sql developer and tried to open
    using Adobe 8.1 with no success.
    How can I fix this issue? or I should say, how can I migrate MS access OLE data to oracle?
    Thanks,
    H.M.

    thx - will have a look
    Edited by: kgronau on May 22, 2012 4:32 PM
    The original PDF content starts with:
    %PDF-1.4
    %ª«¬
    4 0 obj
    <<
    /Creator (Apache FOP Version 1.0)
    /Producer (Apache FOP Version 1.0)
    /CreationDate (D:20120521131845+02'00')
    >>
    endobj
    5 0 obj
    <<
    /N 3
    /Length 12 0 R
    /Filter /FlateDecode
    >>
    stream
    But when I try to save the content in the BLOB as a file it claims about a missing mime extension and when I ignore this message and save the file anyway as a PDF the content is corrupted.
    It shows as :
    Acrobat Document ..
    ´4 0 obj
    <<
    /Creator (Apache FOP Version 1.0)
    /Producer (Apache FOP Version 1.0)
    /CreationDate (D:20120521131845+02'00')
    >>
    endobj
    5 0 obj
    <<
    /N 3
    /Length 12 0 R
    /Filter /FlateDecode
    >>
    stream
    Did you also get the missing mime type error message?

  • Problem in sql pass through query

    i am using the following query:
    select * from table_name where item IN (?0) and item1 IN (?1)
    i am creating sqlPassthroughQuery but i am getting : Missing right parenthesis /Query not terminated properly exception
    but the query is working without where clause and it is working also if i am not using query without parameters i.e.
    select * from table_name where item IN ('itemvalue1','itemvalue2') and item1 IN ('itemvalue1','itemvalue2')
    Any pointers will be useful
    Prakhar

    Hi,
    i used the query like this:
    String query="Select * from table_name where col1 IN(?,?,?) and col2 = ?";
    Object params[] = new Object[4];
    params[0] = "val1";
    params[1] = "val2";
    params[2] = "val3";
    params[3] = "val4";
    Builder builder = (Builder)view.getQueryBuilder();
    Query sqlQuery = builder.createSqlPassThroughQuery(query,params);
    RepositoryItem[] items = view.executeQuery(sqlQuery);
    This is just a basic example.You can get more info @ATG Repository Guide.
    Prakhar

Maybe you are looking for

  • Samples for GarageBand and Logic.

    Quite a time ago, I mentioned Pete Thomas's samples. I play tenor sax and learnt about him from his own and the Sax on the Web site. Pete has played tenor with the Fats Domino Touring Band, written for Sound on Sound, taught sax and composing at Sout

  • Error while mapping

    I have created Info object characteristic Customer(C09_CU).I have also assigned dimension for my char Now when i am trying to assign datasource to my char(I have already defined source system as metadata file source system),and when i assign my sourc

  • Why won't my iPad load games

    IVe downloaded a game it try's to load then just takes me bk to my main screen y, I've tried it with different games but it's doin the same, can someone help.

  • What program will translate appleworks database files

    Years ago I created a simple database in Clarisworks. The appleworks was able to concert this no problem. No I'm on system 7 and I need to access this DB. Is there a program that will convert this properly?

  • IWork is all white and doesn't work properly with Snow Leopard

    Whenever I open Pages or Numbers 09, everything is displayed as white. The text colour is black but I can't see the blinking text mouse icon (which looks like I). I can open templates and can only see the text when I highlight it otherwise the screen