OutParmtype boundary exceeded

Hej.

I'm trying to make a dynamic sql but I ran into some problems.

I get this error Array boundary exceeded in the OutParmtype[i] when i is 10. 
What us wrong.

What I'm trying is writing a script that can handle input from a sql no 
matter how many rows and columns. Then it should send it to a word document. 
But this stops me.

Is there anyone who can figure this out!

Thanks

Here are the code

String ls_stringvar, Sqlstatement, ls_bookmark, ls_document, ls_arr[]
Integer  Intvar, i, ll_Column, ll_ColumnCount, ll_rowcount, ll_column_count, 
ll_col

i=0
ll_column_count = 9

Sqlstatement = "Select * from customer where id < 101"

PREPARE SQLSA FROM :Sqlstatement ;
DESCRIBE SQLSA INTO SQLDA ;

DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA ;

OPEN DYNAMIC my_cursor USING DESCRIPTOR SQLDA ;

FETCH my_cursor USING DESCRIPTOR SQLDA ;

DO WHILE SQLCA.SQLCode = 0
 For ll_col = 1 to ll_column_count
  i = i + 1
  CHOOSE CASE sqlda.OutParmtype[i]
   CASE TypeString!
    ls_stringvar = Getdynamicstring(SQLDA, i )
   CASE TypeInteger!
    ls_stringvar = string(GetDynamicNumber(SQLDA, i) )
   CASE TypeBoolean!
    ls_stringvar = GetDynamicString(SQLDA, i)
   CASE TypeDate!
    ls_stringvar = String(GetDynamicDate(SQLDA, i) )
   CASE TypeDateTime!
    ls_stringvar = String(GetDynamicDateTime(SQLDA, i) )
   CASE TypeDecimal!
    ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
   CASE TypeDouble!
    ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
   CASE TypeLong!
    ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
   CASE TypeReal!
    ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
   CASE TypeTime!
    ls_stringvar = String(GetDynamicTime(SQLDA, i) )
   //CASE TypeUInt!
   //CASE TypeULong!
   CASE TypeUnknown!
  END CHOOSE
  ls_arr[i] = ls_stringvar
 NEXT
LOOP

CLOSE my_cursor ; 


0
Allan
3/24/2006 3:37:53 PM
sybase.powerscript 7704 articles. 0 followers. Follow

2 Replies
432 Views

Similar Articles

[PageSpeed] 20

try setting ll_column_count to sqlda.NumOutputs, and then
use ll_col instead of i as the second argument in all your
dynamic calls.

Note that on row 2 of the results i starts at 10.

> Hej.
>
> I'm trying to make a dynamic sql but I ran into some
> problems.
>
> I get this error Array boundary exceeded in the
> OutParmtype[i] when i is 10.  What us wrong.
>
> What I'm trying is writing a script that can handle input
> from a sql no  matter how many rows and columns. Then it
> should send it to a word document.  But this stops me.
>
> Is there anyone who can figure this out!
>
> Thanks
>
> Here are the code
>
> String ls_stringvar, Sqlstatement, ls_bookmark,
> ls_document, ls_arr[] Integer  Intvar, i, ll_Column,
> ll_ColumnCount, ll_rowcount, ll_column_count,  ll_col
>
> i=0
> ll_column_count = 9
>
> Sqlstatement = "Select * from customer where id < 101"
>
> PREPARE SQLSA FROM :Sqlstatement ;
> DESCRIBE SQLSA INTO SQLDA ;
>
> DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA ;
>
> OPEN DYNAMIC my_cursor USING DESCRIPTOR SQLDA ;
>
> FETCH my_cursor USING DESCRIPTOR SQLDA ;
>
> DO WHILE SQLCA.SQLCode = 0
>  For ll_col = 1 to ll_column_count
>   i = i + 1
>   CHOOSE CASE sqlda.OutParmtype[i]
>    CASE TypeString!
>     ls_stringvar = Getdynamicstring(SQLDA, i )
>    CASE TypeInteger!
>     ls_stringvar = string(GetDynamicNumber(SQLDA, i) )
>    CASE TypeBoolean!
>     ls_stringvar = GetDynamicString(SQLDA, i)
>    CASE TypeDate!
>     ls_stringvar = String(GetDynamicDate(SQLDA, i) )
>    CASE TypeDateTime!
>     ls_stringvar = String(GetDynamicDateTime(SQLDA, i) )
>    CASE TypeDecimal!
>     ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
>    CASE TypeDouble!
>     ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
>    CASE TypeLong!
>     ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
>    CASE TypeReal!
>     ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
>    CASE TypeTime!
>     ls_stringvar = String(GetDynamicTime(SQLDA, i) )
>    //CASE TypeUInt!
>    //CASE TypeULong!
>    CASE TypeUnknown!
>   END CHOOSE
>   ls_arr[i] = ls_stringvar
>  NEXT
> LOOP
>
> CLOSE my_cursor ;
>
>
0
Jeremy
3/29/2006 12:40:52 AM
It would have been SIGNIFICANTLY easier to use SyntaxFromSQL
and create a dataobject from it...
>
> I'm trying to make a dynamic sql but I ran into some
> problems.
>
> I get this error Array boundary exceeded in the
> OutParmtype[i] when i is 10.  What us wrong.
>
> What I'm trying is writing a script that can handle input
> from a sql no  matter how many rows and columns. Then it
> should send it to a word document.  But this stops me.
>
> Is there anyone who can figure this out!
>
> Thanks
>
> Here are the code
>
> String ls_stringvar, Sqlstatement, ls_bookmark,
> ls_document, ls_arr[] Integer  Intvar, i, ll_Column,
> ll_ColumnCount, ll_rowcount, ll_column_count,  ll_col
>
> i=0
> ll_column_count = 9
>
> Sqlstatement = "Select * from customer where id < 101"
>
> PREPARE SQLSA FROM :Sqlstatement ;
> DESCRIBE SQLSA INTO SQLDA ;
>
> DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA ;
>
> OPEN DYNAMIC my_cursor USING DESCRIPTOR SQLDA ;
>
> FETCH my_cursor USING DESCRIPTOR SQLDA ;
>
> DO WHILE SQLCA.SQLCode = 0
>  For ll_col = 1 to ll_column_count
>   i = i + 1
>   CHOOSE CASE sqlda.OutParmtype[i]
>    CASE TypeString!
>     ls_stringvar = Getdynamicstring(SQLDA, i )
>    CASE TypeInteger!
>     ls_stringvar = string(GetDynamicNumber(SQLDA, i) )
>    CASE TypeBoolean!
>     ls_stringvar = GetDynamicString(SQLDA, i)
>    CASE TypeDate!
>     ls_stringvar = String(GetDynamicDate(SQLDA, i) )
>    CASE TypeDateTime!
>     ls_stringvar = String(GetDynamicDateTime(SQLDA, i) )
>    CASE TypeDecimal!
>     ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
>    CASE TypeDouble!
>     ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
>    CASE TypeLong!
>     ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
>    CASE TypeReal!
>     ls_stringvar = String(GetDynamicNumber(SQLDA, i) )
>    CASE TypeTime!
>     ls_stringvar = String(GetDynamicTime(SQLDA, i) )
>    //CASE TypeUInt!
>    //CASE TypeULong!
>    CASE TypeUnknown!
>   END CHOOSE
>   ls_arr[i] = ls_stringvar
>  NEXT
> LOOP
>
> CLOSE my_cursor ;
>
>
0
Philip
3/30/2006 8:16:33 PM
Reply:

Similar Artilces:

array boundary exceeded
How much records can an unbounded string array handle in PowerBuilder? I use an unbounded String array in my code. Normally, It works fine, but I got this "array boundary exceeded" error when the code put big amount of data (like 40,000) to this array? So I'd like to know how much data PowerBuilder Array can handle. Thanks very much. Connie ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp Please don't crosspost. I just answered you in the General newsgroup. "Connie Wang" <chunping@yahoo.co...

array boundary exceeded
How much records can an unbounded string array handle in PowerBuilder? I use an unbounded String array in my code. Normally, It works fine, but I got this "array boundary exceeded" error when the code put big amount of data (like 40,000) to this array? So I'd like to know how much data PowerBuilder Array can handle. Thanks very much. Connie ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp Theoretically, it's only limited to the amount of memory available on your machine. Are you, perhaps, using an INT va...

Jag Error: Array boundary exceeded...
Hello everyone, I hope someone can help with this error we've been recieving ever since we upgraded to C3. I have a case open with Sybase, but they aren't being very helpful... Anyway, here's the error I see in svr.log: Error: Array boundary exceeded at line 29 in function of_convert_value of object nv_retreival_arg. Aug 28 12:07:05 2000: PowerBuilder Application Execution Error (R0003) Application terminated. Apparently, this is a Sybase component? This error occurs when we open a page with an HTML datawinow on it. For some reason it seems to only occur on pages...

array boundary exceeded error in pfc_n_cst_tvsrv
Hi friends, I am facing a problem with of_searchchild function of pfc_n_cst_tvsrv, I get array boundary exceeded error at line 54. Also I get this error only when I run the executable, from development environment it works fine ... i don't get any error messages. I was wondering if this is a known problem and if anybody could give me any leads on this. Environment : PB 6.5 / PFC / Windows 95 / Sybase 11.5 Thanks, Shafi. ...

New partition boundary beyond device boundary
Netware 6.0 SP5 Dell PowerEdge 4600 Server with Perc2 RAID controller All NSS volumes We added a drive to an existing RAID 5 array and expanded it using Dell's FASTCLI utility. Everything went perfect. Used ConsoleOne to define a new Netware partition on a portion of the additional free space created by the RAID expansion and added that partition to one of the NSS pools. Still, no problem. Everything's happy and humming along. Then, again in ConsoleOne, went through the process of defining another partition on the remaining free space to add it to another Pool. ...

powerscript ++
//----------------------------------------- integer li_step = 2 FOR ll_i = 1 TO 10 STEP li_step //do something NEXT //----------------------------------------- = syntax error //----------------------------------------- FOR ll_i = 1 TO 10 STEP 2 //do something NEXT //----------------------------------------- = ok //----------------------------------------- any la_abc[] la_abc = {'somestring', 1} //----------------------------------------- = syntax error //----------------------------------------- any la_abc[] la_abc[1] = 'somestring&#...

Page number
What I do... - create a dynamic datawindow with X number of columns (days in a data range) - sometimes this datawindow will extend beyond the 'right hand margin' and will print 'multiple pages' for a 'single page' report ...which is fine and desired (ie. additional pages are printed for the 'other columns' that do not fit on the first page). What I need to do is have a page counter on ALL printed pages that represent the 'ACTUAL' page numbers. For example, a datawindow is created with X number of columns and n number of rows... ...

Dynamic Powerscript
This is a multipart message in MIME format. --=_alternative 0042B50485256AF0_= Content-Type: text/plain; charset="us-ascii" As part of a validation routine we want to pop up a list of field errors, and the field that contains the error. We want to register the field, and get a pointer to the window,tab, tab page, dw, and field, then when the user moves to an error row in the popup window do something like ... w_child.SetFocus() w_child.tab_1.SetFocus() w_child.tab_1.SelectTab ('tab_page_1' ) w_child.tab_1.tab_page_1.dw_1.SetFocus() w_child.tab_1.tab_page_1....

Transaction Boundary
I have following situation. Transaction 1 Beg Connect to the database Update/Insert Transaction 2 beg Connect Update Commit Disconnect end Update/Insert Commit or rollback Disconnect End I am using embedded SQL for update/insert. I am creating separate transaction object, and connecting to the database. The Idea is even if transaction 1 fails, transaction should commit, if successful. Now what's happening that, if transaction 1 fails, transaction 2 does not commit. I am using PB6.5 and Oracle 8.0.3.0.0 on...

Word boundaries
For our spam classifier I need to split the text into words. Unfortunately the '\b' regex does not yet work for languages with no spaces (apparently it is covered in the level 3 of unicode support http://unicode.org/reports/tr18/#Tailored_Word_Boundaries) - so I need some custom solution. This did not seem very difficult - just split the text into blocks of same unicode script and then use '\b' for most of the scripts and appropriate libraries for the rest (at least for Chinese there are some tokenizers on CPAN) - but: 1. How can I split the text into blocks of same ...

VBScript and PowerScript
Has anyone ever managed to "integrate" vbscript with PB? The user wants to be able to customize window/datawindow behaviour during runtime , according to his needs. I have seen an ERP application he uses that's written in Delphi which allows the users to use VBscript to customize the forms , objects , validations , make things happen on various application's events , etc. Could this happen with PB? Any suggestions , docs? Txs Christos Ioannou "Christos Ioannou" <stoppamming_christos_ioannou@yahoo.com> wrote in message news:4187d408$1...

Powerscript limitation
Hi to All! Please read http://community.borland.com/article/1,1410,10328,00.html I think many things really need to be included in new PB version: 2. PowerScript limitations PowerBuilder uses its own proprietary language called PowerScript, the syntax of which has been described as similar to C and/or Basic. Although it may share some lineage -- it is neither. The language has many limitations including but not limited to: Not Object-Oriented No Pointers No Inheritance No Exception Handling No Run-Time Type Information No Linked Lists No Inline Assembler No Set Handli...

Locks Exceeded
Hello, I am populating a table using insert/select into from table A to table B. While I am running this command, I am seeing locks accumulate to the 5000 lock maximum specified in sp_configure. Why does this not escalate to a table lock at the 200 lock threshold? Yes, sp_configure lock threshold is set to 200. Thanks, -- Robert C. Marx SQL Financials International 770.291.8506 MarxR@SFI.com Rob Marx wrote: > > Hello, > > I am populating a table using insert/select into from table A to table > B. > While I am running this com...

timeout exceeded
We have a Netware 6.5 SP5 running GW 7.02 GWIA within a DMZ. We have an issue sending to a certain address, I have taken the error out of the GWIA logs below (removing the company info etc) :- 15:51:43 10A MSG 43977 Command: cafebar.se 15:51:43 10A MSG 43977 Response: 220 ************************************ 15:51:43 10A MSG 43977 Command: EHLO xxxxxxxxxxxxx.com 15:51:43 10A MSG 43977 Response: 250 ok 15:51:43 10A MSG 43977 Command: MAIL FROM:<Virginie.Waszak@autobar.com> 15:51:43 10A MSG 43977 Response: 250 Ok 15:51:43 10A MSG 43977 Command: RCPT TO:<xxxxxx...

Web resources about - OutParmtype boundary exceeded - sybase.powerscript

Resources last updated: 11/28/2015 4:17:35 PM