Friday, March 30, 2012
Reading a file using UTL_FILE.
I am working in an IBM AIX machine, with Oracle 8i.
I am trying to read a file through UTL_FILE read.
The directory which has the file does not have any permisions for the
others. It is restricted to 750.
The file belongs to a local user and group.
So, as workaround we added our local user to the secondary group of oracle, so that oracle user also has the same access permissions as the local user. But still we were not able to read the file from the procedure.
Do we need to restart oracle ?
will be happy if anyone can advice.Is your UTL_FILE_DIR parameter correct in init.ora ?
If not add it and restart database
Originally posted by Anandraj
Hai,
I am working in an IBM AIX machine, with Oracle 8i.
I am trying to read a file through UTL_FILE read.
The directory which has the file does not have any permisions for the
others. It is restricted to 750.
The file belongs to a local user and group.
So, as workaround we added our local user to the secondary group of oracle, so that oracle user also has the same access permissions as the local user. But still we were not able to read the file from the procedure.
Do we need to restart oracle ?
will be happy if anyone can advice.|||Originally posted by ndu35
Is your UTL_FILE_DIR parameter correct in init.ora ?
If not add it and restart database
Hai ndu35,
Thanks for that suggestion. Anyway the entry is already present in init.ora. Also the database was restarted immediately.
Wednesday, March 28, 2012
read varbinary(max)
I'm working with visual c++ and usign MFC ( ODBC ) . I have a problem
with varbinary(max) type of sql server 2005 express. I can read a
varbinary (n ) but when i try to read a varbinary(max) fails.
CDBVariant cvarValor;
m_tablaDeConsulta.GetFieldValue ( campo,
cvarValor );
I use this code to read varbinary fields. The only differrence betwen
max a normal varbinary is the precision. When i read a varbinary
precision is 0.
Someone can help me?
thanks.AKS ha escrito:
> Hi,
> I'm working with visual c++ and usign MFC ( ODBC ) . I have a problem
> with varbinary(max) type of sql server 2005 express. I can read a
> varbinary (n ) but when i try to read a varbinary(max) fails.
> CDBVariant cvarValor;
> m_tablaDeConsulta.GetFieldValue ( campo,
> cvarValor );
> I use this code to read varbinary fields. The only differrence betwen
> max a normal varbinary is the precision. When i read a varbinary
> precision is 0.
> Someone can help me?
> thanks.
At least i can read a varbinary. The code
// get data size
void* buffer = malloc ( 1 );
SQLINTEGER tam = 0;
tam = m_tablaDeConsulta.GetData ( m_tablaDeConsulta.m_pDatabase,
m_tablaDeConsulta.m_hstmt, ind+1, SQL_C_BINARY, buffer, 0, SQL_C_BINARY
);
free (buffer );
// alloc data buffer
CDBVariant cvarValor;
buffer = m_tablaDeConsulta.GetDataBuffer( cvarValor, SQL_C_BINARY,
&tam, SQL_C_BINARY, tam);
// read data
m_tablaDeConsulta.GetData ( m_tablaDeConsulta.m_pDatabase,
m_tablaDeConsulta.m_hstmt, ind+1, SQL_C_BINARY, buffer, tam,
SQL_C_BINARY );
Monday, March 26, 2012
Read the filename, split it and put it in a table
Hello
I'm working on a package which loops through each xml file in a folder.
The name of each xml file is put in variable.
The format of the filename is something like "part1_part2_part3.xml"
I need to store the 3 parts in three different columns of table A
The content of the xml file needs to be manipulated ("." needs to be replaced with ",", ....)and put in serveral columns in tableB
It's not clear to me yet how to start this but my main concern is read the three parts of the filename. I don't find any task in SSIS which could help me with that.
Could someone give me some pointers?
Many thanks!
Worf
Since you alreday have the name of the file in a varibale; then create 3 extra variables and use the expression property for getting the part name. when looking into a variable press F4 to display the property panel and then change the property 'EvaluateAsExpression' to true; then you would have access to the expression builder. There are some string functions there.
Rafael Salas
|||how do you get the filename into a variable?|||Cobr94 wrote:
how do you get the filename into a variable?
This a previous tread where i described something similar; I hope you can use it
Rafael Salas
sqlREAD Only Cursor
run it now I get the follwoing message:
FOR UPDATE cannot be specified on a READ ONLY cursor.
How do I resolve this?
declare export_cursor cursor for
select [RecordKey]
from [ExportData]
for updateTry,
declare export_cursor cursor
SCROLL_LOCKS
for
select [RecordKey]
from [ExportData]
for update
...
AMB
"Emma" wrote:
> I have the following cursor decleration that was working before. Each time
I
> run it now I get the follwoing message:
> FOR UPDATE cannot be specified on a READ ONLY cursor.
> How do I resolve this?
> declare export_cursor cursor for
> select [RecordKey]
> from [ExportData]
> for update|||I tried the SCROLL_LOCKS and it did not work. The way I had it was working
before. Will recreating the database have anything to do with the cursor not
working?
"Alejandro Mesa" wrote:
> Try,
> declare export_cursor cursor
> SCROLL_LOCKS
> for
> select [RecordKey]
> from [ExportData]
> for update
> ...
>
> AMB
> "Emma" wrote:
>|||Have you considered replacing the cursor with set-based code? Cursors
in general are a bad idea. Update cursors are worse.
--
David Portas
SQL Server MVP
--|||Try,
declare export_cursor cursor
KEYSET
for
select [RecordKey]
from [ExportData]
for update
...
AMB
"Emma" wrote:
> I tried the SCROLL_LOCKS and it did not work. The way I had it was working
> before. Will recreating the database have anything to do with the cursor n
ot
> working?
> "Alejandro Mesa" wrote:
>|||I figured it out. The table has to have a unique index in order for the
update cursor to work. The database was being replicated before and I took
replication off and deleted all the rowid’s added by replication. The rowi
d
was being used as the unique index before.
What is set-based code?
"David Portas" wrote:
> Have you considered replacing the cursor with set-based code? Cursors
> in general are a bad idea. Update cursors are worse.
> --
> David Portas
> SQL Server MVP
> --
>|||Set-based code basically means the standard SELECT, UPDATE, DELETE and
INSERT statements. These operate on sets of rows at a time rather than
individual row-by-row processing.
Set-based SQL is generally much more efficient, more concise and easier to
develop and maintain than cursors. Most of the time cursors are unnecessary
and set-based SQL should be your first choice for performing any data
manipuldation.
David Portas
SQL Server MVP
--
Friday, March 23, 2012
Read MDF
readable format? we had our server crash on us and the
backup/ restore is not working. I only have the mdf file
for the database and was wondering if i could get this
into some sort of formatting i could open and manually add
our old database back in as it only had a few details in.
thanks
simon
Hi
No. Have you tried sp_attach_single_file_db?
Failing that, phone MS PSS.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Simon" <simon@.talktalk.net> wrote in message
news:13d001c515ac$a8337530$a401280a@.phx.gbl...
> is there any way of opening an MDf file into some sort of
> readable format? we had our server crash on us and the
> backup/ restore is not working. I only have the mdf file
> for the database and was wondering if i could get this
> into some sort of formatting i could open and manually add
> our old database back in as it only had a few details in.
> thanks
> simon
|||thanks mike, i have tried sp_attach_single_file_db but
without joy.
we have had to reinstall the OS and SQL and this was the
only file we had a good copy of.
i will try Ms PSS thanks.[vbcol=seagreen]
>--Original Message--
>Hi
>No. Have you tried sp_attach_single_file_db?
>Failing that, phone MS PSS.
>Regards
>--
>Mike Epprecht, Microsoft SQL Server MVP
>Zurich, Switzerland
>IM: mike@.epprecht.net
>MVP Program: http://www.microsoft.com/mvp
>Blog: http://www.msmvps.com/epprecht/
>"Simon" <simon@.talktalk.net> wrote in message
>news:13d001c515ac$a8337530$a401280a@.phx.gbl...
of[vbcol=seagreen]
add[vbcol=seagreen]
in.
>
>.
>
|||Just out of curiosity, what problem do you encounter when you try to
re-attach the MDF? The following article explains other issues related to
restoring a DB on another server install:
http://support.microsoft.com/kb/314546#10
<anonymous@.discussions.microsoft.com> wrote in message
news:13f201c515b2$0691fd40$a401280a@.phx.gbl...[vbcol=seagreen]
> thanks mike, i have tried sp_attach_single_file_db but
> without joy.
> we have had to reinstall the OS and SQL and this was the
> only file we had a good copy of.
> i will try Ms PSS thanks.
> of
> add
> in.
|||Hi Johnny
An sp_attach_single_file_db is only guarenteed to work is
an sp_detach_db is used, otherwise its a bit of a lottery
whether it works or not.
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/tsqlref/ts_sp_ae-az_4wrm.asp
Peter
"I may be drunk, Miss, but in the morning I will be sober
and you will still be ugly."
Winston Churchill
>--Original Message--
>Just out of curiosity, what problem do you encounter when
you try to
>re-attach the MDF? The following article explains other
issues related to[vbcol=seagreen]
>restoring a DB on another server install:
>http://support.microsoft.com/kb/314546#10
><anonymous@.discussions.microsoft.com> wrote in message
>news:13f201c515b2$0691fd40$a401280a@.phx.gbl...
sort[vbcol=seagreen]
the[vbcol=seagreen]
file[vbcol=seagreen]
this[vbcol=seagreen]
manually
>
>.
>
Read MDF
readable format? we had our server crash on us and the
backup/ restore is not working. I only have the mdf file
for the database and was wondering if i could get this
into some sort of formatting i could open and manually add
our old database back in as it only had a few details in.
thanks
simonHi
No. Have you tried sp_attach_single_file_db?
Failing that, phone MS PSS.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Simon" <simon@.talktalk.net> wrote in message
news:13d001c515ac$a8337530$a401280a@.phx.gbl...
> is there any way of opening an MDf file into some sort of
> readable format? we had our server crash on us and the
> backup/ restore is not working. I only have the mdf file
> for the database and was wondering if i could get this
> into some sort of formatting i could open and manually add
> our old database back in as it only had a few details in.
> thanks
> simon|||thanks mike, i have tried sp_attach_single_file_db but
without joy.
we have had to reinstall the OS and SQL and this was the
only file we had a good copy of.
i will try Ms PSS thanks.
>--Original Message--
>Hi
>No. Have you tried sp_attach_single_file_db?
>Failing that, phone MS PSS.
>Regards
>--
>Mike Epprecht, Microsoft SQL Server MVP
>Zurich, Switzerland
>IM: mike@.epprecht.net
>MVP Program: http://www.microsoft.com/mvp
>Blog: http://www.msmvps.com/epprecht/
>"Simon" <simon@.talktalk.net> wrote in message
>news:13d001c515ac$a8337530$a401280a@.phx.gbl...
>> is there any way of opening an MDf file into some sort
of
>> readable format? we had our server crash on us and the
>> backup/ restore is not working. I only have the mdf file
>> for the database and was wondering if i could get this
>> into some sort of formatting i could open and manually
add
>> our old database back in as it only had a few details
in.
>> thanks
>> simon
>
>.
>|||Just out of curiosity, what problem do you encounter when you try to
re-attach the MDF? The following article explains other issues related to
restoring a DB on another server install:
http://support.microsoft.com/kb/314546#10
<anonymous@.discussions.microsoft.com> wrote in message
news:13f201c515b2$0691fd40$a401280a@.phx.gbl...
> thanks mike, i have tried sp_attach_single_file_db but
> without joy.
> we have had to reinstall the OS and SQL and this was the
> only file we had a good copy of.
> i will try Ms PSS thanks.
> >--Original Message--
> >Hi
> >
> >No. Have you tried sp_attach_single_file_db?
> >Failing that, phone MS PSS.
> >
> >Regards
> >--
> >Mike Epprecht, Microsoft SQL Server MVP
> >Zurich, Switzerland
> >
> >IM: mike@.epprecht.net
> >
> >MVP Program: http://www.microsoft.com/mvp
> >
> >Blog: http://www.msmvps.com/epprecht/
> >
> >"Simon" <simon@.talktalk.net> wrote in message
> >news:13d001c515ac$a8337530$a401280a@.phx.gbl...
> >> is there any way of opening an MDf file into some sort
> of
> >> readable format? we had our server crash on us and the
> >> backup/ restore is not working. I only have the mdf file
> >> for the database and was wondering if i could get this
> >> into some sort of formatting i could open and manually
> add
> >> our old database back in as it only had a few details
> in.
> >>
> >> thanks
> >>
> >> simon
> >
> >
> >.
> >|||Hi Johnny
An sp_attach_single_file_db is only guarenteed to work is
an sp_detach_db is used, otherwise its a bit of a lottery
whether it works or not.
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/tsqlref/ts_sp_ae-az_4wrm.asp
Peter
"I may be drunk, Miss, but in the morning I will be sober
and you will still be ugly."
Winston Churchill
>--Original Message--
>Just out of curiosity, what problem do you encounter when
you try to
>re-attach the MDF? The following article explains other
issues related to
>restoring a DB on another server install:
>http://support.microsoft.com/kb/314546#10
><anonymous@.discussions.microsoft.com> wrote in message
>news:13f201c515b2$0691fd40$a401280a@.phx.gbl...
>> thanks mike, i have tried sp_attach_single_file_db but
>> without joy.
>> we have had to reinstall the OS and SQL and this was the
>> only file we had a good copy of.
>> i will try Ms PSS thanks.
>> >--Original Message--
>> >Hi
>> >
>> >No. Have you tried sp_attach_single_file_db?
>> >Failing that, phone MS PSS.
>> >
>> >Regards
>> >--
>> >Mike Epprecht, Microsoft SQL Server MVP
>> >Zurich, Switzerland
>> >
>> >IM: mike@.epprecht.net
>> >
>> >MVP Program: http://www.microsoft.com/mvp
>> >
>> >Blog: http://www.msmvps.com/epprecht/
>> >
>> >"Simon" <simon@.talktalk.net> wrote in message
>> >news:13d001c515ac$a8337530$a401280a@.phx.gbl...
>> >> is there any way of opening an MDf file into some
sort
>> of
>> >> readable format? we had our server crash on us and
the
>> >> backup/ restore is not working. I only have the mdf
file
>> >> for the database and was wondering if i could get
this
>> >> into some sort of formatting i could open and
manually
>> add
>> >> our old database back in as it only had a few details
>> in.
>> >>
>> >> thanks
>> >>
>> >> simon
>> >
>> >
>> >.
>> >
>
>.
>
Read MDF
readable format? we had our server crash on us and the
backup/ restore is not working. I only have the mdf file
for the database and was wondering if i could get this
into some sort of formatting i could open and manually add
our old database back in as it only had a few details in.
thanks
simonHi
No. Have you tried sp_attach_single_file_db?
Failing that, phone MS PSS.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Simon" <simon@.talktalk.net> wrote in message
news:13d001c515ac$a8337530$a401280a@.phx.gbl...
> is there any way of opening an MDf file into some sort of
> readable format? we had our server crash on us and the
> backup/ restore is not working. I only have the mdf file
> for the database and was wondering if i could get this
> into some sort of formatting i could open and manually add
> our old database back in as it only had a few details in.
> thanks
> simon|||thanks mike, i have tried sp_attach_single_file_db but
without joy.
we have had to reinstall the OS and SQL and this was the
only file we had a good copy of.
i will try Ms PSS thanks.
>--Original Message--
>Hi
>No. Have you tried sp_attach_single_file_db?
>Failing that, phone MS PSS.
>Regards
>--
>Mike Epprecht, Microsoft SQL Server MVP
>Zurich, Switzerland
>IM: mike@.epprecht.net
>MVP Program: http://www.microsoft.com/mvp
>Blog: http://www.msmvps.com/epprecht/
>"Simon" <simon@.talktalk.net> wrote in message
>news:13d001c515ac$a8337530$a401280a@.phx.gbl...
of[vbcol=seagreen]
add[vbcol=seagreen]
in.[vbcol=seagreen]
>
>.
>|||Just out of curiosity, what problem do you encounter when you try to
re-attach the MDF? The following article explains other issues related to
restoring a DB on another server install:
http://support.microsoft.com/kb/314546#10
<anonymous@.discussions.microsoft.com> wrote in message
news:13f201c515b2$0691fd40$a401280a@.phx.gbl...[vbcol=seagreen]
> thanks mike, i have tried sp_attach_single_file_db but
> without joy.
> we have had to reinstall the OS and SQL and this was the
> only file we had a good copy of.
> i will try Ms PSS thanks.
> of
> add
> in.|||Hi Johnny
An sp_attach_single_file_db is only guarenteed to work is
an sp_detach_db is used, otherwise its a bit of a lottery
whether it works or not.
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/tsqlref/ts_sp_ae-az_4wrm.asp
Peter
"I may be drunk, Miss, but in the morning I will be sober
and you will still be ugly."
Winston Churchill
>--Original Message--
>Just out of curiosity, what problem do you encounter when
you try to
>re-attach the MDF? The following article explains other
issues related to
>restoring a DB on another server install:
>http://support.microsoft.com/kb/314546#10
><anonymous@.discussions.microsoft.com> wrote in message
>news:13f201c515b2$0691fd40$a401280a@.phx.gbl...
sort[vbcol=seagreen]
the[vbcol=seagreen]
file[vbcol=seagreen]
this[vbcol=seagreen]
manually[vbcol=seagreen]
>
>.
>
Tuesday, March 20, 2012
Re: Left function causing Sum function not working??
My query won't add up the quantities after adding LEFT function in SQL statement can anyone see why?
SELECT dbo.tblShipping_sched.work_ord_num, dbo.tblShipping_sched.work_ord_line_num, SUM(dbo.tblBag_data.bag_quantity) AS qty_on_hand,
dbo.tblShipping_sched.cust_num, dbo.tblShipping_sched.cust_name, dbo.tblShipping_sched.apple_part_num,
dbo.tblShipping_sched.apple_catalog_num
FROM dbo.tblShipping_sched LEFT OUTER JOIN
dbo.tblBag_data ON dbo.tblShipping_sched.work_ord_line_num = dbo.tblBag_data.work_ord_line_num AND
LEFT(dbo.tblShipping_sched.work_ord_num, 6) = LEFT(dbo.tblBag_data.work_ord_num, 6)
WHERE (dbo.tblShipping_sched.work_ord_num LIKE '343024%')
GROUP BY dbo.tblShipping_sched.work_ord_num, dbo.tblShipping_sched.work_ord_line_num, dbo.tblBag_data.bag_quantity, dbo.tblShipping_sched.cust_num,
dbo.tblShipping_sched.cust_name, dbo.tblShipping_sched.apple_part_num, dbo.tblShipping_sched.apple_catalog_num
''this s/b one record w/ summed qty
Work_order line_num qty_on_hand cust_num cust a_p_n a_c_n
343024-01 001 16540 32246 Davol Inc R1082061 R00295-059-70EPF-HM+
343024-01 001 27344 32246 Davol Inc R1082061 R00295-059-70EPF-HM+
Thanks for your input.because your GROUP BY specifies the individual dbo.tblBag_data.bag_quantity values
Monday, March 12, 2012
RDO 2.0 and Visual Basic 5 application stopped working with SQL Server 2005
We have a legacy application that is still in wide use. It is Visual Basic 5 and RDO 2.0 using ODBC to connect to SQL Server database.
When trying to connect to SQL Server 2005, it can no longer update or insert data. It reads data fine. The error message it gives is 16933, "The cursor does not include the table being modified or the table is not updatable through the cursor."
Has anybody else seen this problem? Any help would be appreciated.
Yes, we've seen this. It's hinted at in the documentation, although none of our examples seemed to exactly match what's documented. In several cases we were able to fix the problem by swapping the "from" table with a join table, but in one case we had to give up on the cursor.
Friday, March 9, 2012
RDL generation problem
I am working with SQL Server 2005 Reporting Service from few days, though I am
not expert, for some reason I have to run on field without having sound
knowledge of RDL, but need your help, gys. I am using SQL Server Business
Intelligence Development Studio to design report.
Here is the procedure of my work to populate a RDL report
- I used a stored procedure for the DataSet of my RDL
Then I drag and drop necessary field to my report layout.
Put required parameters to preview tab and then run report.
This is quite simple, I didn't face any problem with this process, even though
the process may not correct, but working perfect. My problem is
when the stored procedure returns multiple result set. The data tab only
shows the first result set though the SP returns multiple result set, I have
run the SP in the Query Analyzer. I don't want change my stored procedure.
And please give me some suggestions about the best procedure
to develop RDL report in real life.
Please reply me ASAP, it’s very urgent.
Thank youTareqe
Hi there,
SQL RS doesn't support multiple resultsets. You will need to either write a wrapper stored procedure to retrieve the dataset you want or modify your stored procedure.
regards,
Andrew
Wednesday, March 7, 2012
RDA with Identity column.
Hi Everyone:
I am new to Mobile programming. I am now working on a mobile project. I encounter an issue when I sync the data:
cause I can't modify the schema, so I have to use RDA instead of Merge replication on sql server 2005.
However, There is an identiy column on each table I will pull them down to local mobile database. And I will use those identity columns to connect tables. Even worse, the photo's new name will combine the photoID which is an identity column. There would an issue, if i sync data, the photoID would be same on different local mobile databases. And there would be generate same identity value when users sync data.
How can I avoid those issues? If you have any good ideas, please help me out so that I can meet the project deadline.
Thanks
James
Anyone knows how to manually handle identity management.
Cause my identity column will clash when Sync data.
James
|||You need to call
ALTER TABLE <TableName> ALTER COLUMN <ColumnName> <ColumnDataType> IDENTITY(<Seed>,<Step>)
to set the different identity on the pulled table.
Note, only Seed and Step can be changed in the above table.
Thanks,
Laxmi Narsimha Rao ORUGANTI
|||Hi Laxmi,
Thank you for your reply. I realize that I can use the command you gave to change the SEED range to avoid the clash. But if I change seed, when I push the data back to Remote SQL server 2005 database, should I disable the identity column on remote database, then push mobile client table data, then set identity column back on remote DB. It seems lots of work to manually handle identity column clash. Do we have any alternative way to do it, since I can't use merge replication to change the database schema, what about XML web service? I think should be same, but if we use Web Service, the performance should be down 10-15%, that's why i don't wanna use it since we choose SQL server 2005 as our database.
Your reply is really appreciated. Thanks!
James
|||I need to point is that someone will work on remote db through classical ASP. If I change the identity Seed. It will effect mobile client?
If anybody has the same issues?
Thanks
James
|||No need to worry about disabling the IDENTITY on server. RDA while pushing automatically does "SET IDENTITY_INSERT <TableName> ON/OFF" on SQL Server to get the same IDENTITY column values onto the server table.
Thanks,
Laxmi
|||Thank Laxmi,
your reply does help me. I will try it out. But we have 200 hundred of Mobile clients. We have to set the identity range for each one.
Any other good ideas for solving the identity clash.
Thanks.
James
|||That is why there is Merge Replication! Why not go for that?|||Because I can't modify the Sql server 2005 DB schema. They are using identity ID. I wish I could use Merge replication. I can save my code lines as well.
Thank you . Laxmi. You are the rock!
James
|||Same here, merge replication is not a option.Anyone found a suitable solution for this challenge?
Thanx
|||What I have done is to set the ID range for each person. So that they won't clash.
RDA with Identity column.
Hi Everyone:
I am new to Mobile programming. I am now working on a mobile project. I encounter an issue when I sync the data:
cause I can't modify the schema, so I have to use RDA instead of Merge replication on sql server 2005.
However, There is an identiy column on each table I will pull them down to local mobile database. And I will use those identity columns to connect tables. Even worse, the photo's new name will combine the photoID which is an identity column. There would an issue, if i sync data, the photoID would be same on different local mobile databases. And there would be generate same identity value when users sync data.
How can I avoid those issues? If you have any good ideas, please help me out so that I can meet the project deadline.
Thanks
James
Anyone knows how to manually handle identity management.
Cause my identity column will clash when Sync data.
James
|||You need to call
ALTER TABLE <TableName> ALTER COLUMN <ColumnName> <ColumnDataType> IDENTITY(<Seed>,<Step>)
to set the different identity on the pulled table.
Note, only Seed and Step can be changed in the above table.
Thanks,
Laxmi Narsimha Rao ORUGANTI
|||Hi Laxmi,
Thank you for your reply. I realize that I can use the command you gave to change the SEED range to avoid the clash. But if I change seed, when I push the data back to Remote SQL server 2005 database, should I disable the identity column on remote database, then push mobile client table data, then set identity column back on remote DB. It seems lots of work to manually handle identity column clash. Do we have any alternative way to do it, since I can't use merge replication to change the database schema, what about XML web service? I think should be same, but if we use Web Service, the performance should be down 10-15%, that's why i don't wanna use it since we choose SQL server 2005 as our database.
Your reply is really appreciated. Thanks!
James
|||I need to point is that someone will work on remote db through classical ASP. If I change the identity Seed. It will effect mobile client?
If anybody has the same issues?
Thanks
James
|||No need to worry about disabling the IDENTITY on server. RDA while pushing automatically does "SET IDENTITY_INSERT <TableName> ON/OFF" on SQL Server to get the same IDENTITY column values onto the server table.
Thanks,
Laxmi
|||Thank Laxmi,
your reply does help me. I will try it out. But we have 200 hundred of Mobile clients. We have to set the identity range for each one.
Any other good ideas for solving the identity clash.
Thanks.
James
|||That is why there is Merge Replication! Why not go for that?|||Because I can't modify the Sql server 2005 DB schema. They are using identity ID. I wish I could use Merge replication. I can save my code lines as well.
Thank you . Laxmi. You are the rock!
James
|||Same here, merge replication is not a option.Anyone found a suitable solution for this challenge?
Thanx|||What I have done is to set the ID range for each person. So that they won't clash.
RDA with Identity column.
Hi Everyone:
I am new to Mobile programming. I am now working on a mobile project. I encounter an issue when I sync the data:
cause I can't modify the schema, so I have to use RDA instead of Merge replication on sql server 2005.
However, There is an identiy column on each table I will pull them down to local mobile database. And I will use those identity columns to connect tables. Even worse, the photo's new name will combine the photoID which is an identity column. There would an issue, if i sync data, the photoID would be same on different local mobile databases. And there would be generate same identity value when users sync data.
How can I avoid those issues? If you have any good ideas, please help me out so that I can meet the project deadline.
Thanks
James
Anyone knows how to manually handle identity management.
Cause my identity column will clash when Sync data.
James
|||You need to call
ALTER TABLE <TableName> ALTER COLUMN <ColumnName> <ColumnDataType> IDENTITY(<Seed>,<Step>)
to set the different identity on the pulled table.
Note, only Seed and Step can be changed in the above table.
Thanks,
Laxmi Narsimha Rao ORUGANTI
|||Hi Laxmi,
Thank you for your reply. I realize that I can use the command you gave to change the SEED range to avoid the clash. But if I change seed, when I push the data back to Remote SQL server 2005 database, should I disable the identity column on remote database, then push mobile client table data, then set identity column back on remote DB. It seems lots of work to manually handle identity column clash. Do we have any alternative way to do it, since I can't use merge replication to change the database schema, what about XML web service? I think should be same, but if we use Web Service, the performance should be down 10-15%, that's why i don't wanna use it since we choose SQL server 2005 as our database.
Your reply is really appreciated. Thanks!
James
|||I need to point is that someone will work on remote db through classical ASP. If I change the identity Seed. It will effect mobile client?
If anybody has the same issues?
Thanks
James
|||No need to worry about disabling the IDENTITY on server. RDA while pushing automatically does "SET IDENTITY_INSERT <TableName> ON/OFF" on SQL Server to get the same IDENTITY column values onto the server table.
Thanks,
Laxmi
|||Thank Laxmi,
your reply does help me. I will try it out. But we have 200 hundred of Mobile clients. We have to set the identity range for each one.
Any other good ideas for solving the identity clash.
Thanks.
James
|||That is why there is Merge Replication! Why not go for that?|||Because I can't modify the Sql server 2005 DB schema. They are using identity ID. I wish I could use Merge replication. I can save my code lines as well.
Thank you . Laxmi. You are the rock!
James
|||Same here, merge replication is not a option.Anyone found a suitable solution for this challenge?
Thanx|||What I have done is to set the ID range for each person. So that they won't clash.
RDA vs Replication
application. I want to have a desktop database that is kept in sync
with a handheld database, with updates occurring on both ends. To keep
them synchronized, I am investigating the use of both RDA and
Replication. I've gotten RDA to work, but have found a major drawback:
Every time you sync, you have to basically pull down a new version of
ALL the data, not just the changes.
So I started to look into
using Replication. If I understand correctly, using Replication, you
can do synchronization where only the changes have to be exchanged
between the handheld device and the desktop computer. But as I just
found out from the above post, you cannot create a Publication using
SQLExpress.
Why do I want to use SQLExpress? Because I need a
version of SQL Server that I can distribute for free with my
application. Am I wrong, or is SQLExpress that only one that has a free
redistributable?
Taking a step back, am I missing something? Is there a better (simpler?) alternative to RDA and Replication?
Thanks for any advice!
Tom
Hi Tom,
SQL Express is the only free version of SQL Server 2005, if you want to use Replication to synchronize you mobile database you will have to puchase one of the larger versions of SQL Server.
Mike
RDA SQL MOBILE ERROR 28037 HResult = -2147012867
I am modifying the aplication to visual.net from visual studio 2005 but I have problems ( in this moment i working in my pc , with sql 2000 personal ,windows xp , sql mobile and pc pocket emulator for window ce 5.0)
I don't know but i can't make the Pull in the server.
1) the http://localhost/driver2005/sqlcesa30.dll?diag is correct
2) I don't have the windows firewall
3)the anonimous user have all the permition in the virtual directory..
Where is the error ?
Thanks
Have you granted permissions on the database itself for the anonymous IIS account (IUSR_{yourservername}) ?
You are experiencing a permissions problem between the ISAPI DLL that brokers RDA (sqlcesa30.dll) and SQL Server with this error.
-Darren
|||Yes,in the IIS the ISAPI dll are allows and the anonymous account has total access in th database.
the problems continue, but in this moment the error is the 28017 with the Message = "An incorrect or unsupported HTTP function call was made."
Thanks
|||I found the solution . The problems was that the sqlcesa30.dll must be int the wwwroot directory.Can you please help me ...
this error is quite frustating
RDA SQL MOBILE ERROR 28037 HResult = -2147012867
I am modifying the aplication to visual.net from visual studio 2005 but I have problems ( in this moment i working in my pc , with sql 2000 personal ,windows xp , sql mobile and pc pocket emulator for window ce 5.0)
I don't know but i can't make the Pull in the server.
1) the http://localhost/driver2005/sqlcesa30.dll?diag is correct
2) I don't have the windows firewall
3)the anonimous user have all the permition in the virtual directory..
Where is the error ?
Thanks
Have you granted permissions on the database itself for the anonymous IIS account (IUSR_{yourservername}) ?
You are experiencing a permissions problem between the ISAPI DLL that brokers RDA (sqlcesa30.dll) and SQL Server with this error.
-Darren
|||Yes,in the IIS the ISAPI dll are allows and the anonymous account has total access in th database.
the problems continue, but in this moment the error is the 28017 with the Message = "An incorrect or unsupported HTTP function call was made."
Thanks
|||I found the solution . The problems was that the sqlcesa30.dll must be int the wwwroot directory.Can you please help me ...
this error is quite frustating
RDA SQL MOBILE ERROR 28037 HResult = -2147012867
I am modifying the aplication to visual.net from visual studio 2005 but I have problems ( in this moment i working in my pc , with sql 2000 personal ,windows xp , sql mobile and pc pocket emulator for window ce 5.0)
I don't know but i can't make the Pull in the server.
1) the http://localhost/driver2005/sqlcesa30.dll?diag is correct
2) I don't have the windows firewall
3)the anonimous user have all the permition in the virtual directory..
Where is the error ?
Thanks
Have you granted permissions on the database itself for the anonymous IIS account (IUSR_{yourservername}) ?
You are experiencing a permissions problem between the ISAPI DLL that brokers RDA (sqlcesa30.dll) and SQL Server with this error.
-Darren
|||Yes,in the IIS the ISAPI dll are allows and the anonymous account has total access in th database.
the problems continue, but in this moment the error is the 28017 with the Message = "An incorrect or unsupported HTTP function call was made."
Thanks
|||I found the solution . The problems was that the sqlcesa30.dll must be int the wwwroot directory.Can you please help me ...
this error is quite frustating
RDA Push with Identity column
Hi Everyone:
I am new to Mobile programming. I am now working on a small mobile app.
I encounter an issue when I sync the data:
Using RDA Pull, I can create the database and populate my table fine on my pocket pc device.
After updating the data on the device, I encounter an error when I try to Push my table back to the back-end SQL Server 2005 DB.
Error: "The identity range was not established."
VB CODE:
Private Sub RdaConnKeyHeaderPush()
Dim RemoteAccess As New Data.SqlServerCe.SqlCeRemoteDataAccess RemoteAccess.Push("KeyHeader", RDAConnectingString, Data.SqlServerCe.RdaBatchOption.Batching Catch RDAConnectionException As Exception RemoteAccess.Dispose() TABLE DEFINITION: Anyone have any insight on a solution? Thanks. Ok....then I will try using the unique identifier. My problem is here that I am unsure of how to add the guid to my insert statement in my application. I have a dataset created that has an Insert menthod for a my table. How do I set the properties of this Insert statement to use a GUID in it's execution? Thanks. Ok...thanks for your help. I tried inserting the NEWID() method into my sql insert statement, however when I run my application in debug mode, I get an Null Value Exception on that UniqueIdentifier field....what would the best way to identify where and why this is happening? The error occurs when I try to close the form by clicking 'ok' after entering a record...... Error.... NoNullAllowedException was unhandled Column 'ID' does not allow nulls. Code Point where error is generated.... Private Sub KeysEditViewDialog_Closing(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Me.KeysBindingSource.EndEdit() End Sub Some Dataset Code.....is the null error on the sql side or app side, I am not sure of this? Me._adapter.InsertCommand = New System.Data.SqlServerCe.SqlCeCommand Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO Keys"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" (key_number, key_desc, building, inv_qty,"& _ " avail_qty, id)"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"VALUES (@.p1, @.p2, @.p3, @.p4, @.p5, NEWID())" Me._adapter.InsertCommand.CommandType = System.Data.CommandType.Text param = New System.Data.SqlServerCe.SqlCeParameter param.ParameterName = "@.p1" param.Size = 100 param.IsNullable = true param.SourceColumn = "key_number" Me._adapter.InsertCommand.Parameters.Add(param) param = New System.Data.SqlServerCe.SqlCeParameter param.ParameterName = "@.p2" param.Size = 100 param.IsNullable = true param.SourceColumn = "key_desc" Me._adapter.InsertCommand.Parameters.Add(param) param = New System.Data.SqlServerCe.SqlCeParameter param.ParameterName = "@.p3" param.Size = 100 param.IsNullable = true param.SourceColumn = "building" Me._adapter.InsertCommand.Parameters.Add(param) param = New System.Data.SqlServerCe.SqlCeParameter param.ParameterName = "@.p4" param.DbType = System.Data.DbType.Int32 param.Size = 4 param.IsNullable = true param.SourceColumn = "inv_qty" Me._adapter.InsertCommand.Parameters.Add(param) param = New System.Data.SqlServerCe.SqlCeParameter param.ParameterName = "@.p5" param.Size = 100 param.IsNullable = true param.SourceColumn = "avail_qty" Me._adapter.InsertCommand.Parameters.Add(param)
Dim RDAConnectingString As String
RemoteAccess.InternetLogin = "<mylogin>"
RemoteAccess.InternetPassword = "<mypassword>"
RDAConnectingString = "Provider=SQLOLEDB;Persist Security Info=True;Data Source=<MySQLServer>;Initial Catalog=MobileKeyDB;" & _
"User ID=MobileUser;Password=<mypassword>"
RemoteAccess.InternetUrl = "https://www.<mysite>.com/SQLMobile/sqlc
RemoteAccess.LocalConnectionString = "Data Source=Program Files\SQL Mobile\en\MobileKeyDB.sdf; Password = <mypassword>"
Cursor.Current = Cursors.WaitCursor
Try
MessageBox.Show("Can not push Header Data: " & RDAConnectionException.ToString, "Loading Key Tracker")
Finally
End Try
Cursor.Current = Cursors.Default
End Sub
USE [MobileKeyDB]
GO
/****** Object: Table [dbo].[KeyHeader] Script Date: 07/11/2007 09:48:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[KeyHeader](
[trans_id] [int] IDENTITY(1,1) NOT NULL,
[user_id] [int] NOT NULL,
[date_stamp] [datetime] NOT NULL,
[signature] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[status] [int] NOT NULL,
[id] [int] NOT NULL,
[date_stamp2] [datetime] NOT NULL,
CONSTRAINT [PK_KeyHeader] PRIMARY KEY CLUSTERED
(
[trans_id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
Saturday, February 25, 2012
RDA and PDA
SQL SERVER 2000. I managed to synchronize with GPRS connection . But when i
disable GPRS and activate wireless connection, synchronization fails.
Message is something like that: "request to send data to the computer
running IIS has failed ......... "
I am sure, there is no problem with wireless connection. I can connect to
internet with it.
does anyone have an idea?
thanks so much..
from Pocket IE on your device, try connecting to
the SQL CE server tools dll in the IIS virtual directory.
http://{servername}/{virtualdir}/sscesa20.dll
if it fails, try the IP address.
if that fails, you do not have a valid network path to your server.
Darren Shaffer
..NET Compact Framework MVP
Principal Architect
Connected Innovation
www.connectedinnovation.com
"prefect" <uykusuz@.uykusuz.com> wrote in message
news:eQAF3rR%23FHA.160@.TK2MSFTNGP12.phx.gbl...
>i am working on a PDA application that uses RDA to push and pull data from
>SQL SERVER 2000. I managed to synchronize with GPRS connection . But when i
>disable GPRS and activate wireless connection, synchronization fails.
>Message is something like that: "request to send data to the computer
>running IIS has failed ......... "
> I am sure, there is no problem with wireless connection. I can connect to
> internet with it.
> does anyone have an idea?
> thanks so much..
>
Monday, February 20, 2012
rc:Section not working on Matrix report with SQL RS 2000
I've got a SQL RS 2000 report which contains a matrix that sometimes
contains over 100 rows which spans more than one vertical printed page
and I want the whole report to show on one page when viewed via the web
so that the user can see the whole report displayed in one view rather
than them having to page to different sections.
I was expecting the report to render all on one page with the
rc:Section specified as zero but the rc:Section parameter seems to be
ignored and only the first page of the report is shown. I've specified
rc:Section=0 in the URL access parameters and I have the report toolbar
showing as I want the user to be able to preview/print etc.
This only seems to be a problem with the matrix report. Has anyone come
across this, or does anyone know of a workaround?
JonThis is the full url device param list in case there's a collision
somewhere:
rs:Command=Render
rs:Format=HTML4.0
rs:ClearSession=False
rc:Toolbar=True
rc:Zoom=100
rc:HTMLFragment=true
rc:Section=0
rc:Parameters=False
rc:LinkTarget=_self
Jon