WinhttpOpenRequest returns error 998 - winhttp

When I use the winhttp client application consecutive times, the WinHttpOpenRequest returns error 998.
bResults = WinHttpOpenRequest( hFileHttp.hConnect, L"POST",
urlCompo.lpszUrlPath,
NULL, WINHTTP_NO_REFERER,
WINHTTP_DEFAULT_ACCEPT_TYPES,
0);
Does anyone have an idea what causes this?

Related

Prisma native query doesn't work.. why? why

Before I post it, I ask to them, But the CS center is not responded.
Here is my code.
const response = await this.prisma
.$queryRaw<Gym>`SELECT * FROM \`Gym\` WHERE \`status\` != 'WITHDRAWAL' LIMIT 1 OFFSET 0;`;
I tried too,
"prisma.$queryRaw`query`",
"prisma.$queryRaw<Model>`query`",
"prisma.$queryRaw<Model[]>`query`",
"prisma.$queryRaw(Prisma.sql`query`)",
"prisma.$queryRaw<Model>(Prisma.sql`query`)"
But, output is error
SELECT * FROM `Gym` WHERE `status` != 'WITHDRAWAL' LIMIT 1 OFFSET 0; []
prisma:error
Invalid `prisma.$queryRaw()` invocation:
Raw query failed. Code: `N/A`. Message: `N/A`
[Nest] 17720 - 2023. 01. 12. 오후 6:09:37 ERROR [ExceptionsHandler]
Invalid `prisma.$queryRaw()` invocation:
Raw query failed. Code: `N/A`. Message: `N/A`
Error:
Invalid `prisma.$queryRaw()` invocation:
Raw query failed. Code: `N/A`. Message: `N/A`
at RequestHandler.handleRequestError (D:\practice_ljy\trainning-api\node_modules\#prisma\client\runtime\index.js:35024:13)
at RequestHandler.handleAndLogRequestError (D:\practice_ljy\trainning-api\node_modules\#prisma\client\runtime\index.js:34996:12)
at RequestHandler.request (D:\practice_ljy\trainning-api\node_modules\#prisma\client\runtime\index.js:34991:12)
at Proxy._request (D:\practice_ljy\trainning-api\node_modules\#prisma\client\runtime\index.js:36082:16)
and the CS center is bad to me.
they don't answer correctly.
I hope that find the answer in here..
my Prisma&client version: 4.8.1
I want to know the cause of failure. the error Code is `N/A`, And I don't recognized.

Why do I keep getting a 500 error when I calling the SoftLayer_Billing_Invoice::getItems interface?

Recently I was developing a project that relied on the softlayer interface. I want get the invoice details about the bare metal server. But I keep getting a 500 error when I call the SoftLayer_Billing_Invoice::getItems interface. And other interfaces are normal.
regards~
code show as below:
client = SoftLayer.create_client_from_env(username="username",
api_key="api_key",
proxy="proxy")
sl_billing_invoice = client['Billing_Invoice']
try:
result = sl_billing_invoice.getItems(id=id)
print result
except SoftLayer.SoftLayerAPIError as sl_exc:
msg = 'result:(%s, %s)' % (sl_exc.faultCode, sl_exc.faultString)
print msg
Return error message as blow:
result:(500, 500 Server Error: Internal Server Error)
The issue is likely that your request is returning a big amount of data, this case commonly happens with invoices and billing items. In order to solve that issue you have the followings options:
Reduce the amount of data through object-masks or using object-filters.
Use pagination (result limits) in order to fetch less data in the request.
result = sl_billing_invoice.getItems(limit=50, offset=0, id=id)
Softlayer doc and similar questions:
https://softlayer.github.io/blog/phil/how-solve-error-fetching-http-headers/
https://softlayer-python.readthedocs.io/en/latest/api/client.html?highlight=limit#making-api-calls
Softlayer getAllBillingItems stopped working?
Getting 500 Internal Server Error from Account.getVirtualGuests()
getInvoices method failing
Getting "error": "Internal Error" on Postman and getting error Can not deserialize instance of java.util.ArrayList out of START_OBJECT token

SQLExecDirect failed but SQLGetDiagRec has no data

I'm trying to setup some useful error handling in a program that used ODBC. According to documentation if SQLExecDirect returns SQL_ERROR I should be able to call SQLGetDiagRec to get SQL_STATE and possibly some messages, but in my tests when I call SQLGetDiagRec right after getting an error from SQLExecDirect I get SQL_NO_DATA returned and no information.
Code:
result = SQLExecDirect(hstmt, <SQL Statement>, SQL_NTS);
if(result == SQL_ERROR)
{
SQLSMALLINT msg_len = 0;
SQLCHAR sql_state[6], message[256];
SQLINTEGER native_error = 0;
result = SQLGetDiagRec(SQL_HANDLE_DBC, hDbc, 1, sql_state, &native_error, message, countof(message), &msg_len);
// Here 'result' is SQL_NO_DATA
....
}
It works in other cases, just not for SQLExecDirect for some reason. I'm also aware that one should cycle through the SQLGetDiagRec results, but if the very first one returns SQL_NO_DATA, according to documentation it means that there are no further ones.
The specific error that I was testing it with was requesting a non-existent table.
Is there anything else that I need to do in order obtain at least an error code, or does the diagnostic not work for errors that result from incorrect SQL requests?
When you call SQLGetDiagRec, pass SQL_HANDLE_STMT and your statement handle (hstmt in your example). That should return errors associated with that specific statement.

PDO rowcount returns 0 even if update is successful

I am using pdo to update a cassandra database and rowCount() returns 0 even if the record is updated (when I go and check with the command line in the db).
How can I see what is wrong?
Thanks,
John.
If something goes wrong, PDO will throw an exception which will spawn a fatal error, and 500 HTTP status as a result. So - check HTTP status to know if anything went wrong.

SQL STATE 37000 [Microsoft][ODBC Microsoft Access Driver] Syntax Error or Access Violation

Good day!
I get this error:
SQL STATE 37000 [Microsoft][ODBC Microsoft Access Driver] Syntax Error
or Access Violation, when trying to run an embedded SQL statement on
Powerscript.
I am using MsSQL Server 2008 and PowerBuilder 10.5, the OS is Windows 7. I was able to determine one of the queries that is causing the problem:
SELECT top 1 CONVERT(DATETIME,:ls_datetime)
into :ldtme_datetime
from employee_information
USING SQLCA;
if SQLCA.SQLCODE = -1 then
Messagebox('SQL ERROR',SQLCA.SQLERRTEXT)
return -1
end if
I was able to come up with a solution to this by just using the datetime() function of PowerBuilder. But there are other parts of the program that is causing this and I am having a hard time in identifying which part of the program causes this. I find this very weird because I am running the same scripts here in my dev-pc with no problems at all, but when trying to run the program on my client's workstation I am getting this error. I haven't found any differences in the workstation and my dev-pc. I also tried following the instructions here, but the problem still occurs.
UPDATE: I was able to identify the other script that is causing the problem:
/////////////////////////////////////////////////////////////////////////////
// f_datediff
// Computes the time difference (in number of minutes) between adtme_datefrom and adtme_dateto
////////////////////////////
decimal ld_time_diff
SELECT top 1 DATEDIFF(MINUTE,:adtme_datefrom,:adtme_dateto)
into :ld_time_diff
FROM EMPLOYEE_INFORMATION
USING SQLCA;
if SQLCA.SQLCODE = -1 then
Messagebox('SQL ERROR',SQLCA.SQLERRTEXT)
return -1
end if
return ld_time_diff
Seems like passing datetime variables causes the error above. Other scripts are working fine.
Create a transaction user object inherited trom transaction.
Put logic in the sqlpreview of your object to capture and log the sql statement being sent to the db.
Instantiate it, connect to the db, and use it in your embedded sql.
Assuming the user gets the error you can then check what was being sent to the db and go from there.
The error in your first statement should be the second parameter to CONVERT function.
It's type is not a string, it's type is an valid expression
https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql
So I would expect that your
CONVERT(DATETIME,:ls_datetime)
would evaluate to
CONVERT(DATETIME, 'ls_datetime')
but it should be
CONVERT(DATETIME, DateTimeColumn)
The error in your second statement could be that you're providing an wrong datetime format.
So please check if your error still occurs when you use this function
https://learn.microsoft.com/en-us/sql/t-sql/statements/set-dateformat-transact-sql
with the correct datetime format you're using