+ Reply to Thread
Results 1 to 4 of 4

Embedded Query - Teradata Database ODBC - Create Table

  1. #1
    Registered User
    Join Date
    07-29-2011
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2010
    Posts
    43

    Question Embedded Query - Teradata Database ODBC - Create Table

    Apologies if this is in the wrong forum area - I could not quite figure out whether it is Excel related (due to being embedded query) or whether it would be better suited in an external program forum area.

    Embedding a query that includes a CREATE TABLE function is something that we have not been able to do, as MS Query does not seem to allow this, so at present we have to go into Teradata, run the query and copy the answerset into Excel.

    Ideally, we want to be able to click a macro button and refresh one of two queries within the file itself, and it does all the work.

    The beginning of the query is currently this:

    CREATE TABLE *database name*.*table name*

    and then the query pulls back and dumps all the data into the temporary table, to give us our answerset.

    Is there any way to make MS Query do the same thing, thus negating the need to reference the data externally?

    Many thanks for any help!

    Kind Regards

    Jenn

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Embedded Query - Teradata Database ODBC - Create Table

    I've never tried doing that, but whenever I want to do something that MS Query doesn't like - I create any basic query in MS Query, return to Excel and then paste my sql over the generated sql in the command text box.

  3. #3
    Registered User
    Join Date
    07-29-2011
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Embedded Query - Teradata Database ODBC - Create Table

    Hi Kyle,

    Yep, that's our usual method, too, but it seems that the Create Table function needs to work in a virtual environment unlike a normal query - if I understand correctly, Teradata builds a temporary database, puts data into it, then queries the temporary table/s before dumping them after the answerset has returned. I've not found a way of doing this outside of Teradata, though I did have an idea to have an embedded query return a number of data to different cell ranges, then have Excel query those ranges, but this takes longer and is more cumbersome/space consuming than what we already have.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Embedded Query - Teradata Database ODBC - Create Table

    Can't you stick it in a stored proc?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1