I have a file in PowerBI that contains some tables all linked to SQL SERVER. My problem is this:
To make user use easier I renamed the tables to a friendlier name, but now I need to know the actual name of the table in the database and I can not find this data.
Where can I find this?
Go your query editor and open the Advanced Editor for a query that links to the server.
In the first few lines of the M code, you should be able to see exactly how it's connecting and what the SQL table name is. It might look something like this:
let
Source = Sql.Databases("servername"),
DatabaseName = Source{[Name="DatabaseName"]}[Data],
TableName = DatabaseName{[Schema="dbo",Item="TableName"]}[Data],
<...>
Related
i am trying to change my database name in my advanced editor query in power bi. I know i can create parameters with in the power bi desktop app and pass the different database with in it. I have done this and it works fine.
But what i am trying to do is when i give a user a link for example
https://app.powerbi.com/groups/me/reports/DataSource="PowerBi_1"
how do i get the datasource name which is "PowerBi_1" and pass it into my advanced editor query which looks as follows
let
Source = Sql.Database(".", "PowerBi_2", [Query="select *#(lf)from Customer"])
in
Source
so i want to replace the Powerbi_2 with PowerBi_1
is this possible?
I tried searching and the only things i could find was to add parameters from "manage parameters" which i can already do. But i need it to be passed from the URL and automatically change the data source instead of manually changing it via "edit parameters"
i know you can use filter in your URL as https://app.powerbi.com/groups/me/reports/12345678-6418-4b47-ac7c-f8ac7791a0a7?filter=Customer/PostalCode eq '15012'
but this would only work on datasets. im not sure how to do this for a database change in a query
The only thing you could try is if you have a direct query and use the new feature of binding query parameters.
https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters
Then you can set a filter with url to point to the database you need. Not sure how it would work - haven't tried it myself.
To expand on the idea a bit - you would need a table with database names in it. Then you would bind database column of that table to your query parameter and finally, use your url to set appropriate filter on this new table.
EDIT:
Scratch that, in the article I linked to, it says that direct query T-SQL is not supported. But if they were ;)...
I want all the mandatory single and repeating attributes and also the properties when we see by right click the documents for the Archive cabinet. I tried the below query in Oracle SQL Developer :
select r_object_id, object_name, r_object_type, title, subject,
r_creation_date, r_modify_date, r_modifier, a_content_type,
i_contents_id, i_cabinet_id,owner_name,i_chronicle_id,authors,keywords,
i_folder_id,r_version_label
FROM IPEDMS.dm_sysobject_s, IPEDMS.dm_sysobject_r
WHERE IPEDMS.dm_sysobject_s.r_object_id = IPEDMS.dm_sysobject_r.r_object_id
and r_object_id in (select * from ip_indexcard_doc_s);
Please let me know the correct query.
Note: in the ip_indexcard_doc_s table only i found those properties when we right click the documeents under archive.
You need to look in the dm_type_xxx tables along with some other tables.
Easiest way to find out is to install the dqMan from FME and work your way though that. It's free and very good for working with docbases.
And as stated by #cgrim above, you should consider to use DQL instead unless you really understand the Documentum object model.
I am rather new to DynamoDB and currently we are thinking about migrating an existing project to a serverless application using DynamoDB where we want to adapt the following setup from a RDMS database:
Tables:
Projects (ProjectID)
Files (FileID, ProjectID, Filename)
Tags (FileID, Tag)
We want to make a query with DynamoDB to fetch all Files for a specific Project (by ProjectID) with one or multiple Tags (by Tag). In an RDMS this query would be simple with something like:
SELECT * FROM Files JOIN Tags ON Tags.FileID = Files.FileID WHERE Files.ProjectID = ?PROJECT AND Tags.Tag = ?TAG_1 OR ?TAG_2 ...
At the moment, we have the following DynamoDB setup (but it can still be changed):
Projects (ProjectID [HashKey], ...)
Files (ProjectID [HashKey], FileID [RangeKey], ...)
Please also consider that the number of project entries is huge (between 1000 - 30000) and also the number of files for each project (is between 50 and 100.000) and the query should be really fast.
How can this be achieved using DynamoDB-query, best without using filter expressions since they are applied after data selection? It would be perfect if the table Files could have a StringSet Tags as column but I guess that this cannot be used for an efficient DynamoDB-query (so without using DynamoDB-scan) since DynamoDB-indices can only be of type String, Binary and Number and not of type StringSet? Is this maybe an applicable use case for the Global Secondary Index (GSI)?
A bit late, just saw this question referenced from another one.
I guess you've went and solved it something like this?
DynamoDB tables
Projects (ProjectID [HashKey], ...)
Files (ProjectID [HashKey], FileID [RangeKey], ...)
Tags (Tag [HashKey], FileID [RangeKey], ProjectID [LSI Sort Key])
On the FileTags, you need the FileID to make the primary key unique, but you can add the ProjectID as a sort key for a Local Secondary Index, so you can search on Tag + ProjectID.
It's some sort of Data Denormalization, but that's what it takes to go NoSQL :-( . E.g. if your File would be switched to another Project, you'll need to update the ProjectID not only on the File, but also on all the Tags.
The question is almost three years old, but it's still in the Google result. So if anybody else lands here, maybe the following page from DynamoDB docs can help. Just found it myself and didn't try it yet, but it looks promising. Seems to be newer than the other replies here and shows a nice approach to solve the problem.
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-adjacency-graphs.html
I've got a form in which I want to display either a download link for a BLOB or use a file browser field to do the same.
I can manage the file browser method normally, however because the BLOB I want to refer to isn't part of the table the form is based on, I can't seem to get it to show properly.
The best I've got so far is a 'display only' field with an SQL query returning the size of the file.
If you are using Oracle Application Express, you may youse the "P" procedure.
Just like the "F" procedure that you it to show pages, the P procedure allows you to download files from apex.
for example :
http://apex.shellprompt.net/pls/apex/p?n=217605020644166778
where that number at the end is the primary key number form the
select id
from apex_application_files
To add a file to this table, simple add a browse-file item on a page. Run the page, browse for a file, and submit the page. It will automatically insert it in this table.
you can query it after :
select id
from apex_application_files
where filename = YOUR_FILE
good post for this is : http://dgielis.blogspot.com/2007/08/oracle-apex-fp-pn-zp.html
test it out, tell me if you get stuck
I was wondering what the "best" way to verify the structure of my database is with SQLite in Qt / C++. I'm using SQLite so there is a file which contains my database, and I want to make sure that, when launching the program, the database is structured the way it should be- i.e., it has X tables each with their own Y columns, appropriately named, etc. Could someone point my in the right direction? Thanks so much!
You can get a list of all the tables in the database with this query:
select tbl_name from sqlite_master;
And then for each table returned, run this query to get column information
pragma table_info(my_table);
For the pragma, each row of the result set will contain: a column index, the column name, the column's type affinity, whether the column may be NULL, and the column's default value.
(I'm assuming here that you know how to run SQL queries against your database in the SQLite C interface.)
If you have QT and thus QtSql at hand, you can also use the QSqlDatabase::tables() (API doc) method to get the tables and QSqlDatabase::record(tablename) to get the field names. It can also give you the primary key(s), but for further details you will have to follow pkh's advice to use the table_info pragma.