How to get partition type by kernel32 API? - kernel32

Is there a kernel32 API can help us to detect the partition type ( Primary/Logical ) ?
thanks!

I think these links may be of interest:
Example code:
http://forums.codeguru.com/showthread.php?312464-Windows-SDK-File-System-How-to-get-information-about-a-partition
Microsoft docs:
http://support.microsoft.com/kb/139547

Related

Using query as a query parameter

I am using poorly documented API, so I suppose that there is a common practice since they didn't explained the way it should be used. API endpoint supports following query parameters: query (string) and pageNumber (integer) - the part that confuses me is query inside of query.
For example, I want to check all orders with property that has some value: https://api.logsta.com/orders?query=orderIdentifier=106300 but it doesn't work. For me, the natural behaviour would be https://api.logsta.com/orders?orderIdentifier=106300 but this is impossible since they require this query query parameter.
Based on your experience, what should I pass into this query to make it work? Is it a SQL expression or there is a standardized approach?
you can use url encode
?query=orderIdentifier%3D106300
I found the solution, and it works, so I hope that this scenario could be useful to someone.
https://api.logsta.com/orders?query=orderIdentifier:300000169928409
instead of using = again or URL encoding, they are accepting :

Sequelize how to format sequelize.literal('CURRENT_TIMESTAMP') in a query?

I've been trying to compare a date (yyyy-mm-dd) to sequelize.literal('CURRENT_TIMESTAMP') as shown below:
dataagendado: {
[Op.gte]: sequelize.literal('CURRENT_TIMESTAMP')
}
This works for greater than cases but not when the value of dataagendado is equal to today's date. I believe I need to format the CURRENT_TIMESTAMP data. I've been trying to find an answer but all I get are formatting for when a column is created, which doesn't seem to be applicable inside a SELECT query. I've also tried sequelize.fn('NOW') and formatting it but got no luck.
Am I even on the right track? Any help would be greatly appreciated.
Disclaimer: I'm assuming you are using Postgres as the underlying database. If it's not the case, please post your database engine.
You are using sequelize.literal('CURRENT_TIMESTAMP') which resolves in Postgres to NOW(). The NOW() function returns the timestamp with the current time. If you are comparing your date without the timestamp against a date with a timestamp that shouldn't work.
You could use something like this:
dataagendado: {
[Op.gte]: sequelize.literal('now()::Date')
}
In SQL the following happens:
SELECT NOW() => 2021-03-31T07:39:24.518Z
SELECT NOW()::Date => 2021-03-31T00:00:00.000Z
Thanks to staaar's answer I got enough insight to realize that I should be looking for a function in the database's documentation and not in Sequelize's documentation or threads. I'm using MySql as the database so the current date function I should be using looks like this:
dataagendado: {
[Op.lte]: sequelize.literal('CURDATE()')
}
Here's the official documentation, maybe look for something similar in your database's documentation. Best of luck!
Thanks again to user staaar!

How to check information like when, whom,where the greenplum function created in database?

Is there way to get information like when,whom,where the Greenplum database functions created. It is highly appreciated if you could provide me sample queries.
Assuming you have the gp_toolkit schema installed : Try this as a starting point:
SELECT
logtime, loguser, logmessage
FROM
gp_toolkit.gp_log_database
WHERE
logmessage ILIKE '%CREATE FUNCTION%' ;

Using "Point"-Datatype in Phinx-Migration (in CakePhp)

I'm creating an API for POIs and use the POINT-Type to store the coordinates.
As my company uses CakePHP I have to write a migration-script with Phinx.
But I don't have any Idea how to correctly create a column with the POINT-Type.
Sure, I just could make an "ALTER TABLE ..." in a handwritten Query, but maybe there is a better way?
Versions:
Cake: 3.4.7
Phinx: 0.6.5
MySQL: 5.7.18
Phinx Does not provide an adapter for POINT yet.
You should create your query manually.
See also Unable to seed data with POINT datatype #999
Just use "point" as you would use any other datatype as the second parameter of addColumn().
It's just not documented yet.
Credits for this solution are going to #ndm;
I just think it's worth putting this as answer instead as a comment.
Looks like Phinx supports point types for quite some time now (the docs are not up to date)... try to use \Phinx\Db\Adapter\AdapterInterface::PHINX_TYPE_POINT as the type

use nested Query in ESQL on Message Broker

I use this query to find my information in Oracle and it's correctly worked : SELECT A.ACTIONID,A.ACTIONNAME,A.ALLOWWRITE,A.ALLOWREAD FROM THP.TBACTION A WHERE A.ACTIONID IN ( SELECT AP.ACTIONID FROM THP.TBACTION_PROFILE AP WHERE AP.PROFID IN(SELECT P.PROFID FROM THP.TBPROFILE P WHERE P.PROFID IN(SELECT U.PROFID FROM THP.TBUSER U WHERE U.USERID=2 )));
but Now I want use this Query in IBM MESSAGE BROKER on compute Node by ESQL
what do you suggest?
can u please Introduce suitable solution for this question or write theirs syntax...
thanks...
The syntax for nesting itself is the same, but the query syntax is a bit different. Instead of writing FROM THP.TBACTION A you should write FROM Database.THP.TBACTION AS A.
You can find the reference here: http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac06000_.htm
And you should make sure you have specified the data source in the Data source property of the Compute Node.