DBI also sets this array "read-only", which I had to work-around as Sybase can return multiple result sets with varying number of columns.
So DBD::Sybase has this code in the fetch routine:
To summarize - the array that is referenced by $data in the code snippet above is read-only, but each of the items in the array are read-write (hence the assignment to @$data fails, but setting $_ for each undef item works).av = DBIS->get_fbav(imp_sth); num_fields = AvFILL(av)+1; /* XXX The code in the if() below is likely to break with new versions of DBI!!! */ if(num_fields < imp_sth->numCols) { int isReadonly = SvREADONLY(av); if(isReadonly) SvREADONLY_off(av); /* DBI sets this readonly */ i = imp_sth->numCols - 1; while(i >= num_fields) av_store(av, i--, newSV(0)); num_fields = AvFILL(av)+1; if(isReadonly) SvREADONLY_on(av); /* protect against shift @$row etc * +/
Michael
In reply to Re: Re: Modification of a read-only
by mpeppler
in thread Modification of a read-only
by Jonathan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |