Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Capture SQL Passthrough error
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00685447
Message ID:
00685533
Vues:
14
Hi Russell,

I can trap errors from postgres table as follows:
        Case arcurmst.theunique < 1 And !Deleted()

            ** Remember to phrase the insert

            the_string = "INSERT INTO arcurmst (cno,Type,billcat,Descript,invoice,"+;
                "refer1,trandate,invdate,amount,divno,accountno,cleared,thetime) Values "+;
                "('"+STR(arcurmst.cno,8,0)+"','"+Alltrim(arcurmst.type)+"','"+STR(arcurmst.billcat,8,0)+"','"+;
                ALLTRIM(arcurmst.descript)+"','"+str(arcurmst.invoice,7,0)+"','"+;
                Alltrim(arcurmst.refer1)+"','"+;                  
                IIF( EMPTY(arcurmst.trandate),"now",DTOC(arcurmst.trandate) )+"','"+;
                IIF( EMPTY(arcurmst.invdate),"now",DTOC(arcurmst.invdate) )+"','"+;
                ALLTRIM(str(arcurmst.amount,7,2))+"','"+alltrim(STR(arcurmst.divno,8,0))+"','"+;
                ALLTRIM(arcurmst.accountno)+"','"+Alltrim(arcurmst.cleared)+"','now')"

            = SQLPREPARE(oConnection,the_string)

            mp_ret =SQLEXEC(oConnection)
            If mp_ret < 0
                trans_ok=.F.
                cMessageTitle = 'SQLEXEC - Unable to INSERT row, transactions will be rolled back'
                cMessageText = Message()
                nDialogType = 0 + 64
                *  0 = OK
                *  64 = Information Icon
                nAnswer = Messagebox(cMessageText, nDialogType, cMessageTitle)
Leland F. Jackson, CPA
Software - Master (TM)
smvfp@mail.smvfp.com
Software Master TM
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform