如何将 Powerbuilder Query 转换为 Oracle
Posted
技术标签:
【中文标题】如何将 Powerbuilder Query 转换为 Oracle【英文标题】:How to convert Powerbuilder Query to Oracle 【发布时间】:2021-12-26 07:49:32 【问题描述】:我在一家公司工作,该公司有一个在 power builder 中编码的程序。我完全不知道这个。可悲的是我的前辈离开了,但我想将该程序转换为 Oracle。 所以我需要重新生成它。 首先,有没有关于这个“转换的东西”的好文档?
retrieve = "PBSELECT( VERSION(400) TABLE(NAME=~" saldo_stok ~ " ) TABLE(NAME=~" rekening ~ " ) COLUMN(NAME=~" saldo_stok.urutan ~ ")
COLUMN(NAME=~" saldo_stok.gudang ~ ") COLUMN(NAME=~" rekening.nama_jenisjurnal ~ ") COLUMN(NAME=~" saldo_stok.kode_rekening ~ ")
COLUMN(NAME=~" saldo_stok.nama_barang ~ ") COLUMN(NAME=~" saldo_stok.sat_hitung2 ~ ") COLUMN(NAME=~" saldo_stok.saldo_awal ~ ")
COMPUTE(NAME=~" ~~~ "saldo_stok~~~".~~~ "SALDO_AWAL~~~" *~~~ "saldo_stok~~~".~~~ "HARGA~~~" AS SALDO_AWAL_NILAI ~ ")
COLUMN(NAME=~" saldo_stok.mutasi_debet ~ ") COMPUTE(NAME=~" ~~~ "saldo_stok~~~".~~~ "MUTASI_DEBET~~~" *~~~ "saldo_stok~~~".~~~ "HARGA~~~" AS MUTASI_DEBET_NILAI ~ ") COLUMN(NAME=~" saldo_stok.mutasi_keluar ~ ") COMPUTE(NAME=~" ~~~ "saldo_stok~~~".~~~ "MUTASI_KELUAR~~~" *~~~ "saldo_stok~~~".~~~ "HARGA~~~" AS MUTASI_KELUAR_NILAI ~ ") COLUMN(NAME=~" saldo_stok.saldo_akhir ~ ") COMPUTE(NAME=~" ~~~ "saldo_stok~~~".~~~ "SALDO_AKHIR~~~" *~~~ "saldo_stok~~~".~~~ "HARGA~~~" AS SALDO_AKHIR_NILAI ~ ") COLUMN(NAME=~" saldo_stok.harga ~ ") COLUMN(NAME=~" saldo_stok.tgl_terima ~ ") COLUMN(NAME=~" saldo_stok.refference ~ ") COLUMN(NAME=~" saldo_stok.kode_barang ~ ") JOIN (LEFT=~" saldo_stok.kode_rekening ~ " OP =~" =~ "RIGHT=~" rekening.nomer_rekjurnal ~ " OUTER1 =~" saldo_stok.kode_rekening ~ " )WHERE( EXP1 =~" (
( ~~~ "saldo_stok~~~".~~~ "NAMA_BARANG~~~" ~ " OP =~" LIKE ~ " EXP2 =~" : brg ) ~ " LOGIC =~"
AND ~ " ) WHERE( EXP1 =~" ( ~~~ "saldo_stok~~~".~~~ "USER_ID~~~" ~ " OP =~" =~ " EXP2 =~" : usr ) ~ " LOGIC =~"
AND ~ " ) WHERE( EXP1 =~" ( ~~~ "saldo_stok~~~".~~~ "SALDO_AWAL~~~" ~ " OP =~" <>~ " EXP2 =~" 0 )
) ~ " ) ) ARG(NAME = ~" brg ~ " TYPE = string) ARG(NAME = ~" usr ~ " TYPE = number) ARG(NAME = ~" hak ~ " TYPE = string) " arguments = ( ( "brg", string ), ( "usr", NUMBER ), ( "hak", string ) ) sort = "saldo_rek A nama_barang A saldo_stok_urutan A sat_hitung2 A "
) GROUP (
LEVEL = 1 header.height = 84 trailer.height = 0 BY = ( "saldo_rek" ) header.color = "536870912" header.transparency = "0" header.gradient.color = "8421504" header.gradient.transparency = "0" header.gradient.angle = "0" header.brushmode = "0" header.gradient.repetition.MODE = "0" header.gradient.repetition.count = "0" header.gradient.repetition.length = "100" header.gradient.focus = "0" header.gradient.scale = "100" header.gradient.spread = "100" trailer.color = "536870912" trailer.transparency = "0" trailer.gradient.color = "8421504" trailer.gradient.transparency = "0" trailer.gradient.angle = "0" trailer.brushmode = "0" trailer.gradient.repetition.MODE = "0" trailer.gradient.repetition.count = "0" trailer.gradient.repetition.length = "100" trailer.gradient.focus = "0" trailer.gradient.scale = "100" trailer.gradient.spread = "100"
) GROUP (
LEVEL = 2 header.height = 4 trailer.height = 4 BY = ( "nama_barang", "harga", "sat_hitung2" ) header.color = "536870912" header.transparency = "0" header.gradient.color = "8421504" header.gradient.transparency = "0" header.gradient.angle = "0" header.brushmode = "0" header.gradient.repetition.MODE = "0" header.gradient.repetition.count = "0" header.gradient.repetition.length = "100" header.gradient.focus = "0" header.gradient.scale = "100" header.gradient.spread = "100" trailer.color = "536870912" trailer.transparency = "0" trailer.gradient.color = "8421504" trailer.gradient.transparency = "0" trailer.gradient.angle = "0" trailer.brushmode = "0" trailer.gradient.repetition.MODE = "0" trailer.gradient.repetition.count = "0" trailer.gradient.repetition.length = "100" trailer.gradient.focus = "0" trailer.gradient.scale = "100" trailer.gradient.spread = "100"
)
【问题讨论】:
你到底在转换什么?申请代码?应用程序使用的数据库?单独的 SQL 命令?不知道你在说什么“隐蔽的东西”。 在power builder中编写的代码,查询。 【参考方案1】:您所看到的不是大多数 PowerBuilder 开发人员通常会看到的。您向我们展示的是:
导出(通常不用于查看代码) DataWindow 的一部分 以图形格式存储的 DW 查询图形格式是……嗯,首先,它应该在 PowerBuilder IDE 中以(剧透警告)图形演示文稿的形式呈现。不仅如此,它还旨在以某种中性的语法存储,以便可以根据所使用的数据库驱动程序以稍微不同的方式将其转换为 SQL。我所见过的将图形语法转换为 SQL 的任何努力都忽略了驱动因素,所以我从未见过通用的。 (另外,考虑到当 PB 必须在运行时转换为 SQL 时,以图形方式存储会对性能产生轻微影响,我从未发现它非常流行,因此对转换实用程序的需求并不大。)
我强烈建议放弃导出并查看 PowerBuilder IDE 中的查询。您会以正常的 SQL 格式看到它。
【讨论】:
感谢您的解释,因为我很困惑该怎么做以上是关于如何将 Powerbuilder Query 转换为 Oracle的主要内容,如果未能解决你的问题,请参考以下文章