cancel
Showing results for 
Search instead for 
Did you mean: 

Copying object definition from Sybase IQ

Former Member
0 Kudos

How do we take an object definition (eg: compiled proc code) into flat file in Sybase IQ 15 . Something similar to "defncopy" in Sybase ASE. defncopy in IQ 15 does not seem to work . Is there any other command line utility to obtain the object definitions from the database

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Thanks all. Will try the options mentioned here and get back with results . We need it to be done through the unix command utilities of sybase as using sybase control and power designer is not an option for us .

Former Member
0 Kudos

Hi

I developed a set of stored procedures that allow to retrieve DDL statements of various IQ objects, including stored procedures. The stored procedures can be downloaded and used for free, see http://www.gvirtz-consulting.com/downloads.

Hope it helps

Leonid Gvirtz

Former Member
0 Kudos

If you want only the stored procedures, then the following code will generate one file per procedure in /tmp:

select proc_name, proc_defn into #zzz from sp_iqprocedure();
set temporary option temp_extract_name1='procs.txt';
set temporary option temp_extract_directory='/tmp';
select proc_name, trim(proc_name)+'.txt' from #zzz;
select bfile('/tmp/'+trim(proc_name)+'.sql', proc_defn) from #zzz;

Cheers,

Dan

former_member185199
Contributor
0 Kudos

you could Use SAP Powerdesigner to reverseengenieer the db into a model and then create the scripts for a new target Db, if this is a onetime-job get a trial Version of PD16.5

regards

DJ

Former Member
0 Kudos


You can use Sybase Central 6.x -> choose 'Contents' tab -> double click 'Procedures & Functions' folder -> point to your desired procedure name -> right click mouse and choose 'Copy' ,

then open a notepad and choose 'Paste' to put create procedure DDL into notepad !!

this is a alternative way to retrieve creating object DDL in Sybase IQ 12.7 and above !!

Hope this will help !!

Thanks !!

Regards,

Robert Chu