Hi All,
I hope you're well. First, I'd like to mention that I'm not a PowerBuilder developer, but I've been tasked with migrating an old application from SQLAnywhere to PostgreSQL. Without much guidance from the client, I've encountered several concerns and questions about the embedded SQL queries in the application. I would greatly appreciate any insights you can provide.
Here are a few specific queries I'm grappling with:
- SELECT ISNULL(some_id, 0) INTO :my_id from db.table - Since ISNULL is not supported in PostgreSQL, should this be changed to COALESCE? Also, does specifying the schema with .db translate correctly?
- SELECT column_one, column_two INTO :column_one, :column_two FROM db.table - Is multiple data binding supported and will it be transformed correctly in PostgreSQL?
- SELECT IF total IS NULL THEN 1 ELSE 0 ENDIF INTO :total FROM db.table - Do I need to change it to a valid PostgreSQL syntax like SELECT CASE WHEN total IS NULL then 1 ELSE 0 END INTO :total FROM db.table ?
-
SELECT String(DateFormat(some_date,'mm/dd/yy')) INTO :some_date FROM db.table - Do I need to change it to valid PostgreSQL syntax like SELECT TO_CHAR(some_date,'mm/dd/yy') INTO :some_date FROM db.table ?
- ROLLBACK using global.SQLOBJ; - Will this translate to a valid PostgreSQL ROLLBACK query, or do I need to modify it for PostgreSQL compatibility? If modifications are necessary, what changes should I make?
Any guidance on these queries would be highly appreciated. Additionally, if there are other considerations or common pitfalls I should be aware of during this migration, your advice would be invaluable.
Thank you in advance for your help!
Best Regards,
Hristo
Thank you very much for your answers and assistance. Your help is greatly appreciated!
Kind Regards,
Hristo