I wrote this query to create a new database by copying from an old database and inserting into the new one. I want this query to change entities. How can I do this?
Related
I would like to do a Quicksight dashboard from a query where it does SQL NOT IN (in other table).
However when I go to Quicksight and add a data set or edit it I dont see an option to do custom SQL. I am using RDS/Mysql.
Any suggestions are welcome.
Thanks
It's not possible to switch to custom SQL mode while editing existing dataset if it was created for a specific DB table.
However, you can use custom SQL by creating a new data set using RDS datasource:
I currently have a SQL query that needs to be rewritten in C# code that interrogates 2 different sharepoint lists.
Given that this query filters using the SQL year() function, has multiple unions and subqueries, how should I be writing this in code? CAML queries or LINQ seem excessive and slow when the query will be converted back into SQL to be run anyway (the lists in question are actually tables surfaced as lists through Access Services, so it seems stupid to convert a database query into code, in order to run a database query!)
I ended up doing this by importing all the data from the relevant table's lists into an in-memory SQLite database, using the client object model, and then running a modified SQL query on the SQLite tables. As there wasn't that much data this was an acceptable method.
I have a database which imports linked data-tables. Obviously with linked Tables I cannot change the design of the data tables. However there are many duplicates in the data table that I want to use and my aim is to run a query that deletes all but 1 of the duplicates in the table. Is there a way of doing this??
Any support would be appreciated.
Chris
To omit the duplicates you could conceivably create a SELECT DISTINCT query to return all the fields from the linked table, and then use that query (instead of the linked table) as a basis for your other queries.
Hi every one,
I have a requirement to get all the views and indexes from Oracle/PostgreSQL DB
Here I have written one query like below to get all views
SELECT * FROM INFORMATION_SCHEMA.VIEWS where table_schema = 'public'
But that is postgreSQL dependent query right. Because in Oracle, information_schema was implemented differently so i thought to write jpql query but i dont know how to write.
Could anybody please help me out!
Thanks & regards,
Sridhar Kosna.
It's not possible. JPQL is only able to query mapped entities. Not database tables. You'll need to use SQL, and if you need to support multiple databases, have one DAO per database and use the appropriate DAO based on the used database.
In my DBML file I have mapped some tables and stored procedures, and the stored procedures return type is ISingleResult . T is some mapped table. But I want to take the data into my own created entities rather than LINQ to SQL created entites. The entites created by me are also the same as the mapped table entities and their use lies when we send data across the a web service. So , how can I proceed by creating a wrapper around the DBML file so that I always get data in my own created entites.
Entity Framework is designed for this scenario, but if you cannot move to that for other reasons, Automapper is worth looking into.
You can add attributes to linq to sql entities that are not mapped to database columns, by adding a property in the designer and leaving the datasource property empty.