[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] no access for database


Hi Stefan,

I am using the latest current stable version of interchange 5.4.2.
And this catalog only uses the one database.

I am using this code to loop through a list of a couple of 100 fields
named 1,2,3 etc and if the 1_quantity field has a value perform an
insert into the database.

[perl tables=quote_items]






	my $code = $Scratch->{code};
	my $version = $Scratch->{version};
	my $count = $CGI->{count};
	my $customer = $CGI->{customer_id};
	my $project = $CGI->{project_id};
	my $ret;

	for($i=1;$i<=$count;$i++) {
		

		my $quantity = $CGI->{$i._quantity};
		if ($quantity) {
			my $sku = $CGI->{$i._sku};
			my $description = $CGI->{$i._description};
			my $price = $CGI->{$i._price};		
			my $weight = $CGI->{$i._weight};
			my $group_text = $CGI->{$i._group_text};
			my $group_selected = $CGI->{$i._group_selected};
			my $category = $CGI->{$i._category};

			my $group;

			if ($group_text) {
				$group = $group_text;
			} else {
				$group = $group_selected;
			}
			$sql = "INSERT INTO quote_items VALUES ('$code', '$project', '1n',
'$sku', '$description', '$quantity', '$price', '$weight', '$group',
'$category', '', '')";
			my $ins = $Tag->query({
	    			 sql => $sql,
  				 hashref => 'ins',
			});

			$code++;
		}

			
	}
return $ret;
[/perl]

I hope you can give me some help.

Graham Hadgraft

On 19/07/07, Stefan Hornburg (Racke) <suppressed> wrote:
graham hadgraft wrote:
> I am trying to use the query tag in perl however i receive the following
> error.
>
> table products: Query on table quote_items failed: no access for
> database quote_items at
> /var/www/vhosts/jobs.avunit.com/interchange/lib/Vend/Data.pm line
> 1055. Query was: INSERT INTO quote_items VALUES ('25', '10', '1',
> 'CONF-LAB-LABAUD', 'Audio Engineer. Standard day rate', '7', '195.00',
> '', 'Labour', '', '', '')
>
> I have looked at this and added the following bit to my perl opening
> tag so that it now has.
>
> [perl tables=quote_items]
>
> however i still get this error.  How do i give this permission for
> interchange to place new items in this table.

Which Inerchange version ?
How does your complete code look like ?
Do you use one or multiple SQL databases for this catalog ?

        Racke

--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.