Dynamic column from powerscript to SQL ?

Dear all,
I've got table trans_comp with column name 'day1' to 'day31' and batch_no as
primary key , I do this in powerscript and It works well
ls_colday = '4'
li_tothour = 10
ls_sql = 'update trans_comp set day' + string(ls_colday) + ' = ' +
string(li_tothour) + " where batch_no = '" +  a_batchno  + "';"
    execute immediate: ls_sql;

The problem is I want to write it down as a trigger in SQLAnywhere10 DB, is
there any way to do this? How to write this syntax into a sql statement ?
Thanks for all your help

0
ekologi
1/15/2011 10:59:20 AM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

0 Replies
844 Views

Similar Articles

[PageSpeed] 45

Reply:

Similar Artilces:

Column Name with Dynamic SQL
Hi, I use DynamicStagingArea for retrieval of a dynamic table. I there any possibility to get the column names for the table? Roland Sattler ...

generating month column with dynamic sql
Can someone help me generate the month column by using dynamic sql with this query: Right now I only have Sept and Oct 08 in the database I hope this makes sense.  SELECT Sort,Reg, SUM(CASE WHEN MONTH(DowrDt)=9 AND YEAR(DowrDt)=2008 THEN PctInt Else 0 END) AS [Sep 08], SUM(CASE WHEN MONTH(DowrDt)=10 AND YEAR(DowrDt)=2008 THEN PctInt Else 0 END) AS [Oct 08], SUM(CASE WHEN MONTH(DowrDt)=11 AND YEAR(DowrDt)=2008 THEN PctInt Else 0 END) AS [Nov 08], SUM(CASE WHEN MONTH(DowrDt)=12 AND YEAR(DowrDt)=2008 THEN PctInt Else 0 END) AS [Dec 08], SUM(CASE WHEN MONTH(DowrDt)=1 AND YEAR(DowrDt)...

Dynamic column names in T-SQL?
Does anyone know of a clever hack that can be used to generate column names on the fly, either from local variables or values in a temp table? Robert Gumpertz wrote: > > Does anyone know of a clever hack that can be used to generate column names > on the fly, either from local variables or values in a temp table? For what purpose? I'm not following where you're going with this? (maybe I need some caffeine?) -- Mark A. Parsons Iron Horse, Inc. This is a reporting application where the user can submit a random list of states; the result is a count by categ...

how to dynamic get the columns list from any sql?
when we use "select * from sometab;" in database administration, PB will show us all the columns in the "sometab" with data. I just wonder how PB can get the columns list? if we can write a same program to do so? Dynamic Cusor? No, its only get the column data. Or, it is just a function provided by the Database environment? if then, with oracle, how can we get the columns list when whatever SQL statement given? Every RDBMS I have seen keeps the table definitions in tables. For Oracle, the view SYS.ALL_TAB_COLUMNS should have what you need, and SELECT is usually...

dynamic sql with variable column name
I want to give select list(columan names) as variable to the dynamic sql statement.. is this possible ? sql statement that I wrote below : string Sqlstatement,sqlst1,Stringvar decimal decvar Sqlstatement = 'SELECT ? FROM TABLE_NAME WHERE TABLE_NAME.COLUMN1 ="'+variable1+'" and & TABLE_NAME.COLUMN2 = "'+variable2+'" and & TABLE_NAME.COLUMN3 = "'+variable3+'" and & TABLE_NAME.COLUMN3 = "'+variable3+'"' PREPARE SQLSA FROM :Sqlstatement ; DESCRIBE ...

Dynamically creating textboxes for each table column in SQL?
Hello! In sql I know you can use 'sp_columns NAMEOFTABLE' and in this list you will see all the column names for which ever table you specified. Now, would it be possible to generate textboxes dynamically for each column in that particular table? If that were possible could you then create a dynamic SQL insert/update statement which would grab whatever the user entered into all the dynamically created textboxes for a particular table and perform a insert/update with the given values? Maybe you can use the DataGrid control in combination with a dynamic SQL statement that only ta...

Dynamic Datagrid
Can anyone help with this issue : I have created an editable dynamic grid with templates and need to update the columns(ie add more or remove columns) in the grid if certain data changes. I have created the datagrid in Sub page_init, but need to add columns when necessary. I think I basically need to know how to call the onInit event from my page when needed to recreated the grid. The onInit should read the data from the dbase and if the are any changes, it will be reflected on the new grid. Thanks ! Simeon You can always call an implementation of the Init event of the page from...

Dynamic SQL in Transact SQL
Does Dynamic SQL can be done in transact sql format in stored procedure? If yes, any reference can be read? Thx..... ...

SQL Injection and Dynamic SQL
The consensus on avoiding SQL injection attacks is to pass all your collected data to a stored procedure. If you have to return a result set from a complex form, the answer seems to be to use dynamic SQL. On further study, I discovered that dynamic SQL has a lot of potential pitfalls and low and behold can still be vulnerable to injection attacks. I know that I am not the first person to ever try and collect data from a web form and return a result set, so what are the best practices? Say I have a complex form with about 25 search criteria (most of which are optional), I go through all t...

Dynamically setting the column name on a SQL query
Can anyone show me or tell if the following is possible. I have a SQL query as shown below: SQL = "SELECT revenue_forecast.oct AS 'revenue' ........... What I need to do is dynamically set the column in this SQL query. So i need to be able to place a variable in the part after the revenue_forecast "." . Can someone show me how to do this? Thanks It depends on your data source, but most data sources do not allow you to parameterize column names. You have a couple of choices. One is to concatenate the name into the string as in... SQL = "SELECT reven...

dynamically adding columns to datagrid from sql statement
hi,i have seen some of the datagrid samples in internet. In most of the cases the datagrid is bind to some table. But if i want to display the output of an sql query(contains select statement with n number of columns) in Datagrid, i can simply use AutogenerateColumns=true and populate the datagrid without having any bound columns. That is fine.If i want to add some more extra columns like a checkbox column and an edit link button column i can do it using property builder. But,the problem is how can i order the columns in datagrid.for example: 1st col: checkboxes        &n...

how do i call a sql column dynamically with a checkbox and search term in textbox
 hi, I have a question regarding calling sql table columns dynamically? workflow would go as:1. user enters search term into a textbox2. user checks a checkbox to search by column in sqldb (eg.. firstname or surname) pseudo sql would go like......SELECT +%column1(checkbox1.value)%+ OR +%column2(checkbox2.value)%+ OR +%column3(checkbox3.value)%+WHERE  column1 = +%TextBox.Text%+ OR column2 = +%TextBox.Text%+ 3. display results in gridview my sql needs to improve greatly so any code insight(good book or link) would be terrific . thanks    ...

PB 8
I managed to use dynamic SQL for a 'normal' column (i.e. with datatype integer). I managed to use embedded SQL for a blob column I did not managed to use dynamic SQL for a blob column (I receive errors) Is it possible to combine those two: Dynamic SQL for a blob Column (towards an Oracle DBMS) and how (example?) ? Regards, Gert Not using the Powerscript functions SELECTBLOB and UPDATEBLOB which are *not* SQL statements and as such cannot participate in dynamic sql. Remember, these are just wrappers around logic for individual DBMS logic required to manipulate bl...

Web resources about - Dynamic column from powerscript to SQL ? - sybase.sqlanywhere.general

Component Object Model - Wikipedia, the free encyclopedia
Component Object Model ( COM ) is a binary-interface standard for software componentry introduced by Microsoft in 1993. It is used to enable ...

Aivosto - Analyze, Document and Flowchart Source Code
Programming tools for software developers. Visustin - Flow chart generator. Project Analyzer - VB code review and optimization.

FilmMakers.com Film Store - Books / Video / Lighting
Home Page Contests Indies Features News Resource Links Advertise With Us Film Makers .com Film Store - Video / Camcorders Digital and Video Editing ...

directzzt - ZZT recreation in .Net, using DirectX and great extensibility - Google Project Hosting
This project aims at building ZZT, offering great new features in terms of gameplay, scripting, all together with being able to use the ZZT-worlds ...

PB Ultimate Suite - Modernize your PowerBuilder Interface
... a wide range of PowerBuilder GUI controls to help you change the look of your PowerBuilder application. All controls are written in pure PowerScript ...

PowerToTheBuilder - PowerBuilder UI Controls
... offers a wide range of GUI controls to help you change the look of your PowerBuilder application. All controls are written in pure PowerScript ...

The Big List of 256 Programming Languages
... OpenCL OpenEdge ABL OPL Oz Paradox Parrot Pascal Perl PHP Pike PILOT PL/I PL/SQL Pliant PostScript POV-Ray PowerBasic PowerScript ...

Java Threads - Real's Threads
Real's HowTo Custom Search Java Language String and Number Applet AWT Swing Environment IO Javascript interaction JDBC Thread Networking JSP ...

Windows XP tips, Vista news, Windows Support, and technology news
Here are some posts that talk about Windows Longhorn, or, Windows Server 2008. Longhorn Server to be christened Windows Server 2008 Microsoft ...

Power.com wants to let you interconnect with all social networks
Power.com, the latest company that wants to bring you social networking Nirvana by letting you update all your profiles from a single place, ...

Resources last updated: 1/1/2016 7:28:28 PM