Hi,



Below is my code where i want to save BLOb field to local disk as xml.
Filename is combination of two other fields in the recordset.



I get "File already exists" error after downloading two rows of Blob
column.



Can someone help me fix this?.And also need to trim(delete) first 5
characters in the xml file before saving to local disk.



here is my code:



______________________________



const strDirectory = "C:\Documents and Settings\pvellan\"

Set dbc_conn = CreateObject("ADODB.Connection")



dbc_conn.Open "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=
(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=XX.XX.XX.XXX)
(PORT=1521)))(CONNECT_DATA=(SID=2222Q)(SERVER=DEDICATED)));User
Id=ah_pvellan;Password=******;"

set rs= createobject("adodb.recordset")

'sql= "select a.ie_message_body, b.request_type, a.ie_message_id from
t_hbs_ie_message a, t_hbs_ie_transaction b where a.ie_transaction_id =
'b.ie_transaction_id and b.confirmation_no= 'HAMST_12964'"


rs.open "select a.ie_message_body, b.request_type, a.ie_message_id
from t_hbs_ie_message a, t_hbs_ie_transaction b where
a.ie_transaction_id = b.ie_transaction_id and b.confirmation_no=
'HAMST_12964'",dbc_conn,1


 Do while not rs.EOF


   strFileName= strDirectory&rs.Fields(1)&"_"&rs.Fields(2)&".xml"

rs.save strFileName

rs.MoveNext

Loop
On Jul 23, 1:33 am, Dhanya A <[email protected]> wrote:
> Hi Bala,
>
> This is working. I could fetch values from the columns specified.
> Thanks for your valuable answer.
>
> Thanks and Regards,
> Dhanya
>
> On Jul 23, 10:25 am, balakrish <[email protected]>
> wrote:
>
> > Hi Dhanya ,
>
> > Try this script ,
>
> > Dim con,rs,column_count,column_name, i
> > Set con=createobject("adodb.connection")
> > Set rs=createobject("adodb.recordset")
> > con.open"provider=sqloledb.1;
> > server=dbserver;uid=****;pwd=***;database=****"
> > rs.open"select*from tablename",con
>
> > column_count = rs.Fields.count          '''''''To get the column
> > count
> > in specified table
> > msgbox column_count
>
> > For i = 0 to column_count - 1
> >         column_name = rs.Fields(i).Value ''''''To get the columns
> > names in
> > the specified table
> >         print column_name
> >         rs.movenext
> > Next
>
> > (or)
>
> > Here we are going to take the particular column value, we can fetch
> > the data whatever we want from this script
>
> > Dim con,rs,column_count,column_name, i
> > Set con=createobject("adodb.connection")
> > Set rs=createobject("adodb.recordset")
> > con.open"provider=sqloledb.1;
> > server=dbserver;uid=****;pwd=***;database=****"
> > rs.open"select*from tablename",con
>
> > while not(rs.EOF)
> > msgbox "value=" &rs.fields.item("dname")&vbcrlf
> > rs.MoveNext
> > wend
>
> > rs.Movefirst
>
> > while not(rs.EOF)
> > msgbox "value=" &rs.fields.item("dsalary")&vbcrlf
> > rs.MoveNext
> > wend
>
> > rs.Close
> > con.Close
> > set rs=Nothing
> > set con=Nothing
>
> > Msgbox "values are fetched"
>
> > Regards
> > Bala

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to