PostrgreSQL error 3

  1. 4 months ago

    Tim S

    May 9 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    Hello all.

    I get an error 3 (ERROR: current transaction is aborted, commands ignored until end of transaction block) whenever I try to create a table.

    This code does not work:

    Dim S As String = "CREATE TABLE defaults_controller (server_ip character(20),ping_interval integer,activitysummary_update_interval integer,transaction_sync_interval INTEGER,serverport smallint,"
    S = S + "noresponsetimeout smallint,disconnect_delay smallint,master_loginid character(50),master_pw character(30),corp_id INTEGER,site_id INTEGER PRIMARY KEY,device_cpu_serial CHAR(64),"
    S = S + "ui_id INTEGER,user_pw CHAR(30),license_path CHAR(255),data_path CHAR(255),auto_print CHAR(1),langauge CHAR(25),date_format CHAR(10),in_debug_mode INTEGER,ip_update_interval INTEGER,"
    S = S + "ip_update_retries INTEGER,resend_cmd_interval INTEGER,resend_cmd_max_retries INTEGER,listen_port INTEGER, mac_address CHAR(18) );"
    
    db.SQLExecute(s) 

    This code does - from the samples:

    Dim S As String = "CREATE TABLE defaults_controller (server_ip character(20),ping_interval integer,activitysummary_update_interval integer,transaction_sync_interval INTEGER,serverport smallint,"
    S = S + "noresponsetimeout smallint,disconnect_delay smallint,master_loginid character(50),master_pw character(30),corp_id INTEGER,site_id INTEGER PRIMARY KEY,device_cpu_serial CHAR(64),"
    S = S + "ui_id INTEGER,user_pw CHAR(30),license_path CHAR(255),data_path CHAR(255),auto_print CHAR(1),langauge CHAR(25),date_format CHAR(10),in_debug_mode INTEGER,ip_update_interval INTEGER,"
    S = S + "ip_update_retries INTEGER,resend_cmd_interval INTEGER,resend_cmd_max_retries INTEGER,listen_port INTEGER, mac_address CHAR(18) );"
    
    mDB.SQLExecute(s) //(sql)
      

    I don't see what the difference is. Both are executing but only 1 works.

    Any ideas what I am doing wrong?
    Tim

    Found it!
    Was doing another transaction prior to this that was left incomplete.

    Thanks for your help!
    Tim

  2. Tim P

    May 9 Pre-Release Testers Rochester, NY

    They're executing on different databases.

  3. Tim S

    May 9 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    Hi Tim.

    Yes, they are. I changed it to the same database "axcys" and the same result. The sample worked, mine did not!
    What does "ERROR: current transaction is aborted, commands ignored until end of transaction block" mean? I removed the START TRANSACTION command and no difference.
    Tim

  4. Tim S

    May 9 Pre-Release Testers, Xojo Pro Answer Phoenix Arizona USA

    Found it!
    Was doing another transaction prior to this that was left incomplete.

    Thanks for your help!
    Tim

  5. Tim P

    May 9 Pre-Release Testers Rochester, NY

    Sorry, that was the only difference I saw.

  6. Tim S

    May 9 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    It got me thinking!
    Another question - I use DATETIME in SQLite. What is the equivalent in PostgreSQL?

    Tim

  7. Maximilian T

    May 9 Pre-Release Testers, Xojo Pro Europe, Germany, Berlin

    timestamp without time zone . Not sure if SQLite's Datetime is with or without time zone and too lazy to check right now.

  8. Jean-Yves P

    May 9 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    SQLite does not have a storage class for storing dates and/or times. Instead, the built-in Date and Time Functions of SQLite are capable of storing dates and times as TEXT , REAL , or INTEGER values: TEXT as ISO8601 strings (“YYYY-MM-DD HH:MM:SS.SSS”).

  9. Ivan T

    May 10 Pre-Release Testers

    @Tim S Found it!
    Was doing another transaction prior to this that was left incomplete.

    Thanks for your help!
    Tim

    Mak this as answer

  10. Tim S

    May 10 Pre-Release Testers, Xojo Pro Phoenix Arizona USA

    Thanks for the help everyone!
    Tim

or Sign Up to reply!