Sponsored Content
Full Discussion: mysql syntax error ?
Special Forums UNIX and Linux Applications mysql syntax error ? Post 302337423 by Scott on Friday 24th of July 2009 05:59:50 AM
Old 07-24-2009
Hi.

Should it not be:

Code:
PRIMARY KEY USING BTREE(  `id` ),

Code:
Your SQL query has been executed successfully (Query took 0.0847 sec)

SQL query:
CREATE TABLE IF NOT EXISTS `jos_taoj` (
`id` INT( 10 ) NOT NULL AUTO_INCREMENT ,
`extension` VARCHAR( 100 ) NOT NULL COMMENT 'The extension',
`version` VARCHAR( 16 ) NOT NULL COMMENT 'Version number',
`installed_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Date-time modified or installed',
`log` MEDIUMTEXT,
PRIMARY KEY USING BTREE(
`id` 
),
KEY `idx_extension` ( `extension` ) 
) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =2;

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies

2. AIX

nim mksysb error :/usr/bin/savevg[33]: 1016,07: syntax error

-------------------------------------------------------------------------------- Hello, help me please. I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? : Command : failed stdout: yes stderr: no... (9 Replies)
Discussion started by: astjen
9 Replies

3. Shell Programming and Scripting

sed error : Syntax error: redirection unexpected

My script is throwing the error 'Syntax error: redirection unexpected' My line of code.. cat nsstatustest.html | sed s/<tr><td align="left">/<tr><td align="left" bgcolor="#000000"><font color="white">/ > ztmp.Ps23zp2s.2-Fpps3-wmmm0dss3 HTML tags are getting in the way but they're needed to... (3 Replies)
Discussion started by: phpfreak
3 Replies

4. Programming

Newbie Question.. -> error: syntax error before ';' token

Hello, the following is generating a error at the line "tmprintf(&tmBundle, _TMC("{0}"),Prompt);"... a bit lost as I am diving into this debug... Thank you in advance... int H_YesNo(TMCHAR *Prompt, int DefVal) { TMCHAR YesNo = '\0'; tmprintf(&tmBundle, _TMC("{0}"),Prompt); while... (3 Replies)
Discussion started by: reelflytime
3 Replies

5. Shell Programming and Scripting

Receiving error: ./ang.ksh[35]: 0403-057 Syntax error at line 116 : `done' is not expected.

Hi All I am quite new to Unix. Following is a shell script that i have written and getting the subject mentioned error. #!/bin/ksh #------------------------------------------------------------------------- # File: ang_stdnld.ksh # # Desc: UNIX shell script to extract Store information.... (3 Replies)
Discussion started by: amitsinha
3 Replies

6. Shell Programming and Scripting

syntax issue with quotes in mysql command for a bash script

i'm trying to write a bash script that executes a mysql statement mysql -sN -e INSERT INTO "$database"."$tableprefix"users (var1, var2,var3) VALUES (123, '1','') i don't know where to put the quotes it doesnt work with this one: ` it seems i can only put double quotes around the... (0 Replies)
Discussion started by: vanessafan99
0 Replies

7. Shell Programming and Scripting

syntax issue mysql in bash script

I'm running mysql in a bash script mysql <<EOF query EOF one query is like this: UPDATE $dbname.$prefix"config" SET value = $var WHERE "$prefix"config.name = 'table colname'; with variable but it's giving an error i'm not sure what to put for "$prefix"config.name the table... (3 Replies)
Discussion started by: vanessafan99
3 Replies

8. Linux

Ambiguous redirect error and syntax error when using on multiple files

Hi, I need help on following linux bash script. When I linux commands for loop or while loop on individual file it runs great. but now I want the script to run on N number of files so it gives me ambiguous redirect error on line 12 and syntax error on line 22 : (pls help ); #!/bin/bash #... (16 Replies)
Discussion started by: Madhusudan Das
16 Replies

9. Shell Programming and Scripting

IF section problem. syntax error: unexpected end of file error

Hello, I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time. My script: returned=`tail -50 SapLogs.log | grep -i "Error"` echo $returned if ; then echo "There is no errors in the logs" fi And after... (10 Replies)
Discussion started by: jedzio
10 Replies
GAMMU-SMSD-PGSQL(7)						       Gammu						       GAMMU-SMSD-PGSQL(7)

NAME
gammu-smsd-pgsql - gammu-smsd(1) backend using PostgreSQL database server as a message storage DESCRIPTION
PGSQL backend stores all data in a PostgreSQL database server, which parameters are defined by configuration (see gammu-smsdrc for descrip- tion of configuration options). For tables description see gammu-smsd-tables. This backend is based on gammu-smsd-sql. CONFIGURATION
Before running gammu-smsd you need to create necessary tables in the database, which is described below. The configuration file then can look like: [smsd] service = sql driver = native_pgsql host = localhost See also gammu-smsdrc CREATING TABLES
SQL script for creating tables in PostgreSQL database: -- -- Database: "smsd" -- -- CREATE USER "smsd" WITH NOCREATEDB NOCREATEUSER; -- CREATE DATABASE "smsd" WITH OWNER = "smsd" ENCODING = 'UTF8'; -- connect "smsd" "smsd" -- COMMENT ON DATABASE "smsd" IS 'Gammu SMSD Database'; -- -------------------------------------------------------- -- -- Function declaration for updating timestamps -- CREATE LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION update_timestamp() RETURNS trigger AS $update_timestamp$ BEGIN NEW."UpdatedInDB" := LOCALTIMESTAMP(0); RETURN NEW; END; $update_timestamp$ LANGUAGE plpgsql; -- -------------------------------------------------------- -- -- Sequence declarations for tables' primary keys -- --CREATE SEQUENCE inbox_ID_seq; --CREATE SEQUENCE outbox_ID_seq; --CREATE SEQUENCE outbox_multipart_ID_seq; --CREATE SEQUENCE pbk_groups_ID_seq; --CREATE SEQUENCE sentitems_ID_seq; -- -------------------------------------------------------- -- -- Index declarations for tables' primary keys -- --CREATE UNIQUE INDEX inbox_pkey ON inbox USING btree ("ID"); --CREATE UNIQUE INDEX outbox_pkey ON outbox USING btree ("ID"); --CREATE UNIQUE INDEX outbox_multipart_pkey ON outbox_multipart USING btree ("ID"); --CREATE UNIQUE INDEX pbk_groups_pkey ON pbk_groups USING btree ("ID"); --CREATE UNIQUE INDEX sentitems_pkey ON sentitems USING btree ("ID"); -- -------------------------------------------------------- -- -- Table structure for table "daemons" -- CREATE TABLE daemons ( "Start" text NOT NULL, "Info" text NOT NULL ); -- -- Dumping data for table "daemons" -- -- -------------------------------------------------------- -- -- Table structure for table "gammu" -- CREATE TABLE gammu ( "Version" smallint NOT NULL DEFAULT '0' ); -- -- Dumping data for table "gammu" -- INSERT INTO gammu ("Version") VALUES(13); -- -------------------------------------------------------- -- -- Table structure for table "inbox" -- CREATE TABLE inbox ( "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "ReceivingDateTime" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "Text" text NOT NULL, "SenderNumber" varchar(20) NOT NULL DEFAULT '', "Coding" varchar(255) NOT NULL DEFAULT 'Default_No_Compression', "UDH" text NOT NULL, "SMSCNumber" varchar(20) NOT NULL DEFAULT '', "Class" integer NOT NULL DEFAULT '-1', "TextDecoded" text NOT NULL DEFAULT '', "ID" serial PRIMARY KEY, "RecipientID" text NOT NULL, "Processed" boolean NOT NULL DEFAULT 'false', CHECK ("Coding" IN ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')) ); -- -- Dumping data for table "inbox" -- -- -------------------------------------------------------- -- -- Create trigger for table "inbox" -- CREATE TRIGGER update_timestamp BEFORE UPDATE ON inbox FOR EACH ROW EXECUTE PROCEDURE update_timestamp(); -- -------------------------------------------------------- -- -- Table structure for table "outbox" -- CREATE TABLE outbox ( "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "InsertIntoDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "SendingDateTime" timestamp NOT NULL DEFAULT LOCALTIMESTAMP(0), "SendBefore" time NOT NULL DEFAULT '23:59:59', "SendAfter" time NOT NULL DEFAULT '00:00:00', "Text" text, "DestinationNumber" varchar(20) NOT NULL DEFAULT '', "Coding" varchar(255) NOT NULL DEFAULT 'Default_No_Compression', "UDH" text, "Class" integer DEFAULT '-1', "TextDecoded" text NOT NULL DEFAULT '', "ID" serial PRIMARY KEY, "MultiPart" boolean NOT NULL DEFAULT 'false', "RelativeValidity" integer DEFAULT '-1', "SenderID" varchar(255), "SendingTimeOut" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "DeliveryReport" varchar(10) DEFAULT 'default', "CreatorID" text NOT NULL, CHECK ("Coding" IN ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')), CHECK ("DeliveryReport" IN ('default','yes','no')) ); CREATE INDEX outbox_date ON outbox("SendingDateTime", "SendingTimeOut"); CREATE INDEX outbox_sender ON outbox("SenderID"); -- -- Dumping data for table "outbox" -- -- -------------------------------------------------------- -- -- Create trigger for table "outbox" -- CREATE TRIGGER update_timestamp BEFORE UPDATE ON outbox FOR EACH ROW EXECUTE PROCEDURE update_timestamp(); -- -------------------------------------------------------- -- -- Table structure for table "outbox_multipart" -- CREATE TABLE outbox_multipart ( "Text" text, "Coding" varchar(255) NOT NULL DEFAULT 'Default_No_Compression', "UDH" text, "Class" integer DEFAULT '-1', "TextDecoded" text DEFAULT NULL, "ID" serial, "SequencePosition" integer NOT NULL DEFAULT '1', PRIMARY KEY ("ID", "SequencePosition"), CHECK ("Coding" IN ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')) ); -- -- Dumping data for table "outbox_multipart" -- -- -------------------------------------------------------- -- -- Table structure for table "pbk" -- CREATE TABLE pbk ( "ID" serial PRIMARY KEY, "GroupID" integer NOT NULL DEFAULT '-1', "Name" text NOT NULL, "Number" text NOT NULL ); -- -- Dumping data for table "pbk" -- -- -------------------------------------------------------- -- -- Table structure for table "pbk_groups" -- CREATE TABLE pbk_groups ( "Name" text NOT NULL, "ID" serial PRIMARY KEY ); -- -- Dumping data for table "pbk_groups" -- -- -------------------------------------------------------- -- -- Table structure for table "phones" -- CREATE TABLE phones ( "ID" text NOT NULL, "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "InsertIntoDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "TimeOut" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "Send" boolean NOT NULL DEFAULT 'no', "Receive" boolean NOT NULL DEFAULT 'no', "IMEI" varchar(35) PRIMARY KEY NOT NULL, "Client" text NOT NULL, "Battery" integer NOT NULL DEFAULT -1, "Signal" integer NOT NULL DEFAULT -1, "Sent" integer NOT NULL DEFAULT 0, "Received" integer NOT NULL DEFAULT 0 ); -- -- Dumping data for table "phones" -- -- -------------------------------------------------------- -- -- Create trigger for table "phones" -- CREATE TRIGGER update_timestamp BEFORE UPDATE ON phones FOR EACH ROW EXECUTE PROCEDURE update_timestamp(); -- -------------------------------------------------------- -- -- Table structure for table "sentitems" -- CREATE TABLE sentitems ( "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "InsertIntoDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "SendingDateTime" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0), "DeliveryDateTime" timestamp(0) WITHOUT time zone NULL, "Text" text NOT NULL, "DestinationNumber" varchar(20) NOT NULL DEFAULT '', "Coding" varchar(255) NOT NULL DEFAULT 'Default_No_Compression', "UDH" text NOT NULL, "SMSCNumber" varchar(20) NOT NULL DEFAULT '', "Class" integer NOT NULL DEFAULT '-1', "TextDecoded" text NOT NULL DEFAULT '', "ID" serial, "SenderID" varchar(255) NOT NULL, "SequencePosition" integer NOT NULL DEFAULT '1', "Status" varchar(255) NOT NULL DEFAULT 'SendingOK', "StatusError" integer NOT NULL DEFAULT '-1', "TPMR" integer NOT NULL DEFAULT '-1', "RelativeValidity" integer NOT NULL DEFAULT '-1', "CreatorID" text NOT NULL, CHECK ("Status" IN ('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending', 'DeliveryUnknown','Error')), CHECK ("Coding" IN ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')), PRIMARY KEY ("ID", "SequencePosition") ); CREATE INDEX sentitems_date ON sentitems("DeliveryDateTime"); CREATE INDEX sentitems_tpmr ON sentitems("TPMR"); CREATE INDEX sentitems_dest ON sentitems("DestinationNumber"); CREATE INDEX sentitems_sender ON sentitems("SenderID"); -- -- Dumping data for table "sentitems" -- -- -------------------------------------------------------- -- -- Create trigger for table "sentitems" -- CREATE TRIGGER update_timestamp BEFORE UPDATE ON sentitems FOR EACH ROW EXECUTE PROCEDURE update_timestamp(); Note You can find the script in docs/sql/pgsql.sql as well. UPGRADING TABLES
The easiest way to upgrade database structure is to backup old one and start with creating new one based on example above. For upgrading existing database, you can use changes described in smsd-tables-history and then manually update Version field in gammu ta- ble. AUTHOR
Michal iha <michal@cihar.com> COPYRIGHT
2009-2012, Michal iha <michal@cihar.com> 1.31.90 February 24, 2012 GAMMU-SMSD-PGSQL(7)
All times are GMT -4. The time now is 09:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy