SQL Programming Manual for TAL
Examples of Dynamic NonStop SQL Programs
HP NonStop SQL Programming Manual for TAL—527887-001
C-32
Detailed Dynamic SQL Program
Page 21 [1] $VOL1.S04.TALDYN     1991-10-15 13:42:28
      free^sqlda
861. 000241 1 1
862. 000241 1 1 END; ! of proc free^sqlda
863. 000000 0 0
Page 22 [1] $VOL1.S04.TALDYN     1991-10-15 13:42:28
cleanup
865. 000000 0 0 PROC cleanup;
866. 000000 1 0 !***************************************************!
867. 000000 1 0 ! PROC cleanup:      !
868. 000000 1 0 ! This proc frees up the allocated memory for the input
          and !
869. 000000 1 0 ! output sqldas and names buffers and the data buffers
         allocated !
870. 000000 1 0 ! for the sqldas. !
871. 000000 1 0 !***************************************************!
872. 000000 1 0 BEGIN
873. 000000 1 1 call free^sqlda(sda^i);
874. 000004 1 1 call free^sqlda(sda^o);
875. 000007 1 1 @sda^i := @sda^o := NULL^ADDR;
876. 000014 1 1
877. 000014 1 1 if @cname^i <> NULL^ADDR then
878. 000021 1 1  begin
879. 000021 1 2  call PUTPOOL(pool^head,cname^i);
880. 000027 1 2  if <> then
881. 000030 1 2  begin
882. 000030 1 3  PUT^STR ("PUTPOOL memory management error");
883. 000046 1 3  PRINT^LINE;
884. 000061 1 3  call ABEND;
885. 000066 1 3  end;
886. 000066 1 2  @cname^i := NULL^ADDR;
887. 000071 1 2  end;
888. 000071 1 1 if @cname^o <> NULL^ADDR then
889. 000076 1 1  begin
890. 000076 1 2  call PUTPOOL(pool^head,cname^o);
891. 000104 1 2  if <> then
892. 000105 1 2  begin
893. 000105 1 3  PUT^STR ("PUTPOOL memory management error");
894. 000123 1 3  PRINT^LINE;
895. 000136 1 3  call ABEND;
896. 000143 1 3  end;
897. 000143 1 2  @cname^o := NULL^ADDR;
898. 000146 1 2  end;
899. 000146 1 1 END;
900. 000000 0 0
901. 000000 0 0










