Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

In SQL Anywhere 11.0, I am using the rteng11 startline. Aware as I am that I can distribute runtime databases if I use no stored procs or triggers, I end all my SQL from the Powerbuilder front end program. I have distributed a small number of program instances. Now, I would like to Alter the DB. No problem with new installations, but must make alterations to databases that are already installed. In the case where I am adding columns, I start by tsting whether the column exists.

-- modify database
select 1 into :li_retcode from systable key join syscolumn 
   where table_name ='project_list' and column_name='in_date';

That works fine then

if li_retcode = 1 then 
   alter table  project_list  drop in_date;
end if

unfortunately the alter table statement (which works in the ISQL tab of the DB painter in Powerbuilder gives me an undeclared variable error.

If I cannot send database alterations to a runtime database how can I proceed?

asked 07 Dec '11, 05:43

MelvynP's gravatar image

MelvynP
90669
accept rate: 0%

edited 11 Dec '11, 15:57

Graeme%20Perrow's gravatar image

Graeme Perrow
9.6k379124


There are some options:

  • bring the database back into the development environment, make the changes, and redeploy the database.
  • create a new database with the altered schema, deploy it, and have a utility application that copies the data from the old db into the new db.
permanent link

answered 07 Dec '11, 08:05

Chris%20Keating's gravatar image

Chris Keating
7.8k49128
accept rate: 32%

edited 11 Dec '11, 15:58

Graeme%20Perrow's gravatar image

Graeme Perrow
9.6k379124

OK, is there a way to unload to a file and load back to a new table that will work with rteng11 nd PB?

Thanks,

Melvyn Polatchek

(07 Dec '11, 10:36) MelvynP
Replies hidden

You can using the UNLOAD statement to unload to a file.

UNLOAD TABLE groupo.departments TO 'departments.csv'

and use LOAD statement to load into a new database:

load table groupo.departments from 'departments.csv'

You cannot unload the database using dbunload utility (or its equivalents) as that generates statements which cannot be executed in the runtime edition.

Another option is to use a PowerBuilder Pipeline to move the data from the old database to the new database.

(07 Dec '11, 11:04) Chris Keating
1

Heads up... AFAIK the runtime engine is no longer available for SQL Anywhere version 12.

(11 Dec '11, 14:56) Breck Carter

Do you have a link on this Breck?

Jeff Gibson

(14 Dec '11, 13:05) Jeff Gibson
2

I don't have a public link, it was mentioned in a post on a private newsgroup; someone had noticed it wasn't shipping with PB 12.5 and the response was that it had been discontinued as of SQL Anywhere 12. There never was much publicity about it so perhaps its demise is being kept under wraps.

(14 Dec '11, 14:40) Breck Carter

PB's ESQL does not understand ALTER TABLE statement ;). However, RTEng does not allow DDL anyway.

permanent link

answered 07 Dec '11, 06:14

Dmitri's gravatar image

Dmitri
1.6k41133
accept rate: 11%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×10
×4

question asked: 07 Dec '11, 05:43

question was seen: 2,999 times

last updated: 14 Dec '11, 14:40