Arsip: Ask table exist di zeos

 
user image
more 16 years ago

ferry

mohon bantuannya para master delphi saya pake : delphi 6 zeos 6 postgre 8.1 gimana caranya ngecek table nya ada apa nggak. kalo di BDE bisa pake if table.exist kalo di zeos gimana caranya ya?? sudah coba cari di artikel belum nemu. thanks & best regards
user image
more 16 years ago

ImanD

@ferry ini salah satu cara di MySQL, sapa tau bisa di postgre 8.1 [sql]SHOW TABLES WHERE Tables_in_DATABASENAME='TABLENAME'[/sql]
user image
more 16 years ago

ferry

masih bingung neh...caranya gmana ya?pake zmetadata?apa gimana. simplenya saya mau query data di table tapi ngecek dulu table nya ada apa nggak. kalo ada querynya dijalanin kalo nggak showmessage aja
user image
more 16 years ago

ImanD

@ferry nah lo, sql tadi maksudnya u/ cek apakan ada ga table tersebut sample simple

with ZQuery1 do
begin
  Close;
  SQL.Text:='SHOW TABLES WHERE Tables_in_databasecobacoba='+QuotedStr('tabelbarang');
  Open;
  if not isEmpty then
    // silakan mo ngapain
  else
    ShowMessage('ga ada tuh tablenya');
end;
user image
more 16 years ago

ferry

"Tables_in_databasecobacoba" diganti apa ya?databasename apa schema?
user image
more 16 years ago

ImanD

coba nama database nya apa dan table yg akan di cari apa? ni sample di MySQL ya mudah2an jalan di Postgre
user image
more 16 years ago

DelphiExpert

@ferry: sampean kurang explorasi... komponen DBConnection zeos sudah menyediakan basic metadata info, misal: DB.GetTableNames() ... silahkan explore methods / property komponent tsb...
user image
more 16 years ago

ferry

Case Closed try zquery1.Close; zquery1.SQL.text:='select from Table1'; zquery1.Open; except zquery1.Close; try showmessage('tablenotfoud'); zquery1.SQL.text:='select from Table2'; zquery1.ExecSQL; zquery1.Open; except end; Thanks buat Saran nya
user image
more 16 years ago

ichan29

@ferry: Case Closed try zquery1.Close; zquery1.SQL.text:='select from Table1'; zquery1.Open; except zquery1.Close; try showmessage('tablenotfoud'); zquery1.SQL.text:='select from Table2'; zquery1.ExecSQL; zquery1.Open; except end;
kok malah gini???, oh nyari fields kali ya, bukan table.. ato di postgre 8.1 apa memang nyari table spt itu
user image
more 16 years ago

ferry

cari table bos.. table1 itu table yg di cek ada apa nggak, kalo ada jalanin query, kalo gak ada ganti pake table 2
more ...
  • Pages:
  • 1
  • 2
Share to

AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now: https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com