AT+ Command to delete "[sms dilivery] status reports"? - sms

I'm trying to delete 'status reports' in the device using the following code-list:
AT
: OK
AT+CMGF=1
: OK
AT+CPMS="SR"
: +CPMS: 4,100,0,45,4,100
AT+CMGD=50
: ERROR
Note: there is a 'status report' available at the index:50.
Could you tell me what causes this error?
Thanks.

According to "ETSI TS 100 585",
0: "REC UNREAD"
1: "REC READ"
2: "STO UNSENT"
3: "STO SENT"
4: "ALL"
so maybe you can try "AT+CMGL=4" to see if it works.
If it works, you can use "at+cmgd=index" to delete the SMS you want

Related

NEAR "ExecutionError":"Exceeded the prepaid gas."

I'm going through the tutorial in https://near.academy/near101/chapter-6
One of the steps is to run this command (but with my account):
near call museum.testnet add_meme \
'{"meme" : "bob", "title" : "god", "data" : "https://9gag.com/gag/ad8K0vj", "category" : 4}' \
--accountId YOUR_ACCOUNT_NAME.testnet --amount 3
I keep getting errors like:
Log [museum.testnet]: attempting to create meme
Failure [museum.testnet]: Error: {"index":0,"kind":{"ExecutionError":"Exceeded the prepaid gas."}}
Transaction 9F9VUps6nN4myC8wzBUb1W1GTR4xV5WE had 30000000000000 of attached gas but used 2428115526258 of gas
It's a confusing error message because 30,000,000,000,000 > 2,428,178,132,410.
I have also tried running the command with --amount 4 instead, but I got the same error.
What am I doing wrong?
Benji at https://discord.com/channels/490367152054992913/542945453533036544/912840246524260355 suggested that instead of using --amount 3 I use --amount 3 --gas=75000000000000, which worked.
If you are using windows then you should use backslash , before every ".
near call museum.testnet add_meme '{"meme" : "Bob", "title" : "Jokes", "data" : "https://9gag.com/gag/aAGQ97L", "category" : 4}' --accountId NAME.testnet --amount 3 --gas=75000000000000

SparkR Write into a Parquet file

I am trying to write a data frame into a parquet format. The data frame is
str(test)
'data.frame': 365 obs. of 4 variables:
$ id : chr "Apple" "Apple" "Apple" "Apple" ...
$ text : chr "譲渡 拡散希望\npsychopass サイコパス トレーディングラバーストラップ 宜野座伸元\n特典円通常円送料にてお譲りします検索からでもお"| truncated "retweet\n\npeachpanther albumin the world right now" "haarlem vacature internet strateeg opzoek naar cto software architectlead developer star applehaarl" "ในอายทเทากน\nผหญงมความเปนผใหญมากกวาผชาย\nไมมผชายคนไหนไปไดสวยกบผหญงอายเทากนไดหรอก\n you are the a""| truncated ...
$ emotion : chr "unknown" "unknown" "unknown" "unknown" ...
$ polarity: chr "positive" "positive" "positive" "positive" ...
When i try to use write.parquet i get the following error
write.parquet(test,"hdfs://xxx.xxx.xxx.xxx:9000/orcladv/intdata/processedtweets")
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘write.parquet’ for signature ‘"data.frame", "character"’
Has anyone faced this issue. Please help me solve this.
Regards
Bala
"data.frame" in the error message indicates you are using an R data.frame. The write.parquet() function you are using operates on Spark DataFrames not R data.frames.
Details of how to convert between the two here: https://spark.apache.org/docs/latest/sparkr.html#creating-dataframes

DBD::Oracle::st execute failed: system generated message

For oracle system generated Software Error messages during prepare/execute query invalid. displays complete query to user on a webpage. want to replace system generated message with user common message.
example:
Software error:
DBD::Oracle::st execute failed: ORA-01722: invalid number (DBD ERROR: error possibly near <> indicator at char 136 in 'SELECT EQUIPID, EQUIPSHORTNAME, MAXLIMITEDDAYS, STATUS, EQUIPNAME FROM LAB_EQUIPMENT_DETAILS WHERE CATEGORYID = '3' AND SUBCATEGORYID = <>' ' AND STATUS != 'DELETE'') [for Statement "SELECT EQUIPID, EQUIPSHORTNAME, MAXLIMITEDDAYS, STATUS, EQUIPNAME FROM LAB_EQUIPMENT_DETAILS WHERE CATEGORYID = '3' AND SUBCATEGORYID = '****' AND STATUS != 'DELETE'"] at /proj/aa/bb/Source/Global_Routines_general_apps.pm line 126.
For help, please send mail to the webmaster ([...]), giving this error message and the time and date of the error.
Can anyone please help me in doing this.
Thanks in advance.
Simply wrap your execute statement in an eval block and catch the error.
eval {
$sth->execute();
...
};
if ( $# ) {
# log the full error message
write_log( $sth->errstr );
# and re-throw the common message
die 'HEY!!!! Something is messed up here!';
}

Executing SQL Script using OSQL do not return resultcode

I am executing some sql queries using OSQL through inno setup. I am using following code to run OSQL. This is just for example purpose
SQLQuery:= '"EXEC sp_addserver ''PCNAME'';"';
Param:= '-S(local) -Usa -Psa -Q ' + SQLQuery;
Exec('osql.exe', Param, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
This works fine. The problem is ResultCode value is always 0. Even if the query does not get executed. For example if I try same query like below where I pass in an invalid stored procedure name the ResultCode is still 0.
SQLQuery:= '"EXEC sp_invalidname ''PCNAME'';"';
Param:= '-S(local) -Usa -Psa -Q ' + SQLQuery;
Exec('osql.exe', Param, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
Why don't this return me a proper code. If I run the second query in management studio I get an error like this
Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'sp_invalidname'
Here return code is 2812. Why dont I get this when I run it through inno. What do I need to do to get this error code in inno?
Thanks to TLama, I updated my code as below and its working now. I had to add -b command line parameter and now it returns 1 if the command fails.
-b
Specifies that osql exits and returns a DOS ERRORLEVEL value when an error occurs. The value returned to the DOS ERRORLEVEL variable is 1 when the SQL Server error message has a severity of 11 or greater; otherwise, the value returned is 0. Microsoft MS-DOS batch files can test the value of DOS ERRORLEVEL and handle the error appropriately.
I updated my code as below.
Param:= '-S(local) -Usa -Psa -b -Q ' + SQLQuery;
Its explained in the documentation.

How to properly use Alias in Codeigniter

Here is my code:
$this->db->select('course_name AS Course Name,course_desc AS Course Description,display_public AS Display Status',FALSE);
$this->db->from('courses');
$this->db->where('tennant_id',$tennant_id);
$this->db->order_by('course_name','ASC');
$query = $this->db->get();
and I got an error:
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Name, course_desc AS Course Description, display_public AS Display Status FROM (' at line 1
and I got an error:
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Name, course_desc AS Course Description, display_public AS Display Status FROM (' at line 1
SELECT course_name AS Course Name,
course_desc AS Course Description,
display_public AS Display Status
FROM (`courses`) WHERE `tennant_id` = 'elicuarto#apploma.com'
ORDER BY `course_name` ASC
Filename: C:\wamp\www\coursebooking\system\database\DB_driver.php
Line Number: 330
Try
$this->db->select('course_name AS `Course Name`, course_desc AS `Course Description`, display_public AS `Display Status`', FALSE);
It's the space in your alias that is messing with you.
UPDATE
I'm not sure why you would want to, but I see nothing preventing you from writing
$this->db->select("course_name AS `{$variable}`", FALSE);
(showing just one field for simplicity)
UPDATE 2
Should be standard string conversion so I don't know why it doesn't work for you.. there's always split strings...
$this->db->select('course_name AS `' . $variable . '`', FALSE);

Resources