I'm trying to install PolicyD v2, but when creating sqlite3 database from sql file it throw errors:
SQLite version 3.7.17 2013-05-20 00:56:22
sqlite> .read /usr/doc/policyd2-2.0.14/policyd2.sqlite
Error: near line 1: unrecognized token: "#"
Error: near line 43: no such table: policies
Error: near line 44: no such table: policies
Error: near line 45: no such table: policies
Error: near line 46: no such table: policies
Error: near line 47: no such table: policies
Error: near line 174: unrecognized token: "#"
Error: near line 215: unrecognized token: "#"
Error: near line 263: no such table: quotas
Error: near line 264: no such table: quotas
Error: near line 303: unrecognized token: "#"
Error: near line 447: no such table: amavis_rules
Error: near line 462: unrecognized token: "#"
Error: near line 570: unrecognized token: "#"
Error: near line 617: unrecognized token: "#"
And /usr/doc/policyd2-2.0.14/policyd2.sqlite looks like this:
line:1 # Core schema
line:2 # Copyright (C) 2009, AllWorldIT
line:3 # Copyright (C) 2008, LinuxRulz
...
/* Policies */
CREATE TABLE policies (
ID INTEGER PRIMARY KEY AUTOINCREMENT,
Name VARCHAR(255) NOT NULL,
Priority SMALLINT NOT NULL,
Description TEXT,
Disabled SMALLINT NOT NULL DEFAULT '0'
) ;
...
line:43 INSERT INTO policies (Name,Priority,Description) VALUES ('Default',0,'Default System Policy');
line:44 INSERT INTO policies (Name,Priority,Description) VALUES ('Default Outbound',10,'Default Outbound System Policy');
line:45 INSERT INTO policies (Name,Priority,Description) VALUES ('Default Inbound',10,'Default Inbound System Policy');
line:46 INSERT INTO policies (Name,Priority,Description) VALUES ('Default Internal',20,'Default Internal System Policy');
line:47 INSERT INTO policies (Name,Priority,Description) VALUES ('Test',50,'Test policy');
Created tables:
sqlite> .tables
checkhelo_blacklist policy_group_members
checkhelo_tracking policy_groups
checkhelo_whitelist policy_members
greylisting_autoblacklist quotas_limits
greylisting_autowhitelist quotas_tracking
greylisting_tracking session_tracking
greylisting_whitelist
I can create 'policies', 'quotas', 'amavis_rules' tables by hand.
So whats wrong here? Other tables were created.
It is caused by console and some malformed (encoding/decoding) characters in file like tab,space,new line.
Solution for this is using grep.
grep -v "#" sql.file | sqlite3 sqlite3.db
Related
this is the statement execute from SNowflake SP.
var sql_Statement = "select regexp_replace ('" + mainSIDColsSrc + "'', 'source_doc:','') " ;
form the query like this :
select regexp_replace ('(trim(NVL(SOURCE_DOC:claimNumber::string,'~')) ||'^'|| trim(NVL(SOURCE_DOC:notificationType::string,'~')) ||'^'|| trim(NVL(SOURCE_DOC:estimateId::string,'~')) ||'^'|| trim(NVL(SOURCE_DOC:assignmentId::string,'~')))'', 'source_doc:','')
if run the above query :
SQL compilation error: syntax error line 1 at position 82 unexpected '~'. syntax error line 1 at position 153 unexpected '~'. syntax error line 1 at position 305 unexpected ':'. parse error line 1 at position 311 near ''.
I have a problem when inserting "0" value into numeric field in PostgreSQL via PHP.
insert into canalis_db.cor_cust_corp_fncl_rprt
(corp_fncl_rprt_id,
customer_id,
rprt_period,
asset) values(
'ca423557-7788-36e3-7788-d36f8c130a83',
'ca4160e2-0189-12b7-e6a6-635819ac9aa2',
'2020',
0)
it well show error message.
Error: ERROR: syntax error at or near "0"
Position: 395
SQLState: 42601
ErrorCode: 0
Is there something error in my sql syntax?
HANA 102.05 fails to execute the following code:
CREATE TABLE ATABLE( f INT );
CREATE PROCEDURE TestProc()
AS
BEGIN
SELECT f FROM ATABLE
FOR UPDATE; -- Without FOR UPDATE it works
END;
SELECT 'Hello' FROM DUMMY;
complaining that:
SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "SELECT": line 8 col 2 (at pos 124)
which points outside the proceudure, at SELECT 'Hello'. The procedure itself compiles without error. The entire script completes successfully if I remove the FOR UPDATE directive. What is wrong with the original?
Update
When I execute the same query from hdbsql.exe I get:
0 rows affected (overall time 26,076 msec; server time 6518 usec)
* 257: sql syntax error: line 5 col 9 (at pos 71) SQLSTATE: HY000
* 257: sql syntax error: incorrect syntax near "END": line 2 col 1 (at pos 32) SQLSTATE: HY000
'Hello'
"Hello"
1 row selected (overall time 4644 usec; server time 143 usec)
I have xml file abc.xml in \\192.168.1.71\err_log
I did below steps and getting error:
create directory XMLDIR2 as '\\192.168.1.71\err_log';
GRANT ALL ON DIRECTORY xmldir2 TO PUBLIC;
INSERT INTO example2
VALUES ( xmltype (
bfilename('XMLDIR2', 'abc.xml'),
nls_charset_id('AL32UTF8')
)
);
Getting below error:
ERROR at line 4: ORA-22288: file or LOB operation FILEOPEN failed
ORA-06512: at "SYS.XMLTYPE", line 296 ORA-06512: at line 1
i am facing error wile running this in sql server 2000
bcp "select dmedocno ,dmename,dmeauthor,dmekeywords from document
where repositoryid=4 and dmedocno between 1 and 60000 order by
dmedocno" queryout c:\LR_Query29_cutover_19_August.csv -Swsapp0772 -T -c -t","
Error is:
Server: Msg 103, Level 15, State 7, Line 1
The identifier that starts with 'select dmedocno ,dmename,dmeauthor,dmekeywords from document where repositoryid=4 and dmedocno between 1 and 60000 order by dmed' is too long. Maximum length is 128.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'queryout'.
why your sql server treats the query as identifier? hm...
Check default QUOTED_IDENTIFIER option for the server, try to set it to OFF