[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] how to run a SQL procedure in SQR program



The end-if is there.  It just needs to be aligned with the if statement

-----Original Message-----
From: Mike Eischen [mailto:MEISCHEN@genesco.com]
Sent: Friday, December 19, 2003 2:05 PM
To: sqr-users@sqrug.org
Subject: Re: [sqr-users] how to run a SQL procedure in SQR program



That should work, however you need an end-if to go with your if.

begin-procedure get_customer_id
begin-select
customer_id &customer_id
 let $customer_id = &customer_id
 if $customer_id = '103'
 do get_policy_number
 do insert_address($policy_number_nph) ---- is the procedure written in the
SQL
end-if
from contract
where contract.customer_id = '103'
end-select


>>> chandrashekar_patlolla@yahoo.com 12/19/03 12:35PM >>>
Hi All
 
I have an SQR program and i want to call a SQL procedure in that sqr
program, and i am doing it this way. Is this the right way to do it.
 
begin-procedure get_customer_id
begin-select
customer_id &customer_id
 let $customer_id = &customer_id
 if $customer_id = '103'
 do get_policy_number
 do insert_address($policy_number_nph) ---- is the procedure written in the
SQL
end-if
from contract
where contract.customer_id = '103'
end-select




end-procedure

 
Any help is appreciated
 
Thanks and Regards
Chandra
chandrashekar patlolla <chandrashekar_patlolla@yahoo.com> wrote:
begin-select
a.x1
b.x1
FROM a,b
WHERE a.x1 =b.x1(+)

using your table
mtl_sv.sap_mtl_nbr = mtl_planner_sv.sap_mtl_nbr(+)
or
mtl_sv.sap_mtl_nbr(+) = mtl_planner_sv.sap_mtl_nbr
depending on which table has and does not have the common values.


This might help.

Shailesh Sugandhi wrote:
Hi,

This is a query regarding the use of outer join in SQR.

I have to join 2 tables mtl_sv and mtl_planner_sv using
outer join.The key fields of both the tables are the same
ie. sap_mtl_nbr.

The join condition is
mtl_sv.sap_mtl_nbr = mtl_planner_sv.sap_mtl_nbr

mtl_planner_sv contains a field called planner code
which is getting selected and in the where clause of
which comes the joining condition.

There are values of sap_mtl_nbr which are there in mtl_sv
and not in mtl_planner_sv.
Output should come for all the sap_mtl_nbr in mtl_sv
even though many of them may not be in mtl_planner_sv.

I need help in joining the 2 tables using outer join
and i need the correct syntax in SQR.

Thanks in advance.

Regards,
Shailesh

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users 

---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users 

---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users