Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RES 5 Script that connects to database

Status
Not open for further replies.

Wildbar

Technical User
Oct 15, 2004
1,013
CA
I have a script that connects to the database to do an export. After our RES5 upgrade the script no longer works. I know when connecting through dbisql we now have to choose the Micros database. How do I do that in a script?
The original script is below. Thanks in advance.

Code:
CONNECT custom IDENTIFIED BY custom;

select cast(inven_itm_id as numeric(6)), cast(ordr_qty  as int) from micros.veo_po_inven_itm_dtl
where po_seq=(select Max(po_seq) from micros.veo_ordr_itm_po_dtl
where vndr_name='Connect Logistics')
order by name;

output to D:\ConnectExport\Connect.csv
 
What version of Res are you on? 5.0 - 5.2GR used Sybase 11. Loading 5.2 MR1a upgrades to Sybase 16.

If you're on 5.2 MR1a you have to make a couple of changes.
Batch file & command line
change dbisql -q scriptname to dbisql -q -nogui scriptname
SQL Script
change CONNECT custom IDENTIFIED BY custom to CONNECT USING 'DSN=micros;UID=custom;PWD=custom'​
 
I had to add the datasource to any 4.x scripts back when originally coding for 5.2 base. 5.2 MR1a explicitly mentioned the changes, and others, per pmegan's notes above.

The notes in 5.2 MR1a indicate:

The newer syntax requirements are downward compatible and work with
Sybase 9, 11, and 16; therefore, these changes can be sent to all stores at
one time, after the first store in the chain is upgraded to RES 5 Gen2. This
will avoid issues in the future with these important syntax changes being
missed for certain store locations.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top