Jump to content


- - - - -

Returning variables to PRO4 from PLSQL?


23 replies to this topic

#16 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 16 April 2004 - 06:18 AM

Pinoy,

That's a very good tip. Thanks.

Regards,

Joseph

#17 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 16 April 2004 - 12:06 PM

Anyone else remember the days when PRO-IV was a portable language?

#18 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 16 April 2004 - 04:54 PM

Guest,

Anyone else remember the days when PRO-IV was a portable language?


I'm not sure what you mean by this. We have one source library that supports clients on very divergent platforms:

OS's: Unix, Windows
Databases: ProISAM, Oracle, SQL Server, PostgreSQL
ProIV versions: 4.6, 5.5

Some parts of the system require additional coding: reports, dynamic SQL generation, etc.

However, I have to give high marks to ProIV for portability.

Regards,

Joseph

#19 Guest_kwong_*

Guest_kwong_*
  • Guests

Posted 21 April 2004 - 09:47 AM

I have tried using this ...


SQL
BEGIN
SELECT SUM(A) INTO :##VAR(#K) FROM TABLE
END;
ENDSQL


Its give me problem.... if I dont use ARRAY in pro4, its work well... Any suggestion if I wanna use the array variable in PRO4???

Other wise I have to re-write this statement 10 times... because i need to loop the record in table 10 times.

Thanks!!

#20 Chris Mackenzie

Chris Mackenzie

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 368 posts
  • Gender:Male
  • Location:Bristol, United Kingdom

Posted 21 April 2004 - 10:32 AM

jm2c, you should write this as P4 cycle for ease
of maintenance. Then you can put the result into
the array in AR-NE.

But why can't it be like the following?

IF BLAH
K = 1
$WHERE = 'BLAHBALH'
ELSE
K = 2
$WHERE = 'XYZ'
ENDIF
SQL
BEGIN
SELECT SUM(A) INTO :##TEMP FROM TABLE
END;
ENDSQL
##VAR(#K) = ##TEMP

?
The content and views expressed in this message are those
of the poster and do not represent those of any organisation.

#21 Guest_kwong_*

Guest_kwong_*
  • Guests

Posted 22 April 2004 - 12:33 AM

Good idea man!!!

hehe... expert really expert!!!

I will try on it!!!


Thanks a lot!!

#22 Guest_kwong_*

Guest_kwong_*
  • Guests

Posted 22 April 2004 - 05:38 AM

Already tried on it.


Thanks chris!!! It worked well!!!


best regards

#23 guesty_mcguest

guesty_mcguest

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 23 April 2004 - 03:18 AM

:-"
You may want to  try this code to get count , sum or total.

SQL
  BEGIN
    SELECT COUNT(*) INTO :#VAR
    WHERE CLAUSE ;
  END ;
ENDSQL


I've been unable to get this to work - thought it was maybe because I'm on 4.6.

I was putting the code in a global logic - seemed an ideal place for it. Turns out it doesn't work there.

Exactly the same code in a funtion works fine. :)

#24 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 23 April 2004 - 02:21 PM

questy,

I haven't tried this yet, but I'm wondering if the answer is simply that you need to say

SQL DYNAMIC

instead of SQL.

When we were originally told about using variables in SQL, we were instructed to say SQL DYNAMIC

hth,

Joseph



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users