PostgreSQL native from Phil Ide
Re: PostgreSQL native from Phil Ide
And, Phil is on facebook..
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
breadmanbrian@bsky.social
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
breadmanbrian@bsky.social
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: PostgreSQL native from Phil Ide
why he´s out programming?bwolfsohn wrote:And, Phil is on facebook..
Pedro Alexandre
Re: PostgreSQL native from Phil Ide
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
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 1720 times
-
- TEST.ZIP
- (322.27 KiB) Downloaded 1698 times
-
- LIBDLL.ZIP
- (1.79 MiB) Downloaded 1691 times
Nolberto Paulino
Regards
Regards
Re: PostgreSQL native from Phil Ide
Look in your .ZIP - there are ?????~1 Files
what is the right Filename?
what is the right Filename?
best regards
Hans
Hans
Re: PostgreSQL native from Phil Ide
Connection Error when Creating Table, corrected
hz_scotty wrote:Look in your .ZIP - there are ?????~1 Files
what is the right Filename?
Nolberto Paulino
Regards
Regards
Re: PostgreSQL native from Phil Ide
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
also missing : Trigger for Update / Delete
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: Select all
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
Code: Select all
//
// 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
Jimmy
Re: PostgreSQL native from Phil Ide
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.
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
also missing : Trigger for Update / DeleteCode: Select all
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
Code: Select all
// // 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
Regards
Re: PostgreSQL native from Phil Ide
Hello
I attach the files to be able to compile.
I attach the files to be able to compile.
Nolberto Paulino
Regards
Regards
Re: PostgreSQL native from Phil Ide
See my Picture, that ist from your attached file
look at the filenames!
look at the filenames!
- Attachments
-
- Z02.jpg (140.33 KiB) Viewed 41788 times
-
- Z01.jpg (252.93 KiB) Viewed 41788 times
best regards
Hans
Hans
Re: PostgreSQL native from Phil Ide
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
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
Nolberto Paulino
Regards
Regards