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

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.

Related

SQL Error [42581]: UCAExc:::5.0.1 unexpected token : INTO required: FROM : line: 2

when I'm trying creating new table in access db via dbeaver using the following code
SELECT *
INTO new_tab
FROM tab
WHERE col_name = smth
I obtain error
"SQL Error [42581]: UCAExc:::5.0.1 unexpected token : INTO required: FROM : line: "
What can be the reason of this problem?
I've updated hsqldb.jar to version hsqldb-2.7.1
Please direct me to way where to dig the neccessary information to resolve this bug

Error saying "Expecting value: line 1 column 1 (char 0) " when retrieving venue for the tip with the greatest number of agree counts

I am using foursquare api to retrieve the venue for the tip with the greatest number of agree counts using requests library in jupyterLab but I am getting this error "Expecting value: line 1 column 1 (char 0)". I am new to using api calls so please help me on how to fix this error. Below is my code:
tip_id = '5ab5575d73fe2516ad8f363b' # tip id
# define URL
url = 'http://api.foursquare.com/v2/tips/{}?client_id={}&client_secret={}&v={}'.format(tip_id, CLIENT_ID, CLIENT_SECRET, VERSION)
# send GET Request and examine results
result=requests.get(url).json()
# .get(url).json()
print(result['response']['tip']['venue']['name'])
print(result['response']['tip']['venue']['location'])
error:
[Error

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.

Apache Pig: ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: can't look backwards more than one token in this stream

I wrote a UDF that returns a string and here is a sample code:
split data into purchased IF ((boolean) (myudf(param)), failed OTHERWISE;
As an example, here is the example of that my udf returns:
split data into purchased IF ((boolean) (retcode == 'SUCCESS')), failed OTHERWISE;
Unfortunately. I get the following error:
Apache Pig: ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: can't look backwards more than one token in this stream
I also tried this:
split data into purchased IF ((boolean) '(retcode == 'SUCCESS')'), failed OTHERWISE;
I get this error:
2015-06-19 10:10:48,330 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <line 11, column 85> Syntax error, unexpected symbol at or near '250.00'
I also tried this:
split data into purchased IF ((boolean) '(retcode == \'SUCCESS\')'), failed OTHERWISE;
I don't get any error, but the I don't get the expected result back.
Any help with this would be great.
That error is thrown because ANTLR can't parse correctly that sentence. Pig should give you a different error showing what is the problem, like it generally does, but it seems the parsing rules for the SPLIT sentence don't take into account what happens when you try to cast the condition.
The problem here is solved simply by removing that cast to boolean:
split data into purchased IF (retcode == 'SUCCESS'), failed OTHERWISE;
That will work.
Why does the cast make it fail? That I don't know. I guess that casting the output of an expression counts as two different expressions, since it has to resolve the inner expression to apply the cast afterwards, and the syntax rule for the split operator does not allow this. 0% sure though.

mongoDB query has got error

I have written a query in mongoDB and got an error. Please some one help me in resolving it
Query is:
> db.Accounts.update(_id:t.source,pendingTransaction:{$ne:t._id}},{$inc:{balance
:-t.value},$push:{pendingTransactions:t._id}});
ERROR IS:
2014-10-10T20:27:02.861+0530 SyntaxError: Unexpected token :
db.Accounts.update({ the { is missing ...
db.Accounts.update({
_id:t.source,
pendingTransaction:{$ne:t._id}},
{$inc:{balance
:-t.value},$push:{pendingTransactions:t._id}});