How do you determine the file name of a database? - sqlanywhere

My application uses Entity Framework 4 to access a SQL Anywhere 12.0.1 database. I need a query that will tell me what the name of the database file on disk, including the drive letter.
How do I get the database path from the database itself?

I figured it out. This query will retrieve the path of the file that the current database is stored in:
SELECT file_name FROM SYSDBFILE WHERE dbfile_name = 'system'

Related

Azure Data Factory V2 Copy Activity - Save List of All Copied Files

I have pipelines that copy files from on-premises to different sinks, such as on-premises and SFTP.
I would like to save a list of all files that were copied in each run for reporting.
I tried using Get Metadata and For Each, but not sure how to save the output to a flat file or even a database table.
Alternatively, is it possible to fine the list of object that are copied somewhere in the Data Factory logs?
Thank you
Update:
Items:#activity('Get Metadata1').output.childItems
If you want record the source file names, yes we can. As you said we need to use Get Metadata and For Each activity.
I've created a test to save the source file names of the Copy activity into a SQL table.
As we all know, we can get the file list via Child items in Get metadata activity.
The dataset of Get Metadata1 activity specify the container which contains several files.
The list of file in test container is as follows:
At inside of the ForEach activity, we can traverse this array. I set a Copy activity named Copy-Files to copy files from source to destnation.
#item().name represents every file in the test container. I key in the dynamic content #item().name to specify the file name. Then it will sequentially pass the file names in the test container. This is to execute the copy task in batches, each batch will pass in a file name to be copied. So that we can record each file name into the database table later.
Then I set another Copy activity to save the file names into a SQL table. Here I'm using Azure SQL and I've created a simple table.
create table dbo.File_Names(
Copy_File_Name varchar(max)
);
As this post also said, we can use similar syntax select '#{item().name}' as Copy_File_Name to access some activity datas in ADF. Note: the alias name should be the same as the column name in SQL table.
Then we can sink the file names into the SQL table.
Select the table which created previously.
After I run debug, I can see all the file names are saved into the table.
If you want add more infomation, you can reference the post I maintioned previously.

Load file users into the AspNetUsers table

I have an Ms Excel file listing the users of my application. This file contains a set of informations of them(firstname, lastname, email...) but it does not contain the password and of course the Id fields. I want to load this file into the AspNetUsers table defined by the Ms Identity framework. How could i do this task?
thanks for your help
what i can suggest to you is to creat a consolen application or maybe a test Which can get the items from excel and isert them in sql by EF

How to map JPA objects to DB as well as file system

I have a JPA object which is mapped to table in DB and to all the columns. Out of those columns, one column stores the location of a file on file system.
So Whenever I retrieve this data, is it also possible to get the file contents?
Ex: User table is mapped to User object and that User table has column by name picture which stores the url of that file. Whenever I retrieve the Users, can I also retrieve the file contents? If so how does my mapping look like?
No, it's not possible. You'll have to do it by yourself, or store the contents in the file in the database, as a blob, instead of storing it on the file system.

SQLite Manager - Copy table to another .sqlite database

Working on my first iOS App with SQLite database. In Project I have 2 Database, in which First Database is having only one table and the another one is working as a main database. I want to merge those databases into one (the Second one), by copy the table from first database to second database. The First database Table contains more than 32K records. So, I want to copy the entire table with Data.
I want to achieve this using SQLManager AddOn of firefox.
Any Idea?
Instead of SQLManager, You can simply do this with one command line:
$ echo '.dump tablename' | sqlite3 sourcedb | sqlite3 destdb
Export the required table contents in to an excel sheet in sqlite manager and then import the excel file in the target database.
you can see the controls for import and export in sqlite manager itself.
I hope this may help u, since I used it.

How to access Library, File, and Field descriptions in DB2?

I would like to write a query that uses the IBM DB2 system tables (ex. SYSIBM) to pull a query that exports the following:
LIBRARY_NAME, LIBRARY_DESC, FILE_NAME, FILE_DESC, FIELD_NAME, FIELD_DESC
I can access the descriptions via the UI, but wanted to generate a dynamic query.
Thanks.
Along with SYSTABLES and SYSCOLUMNS, there is also a SYSSCHEMAS which appears to contain the data you need. Please note that accessing this information through QSYS2 will restrict rows returned to those objects with which you have some access - the SYSIBM schema appears to disregard this (check the reference - for V6R1 it's about page 1267).
You also shouldn't need to retrieve this with a dynamic query - static with host variables (if necessary) will work just fine.