Documentum DQL Query - dql

How to create a new dm_document object using document from local system using DQL? I have tried the following but it's not working:
create dm_document object
SET title = 'TEST',
SET subject = 'TRIAL',
set object_name = 'Test123',
SETFILE 'c:\test.txt' with CONTENT_FORMAT= 'msww'

How do you run this DQL?
If you're doing it via Documentum Administrator, Documentum looks for the file with path 'C:\test.txt' on an application server machine wherer DA runs. So if you want to upload it into documentum you must place this file into appserver machine or use another tool for execution DQL.
And could you please show us an error, that you got

Your DQL works for me (!) but after clean any line-warp, so try this
create dm_document object SET title = 'TEST', SET subject = 'TRIAL', set object_name = 'Test123', SETFILE 'c:\test.txt' with CONTENT_FORMAT= 'msww'
...and be sure there is a such file on Content Server (not local) file system
good luck

Related

Not sure of the correct use IP2Location database

I've used:-
$db = new \IP2Location\Database('./database/IP2LOCATION-LITE-DB3.IPV6.BIN', \IP2Location\Database::FILE_IO);
it seems to work OK.
IP2 docs. says "Class Database, Expects 2 input parameters"
Full path of IP2Location BIN data file. -- OK
File Open Mode. -- Why does it also need "\IP2Location\Database::" ?
Tried not using "\IP2Location\Database::FILE_IO" just using "FILE_IO".

how can I change in memory db to file db In JAVA?

The sqlite configuration in spring boot is
sqlite.datasource.url=jdbc:sqlite::memory:
I confirmed that the data was inserted, but I want to get this sqlite as a real file.
Do you know what to do?
.properties setting
spring.datasource.url=jdbc:sqlite:file:memorydb.db?mode=memory&cache=shared
test code
Connection conn = DriverManager.getConnection("jdbc:sqlite:file:memorydb.db?mode=memory&cache=shared");
Statement stmt = conn.createStatement();
File tmpFile = File.createTempFile(name, ".db");
stmt.executeUpdate("backup to " + tmpFile.getAbsolutePath());
tmpFile.deleteOnExit();
stmt.close();
Not sure why you'd want to do that because normally one would say that they want to move from using an in-memory database to an actual persistence database. So if I'm getting you correctly, you want to know how to write data to a file please refer to this article https://www.journaldev.com/878/java-write-to-file. So being able to write to a file is not an alternative but a database and doing this can co-exist.
Hope this helps ;)

Can the Path assigned a SQLite DB be an arbitrary value?

In this blog post, some prerequisite code for getting started using SQLite in Windows Store Apps is given, for adding to the OnLaunched method of App.xaml.cs:
// Get a reference to the SQLite database
this.DBPath = Path.Combine(
Windows.Storage.ApplicationData.Current.LocalFolder.Path, "customers.sqlite");
My question is: Can I use any arbitrary value to replace the "customers.sqlite" part, or does it have to match something else in my code, such as the name of my table definition class (in my case "PhotraxCoreData.cs" which, according to Mr. Green's suggestion, I added below a newly-created "Models" folder)?
My understanding is that, once I've got those classes defined (I do), and the code above in App.xaml.cs, along with this there (adapted for my SQLite classes):
using (var db = new SQLite.SQLiteConnection(this.DBPath))
{
// Create the tables if they don't exist
db.CreateTable<PhotraxBaseData>();
db.CreateTable<PhotraxNames>();
db.CreateTable<PhotraxQueries>();
}
...SQLite tables based on those classes I specified will be created, and have the name "customers.sqlite" (provided I don't change it).
So, can I use:
this.DBPath = Path.Combine(
Windows.Storage.ApplicationData.Current.LocalFolder.Path, "platypus.sqlite");
...or must it be something like:
this.DBPath = Path.Combine(
Windows.Storage.ApplicationData.Current.LocalFolder.Path, "PhotraxCoreData.sqlite");
That database name is just a file name.
The directory must be accessible by your app, but the file name can be anything.
AS CL says, the file name can be anything the app has direct access to. Windows Store apps have limited access to the file system, so the sqlite database must be in either the apps install location (read only) or it's app data folder (read write). A common pattern is to ship a seed database in the app package and then copy it from the install location to app data on first use so it can be written to.

Moving Symfony Application Local Database to Web

I developed a application on my local system (Windows 7 & wamp)its working fine so I decided to deploy it to my shared hosting account
I create a blank database on server and then imported my local database file
but if try to login to my system I am getting table not found error although table are present in database
I am getting error like below
SQLSTATE[42S02]: Base table or view not found: 1146 Table
'ezwebsto_ezwoms.WomsLog' doesn't exist") in
"AdminBundle:Default:home.html.twig
I suspect that the issue is because case sensitive table name, so renamed table name but still I am facing issue
can anyone guide me what is proper way to move local db of symfony application to web to p
MySQL on Windows by default is NOT case sensitive. On Unix based system it is.
The best practice is to turn on case sensitive in MySQL settings, and in future moving database to server will be simple.
You have to set up variable
lower_case_table_names = 0
in your my.ini file. On Windows, default value is 1.
But now, you have to map table name inside each entity, like wrote #prashant. Please compare table names with mapping names, and rename tables if necessary.
After change, your entity should look like:
/**
* Content
*
* #ORM\Table(name="content")
* #ORM\Entity()
*/
class Content
{
//some usefull code here
}
Just try to define the tablename in your entity class, with the Table annotation:
#ORM\Table(name="WomsLog")
As well make sure your table is correct in DB , W and L must be in upper case.

Drupal - Get image from url and import it into node

Im writing a module for drupal, Im trying to create a node from my module, everything is fine , I only have 1 problem with creating an image , The image exist on different server, so I want to grab the page and insert it , I install module http://drupal.org/project/filefield_sources , which has remote option , I search in the module code , I could not find the function that he used for this process, module work very nice from interface , but how i make it do the job from code ? which function should i call and what parameter should i pass .
I'm over Drupal 6.
Hopefully you're using Drupal 7...
The system_retrieve_file() function will download a file from a remote source, copy it from temp to a specified destination and optionally save it to the file_managed table if you want it to be managed.
$managed = TRUE; // Whether or not to create a Drupal file record
$path = system_retrieve_file($url, 'public://my_files/', $managed);
If you want to get the file object immediately after you've done this, the following is the only way I've found so far:
$file = file_load(db_query('SELECT MAX(fid) FROM {file_managed}')->fetchField());
get fid using $path->fid. no need to mysql

Resources