Datawindow Simple Dynamic Column adding

Source: Internet
Author: User

Absolutely useful, nowhere to find

// Simple Dynamic Column Addition

// Prepared by xys_777
// Yongsheng 20100404-dynamically add column f_create_delcol
String ls_rt
String ls_dwsyntax, ls_modfiy
Long ll_posbeg, ll_posend
Int I

Ls_dwsyntax = This. Describe ("datawindow. Syntax ")
Ll_posbeg = pos (lower (ls_dwsyntax), "table (column = ")
Do
I ++
Ll_posend = ll_posbeg
Ll_posbeg = pos (lower (ls_dwsyntax), "column =", ll_posbeg + 1)
Loop while ll_posbeg> 0
Ll_posend = pos (lower (ls_dwsyntax ),"~ R ~ N ", ll_posend)
Ls_modfiy = Replace (ls_dwsyntax, ll_posend + 2,1, "column = (type = char (10) name = is_del dbname = ~ "Is_del ~ ")~ R ~ N ")

string error_create
This. create (ls_modfiy, error_create)
If Len (error_create)> 0 then
MessageBox ("", error_create)
end if
This. settransobject (sqlca)
ls_rt = This. modify ('create column (band = detail id = '+ String (I) + 'alignment = "0" tabsequence = 1 border = "0" color = "33554432" x = "23" Y = "8" Height = "76" width = "1000" name = is_del visible = "0" background. color = "536870912") ')
If Len (ls_rt)> 0 then MessageBox ('', ls_rt)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.