bb.donnay-software.com

Donnay Software Web Forums
It is currently Wed Feb 20, 2019 8:08 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 55 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
PostPosted: Wed Sep 20, 2017 2:14 pm 
Offline

Joined: Thu Jan 28, 2010 7:07 am
Posts: 586
Location: High SPrings, Florida USA
And, Phil is on facebook..

_________________
Brian Wolfsohn


Top
 Profile  
 
PostPosted: Wed Sep 20, 2017 3:35 pm 
Offline
User avatar

Joined: Tue Feb 09, 2010 3:06 am
Posts: 97
bwolfsohn wrote:
And, Phil is on facebook..

why he´s out programming?

_________________
Pedro Alexandre


Top
 Profile  
 
PostPosted: Mon Sep 25, 2017 8:04 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 1:33 pm
Posts: 349
Location: Republica Dominicana
Hello everyone
I enclose an example of what I can do with the API of Pablo Botella and the Class of Hector Pezoa with Modified by Nolberto Paulino and a LIB for eXpress
Just copy everything in the same folder and run the TEST.EXE for xBase 1.92.355


Attachments:
LIB.ZIP [169.44 KiB]
Downloaded 119 times
TEST.ZIP [322.27 KiB]
Downloaded 118 times
LIBDLL.ZIP [1.79 MiB]
Downloaded 124 times

_________________
Nolberto Paulino
Regards
Top
 Profile  
 
PostPosted: Mon Sep 25, 2017 11:06 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 8:20 am
Posts: 85
Location: Wr.Neustadt / Österreich
Look in your .ZIP - there are ?????~1 Files
what is the right Filename?

_________________
best regards
Hans


Top
 Profile  
 
PostPosted: Mon Sep 25, 2017 11:16 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 1:33 pm
Posts: 349
Location: Republica Dominicana
Connection Error when Creating Table, corrected



hz_scotty wrote:
Look in your .ZIP - there are ?????~1 Files
what is the right Filename?


Attachments:
LIB.ZIP [1.79 MiB]
Downloaded 112 times
TEST.ZIP [172.43 KiB]
Downloaded 110 times

_________________
Nolberto Paulino
Regards
Top
 Profile  
 
PostPosted: Mon Sep 25, 2017 11:58 am 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1101
hi,

i say your "Import" to PostgreSQL. it does not include Memo/Blob so i can't identify what Type is using.
i recommend to use Alaska PostgreSQL Type ... and "internal" Fields to be compatible to Xbase++ v2.x

Code:
   cQuery := "CREATE TABLE " + xtab + " ( "
   
   i := 1
   aStrut := DBSTRUCT()
   FOR i = 1 TO LEN( aStrut )
      cQuery += aStrut[ i, 1 ]
      DO CASE
         CASE aStrut[ i, 2 ] = "C"
            cQuery += " character(" + ALLTRIM( STR( aStrut[ i, 3 ] ) ) + "), "
         CASE aStrut[ i, 2 ] = "N"
            cQuery += " numeric(" + ALLTRIM( STR( aStrut[ i, 3 ] ) ) + ',' + ALLTRIM( STR( aStrut[ i, 4 ] ) ) + "), "
         CASE aStrut[ i, 2 ] = "D"
            cQuery += " date, "

         CASE aStrut[ i, 2 ] = "M"
            IF ::lBlob = .T.
               cQuery += " bytea, "
            ELSE
               cQuery += " text, "
            ENDIF

         CASE aStrut[ i, 2 ] = "L"
            cQuery += " boolean, "

         CASE aStrut[ i, 2 ] = "V"                          // store as HEX String
            cQuery += " bytea, "
      ENDCASE
   NEXT

   // add "internal" Fields
   //
   cQuery += " __deleted    boolean NOT NULL DEFAULT false, "
   cQuery += " __record     serial  NOT NULL, "
   cQuery += " __rowversion integer NOT NULL DEFAULT 0, "
   cQuery += " __keyversion integer NOT NULL DEFAULT 0, "
   cQuery += " __lock_owner integer NOT NULL DEFAULT 0, "

   // Alaska have this
   //
   // CONSTRAINT artikel_pkey PRIMARY KEY (__record)
   //
   cQuery += " CONSTRAINT " + xtab + "_pkey PRIMARY KEY (__record)"

   cQuery += " )"                                           // NEED

also missing : Trigger for Update / Delete
Code:
      //
      // if ISAM Stuff
      //
      IF lAlaskaPGDBE = .T.
         cQuery := "CREATE TRIGGER " + xtab + "_isam_rowversion AFTER UPDATE ON " + ;
                   xtab + " FOR EACH ROW EXECUTE PROCEDURE isam_rowversion_update()"
         oPG:exec( cQuery )
         IF ResultStatus( oPG, oMain )
         ENDIF

         cQuery := "CREATE TRIGGER " + xtab + "_isam_tablemeta AFTER INSERT OR UPDATE OR DELETE ON " + ;
                   xtab + "  FOR EACH ROW EXECUTE PROCEDURE isam_tablemeta_update()"
         oPG:exec( cQuery )
         IF ResultStatus( oPG, oMain )
         ENDIF
      ENDIF

_________________
greetings by OHR
Jimmy


Top
 Profile  
 
PostPosted: Mon Sep 25, 2017 12:12 pm 
Offline
User avatar

Joined: Thu Jan 28, 2010 1:33 pm
Posts: 349
Location: Republica Dominicana
Hello
For the photo fields I do not use bytea because I can not record the photo
but I am using CHARACTER VARYING, and what I do is to encode the photo in 64bit to record it and to recover it I decode it.

cSql: = "ALTER TABLE" + oConn: sChema + "." + lower (cTable) + "ADD photo CHARACTER VARYING"
           oConn: Execute (cSql)


__b64dec and __b64enc of ot4xb.lib by Pablo.



Auge_Ohr wrote:
hi,

i say your "Import" to PostgreSQL. it does not include Memo/Blob so i can't identify what Type is using.
i recommend to use Alaska PostgreSQL Type ... and "internal" Fields to be compatible to Xbase++ v2.x

Code:
   cQuery := "CREATE TABLE " + xtab + " ( "
   
   i := 1
   aStrut := DBSTRUCT()
   FOR i = 1 TO LEN( aStrut )
      cQuery += aStrut[ i, 1 ]
      DO CASE
         CASE aStrut[ i, 2 ] = "C"
            cQuery += " character(" + ALLTRIM( STR( aStrut[ i, 3 ] ) ) + "), "
         CASE aStrut[ i, 2 ] = "N"
            cQuery += " numeric(" + ALLTRIM( STR( aStrut[ i, 3 ] ) ) + ',' + ALLTRIM( STR( aStrut[ i, 4 ] ) ) + "), "
         CASE aStrut[ i, 2 ] = "D"
            cQuery += " date, "

         CASE aStrut[ i, 2 ] = "M"
            IF ::lBlob = .T.
               cQuery += " bytea, "
            ELSE
               cQuery += " text, "
            ENDIF

         CASE aStrut[ i, 2 ] = "L"
            cQuery += " boolean, "

         CASE aStrut[ i, 2 ] = "V"                          // store as HEX String
            cQuery += " bytea, "
      ENDCASE
   NEXT

   // add "internal" Fields
   //
   cQuery += " __deleted    boolean NOT NULL DEFAULT false, "
   cQuery += " __record     serial  NOT NULL, "
   cQuery += " __rowversion integer NOT NULL DEFAULT 0, "
   cQuery += " __keyversion integer NOT NULL DEFAULT 0, "
   cQuery += " __lock_owner integer NOT NULL DEFAULT 0, "

   // Alaska have this
   //
   // CONSTRAINT artikel_pkey PRIMARY KEY (__record)
   //
   cQuery += " CONSTRAINT " + xtab + "_pkey PRIMARY KEY (__record)"

   cQuery += " )"                                           // NEED

also missing : Trigger for Update / Delete
Code:
      //
      // if ISAM Stuff
      //
      IF lAlaskaPGDBE = .T.
         cQuery := "CREATE TRIGGER " + xtab + "_isam_rowversion AFTER UPDATE ON " + ;
                   xtab + " FOR EACH ROW EXECUTE PROCEDURE isam_rowversion_update()"
         oPG:exec( cQuery )
         IF ResultStatus( oPG, oMain )
         ENDIF

         cQuery := "CREATE TRIGGER " + xtab + "_isam_tablemeta AFTER INSERT OR UPDATE OR DELETE ON " + ;
                   xtab + "  FOR EACH ROW EXECUTE PROCEDURE isam_tablemeta_update()"
         oPG:exec( cQuery )
         IF ResultStatus( oPG, oMain )
         ENDIF
      ENDIF

_________________
Nolberto Paulino
Regards


Top
 Profile  
 
PostPosted: Wed Sep 27, 2017 5:03 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 1:33 pm
Posts: 349
Location: Republica Dominicana
Hello
I attach the files to be able to compile.


Attachments:
TEST.ZIP [1006.25 KiB]
Downloaded 115 times
LIB.ZIP [1.79 MiB]
Downloaded 120 times

_________________
Nolberto Paulino
Regards
Top
 Profile  
 
PostPosted: Wed Sep 27, 2017 5:37 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 8:20 am
Posts: 85
Location: Wr.Neustadt / Österreich
See my Picture, that ist from your attached file
look at the filenames!


Attachments:
Z02.jpg
Z02.jpg [ 140.33 KiB | Viewed 4537 times ]
Z01.jpg
Z01.jpg [ 252.93 KiB | Viewed 4537 times ]

_________________
best regards
Hans
Top
 Profile  
 
PostPosted: Wed Sep 27, 2017 8:07 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 1:33 pm
Posts: 349
Location: Republica Dominicana
Thanks for the info
This is happening because I use the PKZIP from DOS, compressed attachment from winrar from windows

Please confirm that it is ok now
Thank you


Attachments:
lib.rar [1.46 MiB]
Downloaded 125 times
test.rar [802.55 KiB]
Downloaded 130 times

_________________
Nolberto Paulino
Regards
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 55 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group