I am running a DQL statement in Documentum dql editor and get 3000 rows back. Is their any way I can export the rows returned by DQL to the excel spreadsheet?
Thank You.
There’s no easy way to export data from the DQL editor- instead use a tool, e.g. FME dqMan - basic features like exporting to Excel is free.
As Henning Winter said - there is no easy way unless you use some tool which has features or you can write the DFC code to execute the query. You have to iterate the query result and write in the EXCEL sheet using some opensource APIs.
Related
I created code in SQL to get specific data.
However, when I try to paste the results into Excel, I get an error message that says
"Microsoft Excel cannot paste the data."
Has anyone experienced this? If so, do you know what the solution is?
I modified the code to only extract data from one department (instead of 4), to reduce the number of rows from just under 1 million to 153,671 rows, but I still get the same error message. The data has 12 columns.
Your help would greatly be appreciated!
If you are using the keyboard shortcut (ctrl+C, ctrl+V), I guess it's previsible that It can't work, because event if the interface can look like excel, the data is different.
you can do the same using automatic tools that will do the query for you and put the result in a csv / excel document.
If you are using MSSQL, you can look on other MS tools such as SSDT, which is very simple to use and have tools to exchange excel data to (or from) SQL databases
another way is to connect your excel sheet to your database. this is explained on MSDN here
You can't copy and paste that many rows at a time due to cache restraints. Your best bet is export the query result to a csv file and open it in excel. Here's how to do it:
Open SQL Server Management Studio
Go to Tools > Options > Query Results > SQL Server > Results To Text
On the far right, there is a drop down box called Output Format
Choose Comma Delimited and click OK
From here it'll show your query results as comma-delimited text.
To save the results of your query to a file: Ctrl + Shift + F
I am working on a project were we need to develop SQL Reports based on some excel files.
I was able to create the ODBC for the Excel file and I was able to connect to it successfully using the Report Services.
My question is:
How can I used paramaters in the query ? When I try to use #CIF or #StartDate I get all kinds of errors and I don't know how to use parameters with SQL query for Excel.
Sample:
SELECT * FROM [Loans$] Where [CIF] = #CIF
Can anyone tell me how?
If you are successfully extracting information without trying to filter at the query level, as a workaround you can add the filtering at the DataSet level, something like:
This will extract data from the DataSet then apply any filter, not try to do it at the same time.
It's might not be addressing your root cause, but will hopefully get you up and running in the meantime.
Since you don't actually list the errors you're getting, it's hard to offer more specific advice.
I have generated a query in the excel by using macros now "i want to import these queries into teradata and compile it and display the result Automatically".Can anyone help me with this?
With sufficient privileges in the database you can create a macro or macros that encapsulate the query. The macro(s) can be built to accept parameters if necessary. Once you have the macros built on Teradata you can replace the SQL in your Excel Macros with:
EXEC {Database}.{Macro}({parm1}, {parm2}, ... {parmn});
Excel VBA - Query on a Spreadsheet - Take a look at the answers on this SO question. You may find something to help you in the right direction with your VBA coding. It will need to be tweaked to connect with your Teradata environment.
store your queries into single string variable and remember to put ";" between queries. then use this guide
http://voices.yahoo.com/teradata-ms-excel-vba-2687156.html?cat=59
I've done a fair amount of tinkering and searching and the best option seems to be either:
sending output to text and copy/pasting into a text file or Excel OR
outputting to a somewhat unorthodox .rpt file, which I'm not sure what you'd do with--opening it in Excel doesn't preserve formatting present in the original output.
For what seems like a pretty common task, I'm surprised there isn't a simpler way to do this.
Can anyone suggest an easier way to go about this than the two methods I outlined?
Oh, and for what it's worth, I'm working on SQL Server 2008.
How about the BCP utility? http://msdn.microsoft.com/en-us/library/ms189569.aspx
Even through the SSMS GUI, it's still a relatively PITA process:
Plan A:
Tools, Options, Query Results, Results to Text
<= Change output format from "fixed columns" to "delimit by tabs"
At that point, you can "Save results to File", and specify a .csv file
Plan B: fire up your favorite scripting language (like vb.net, for example) and just write a program that does the SQL query and writes the .csv. 10 lines, tops :)
Plan C: Yet another approach is to use some external program to do the query and convert the results for you. SQL Server comes with "BCP". You can easily write a .bat file to invoke it:
http://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/
'Hope that helps
Are you using SQL Server Management Studio? If so, when you open a new query window, you can select to send output to a file. Query Menu -> Results To -> Results to File.
Chris, this is actually super-easy.
If your query results get displayed in the grid (as is the default), just right-click on the grid and choose Save Results As....
From within MSSQL Management Studio, you can right-click on your database and select "Tasks" -> "Export Data". It starts-up a wizard that allows you to pick your data source. On the "Destination" page you can select "Microsoft Excel" or "Flat File Destination". The next page in the wizard allows you to specify data from one or more tables, or a custom query to get your data. If you chose "Flat File Destination" before, the next page allows you to set your own delimiters.
Another option is to pull it into Excel from SQL
Run your query and from the Results tab do Ctrl-a to select all, and paste this into Excel.
I generate a ClearQuest query using the Query Wizard. In the Query Editor, I am able to select a filter for a given field. However, I want to refine the query using the SQL Editor, but then I loose the ability to have a dynamic filter. How can I resolve this.
Pretty sure the answer is "you can't" since the SQL generated includes the value entered for any dynamic filters set up when you built the query, and as you say, the act of editing the SQL prevents using the Query Editor to make further changes.
Your best bet is to figure out a way to use the Query Editor to do what you need the SQL Editor for. Start another question.